dirkenglund/pyspice-mcp-server
3.2
If you are the rightful owner of pyspice-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
PySpice MCP Server is a tool for creating and analyzing electronic circuits using the Model Context Protocol (MCP) with PySpice.
Tools
5
Resources
0
Prompts
0
PySpice MCP Server
MCP (Model Context Protocol) server for PySpice circuit simulation, providing tools for creating and analyzing electronic circuits.
Features
- Create and modify SPICE circuits programmatically
- Add components: resistors, capacitors, inductors, diodes, voltage/current sources
- Run analyses: DC operating point, transient, AC frequency response
- Generate plots: transient waveforms, Bode diagrams
- Export netlists for use with other SPICE tools
Installation
System-wide Installation
- Install dependencies:
cd /Users/englund/Projects/20250808-playground-spice/pyspice-mcp-server
source ../pyspice_env/bin/activate
pip install -r requirements.txt
- Create symlink for system-wide access:
sudo ln -s /Users/englund/Projects/20250808-playground-spice/pyspice-mcp-server /usr/local/lib/pyspice-mcp-server
- Add to Claude Desktop configuration:
{
"mcpServers": {
"pyspice": {
"command": "/Users/englund/Projects/20250808-playground-spice/pyspice_env/bin/python",
"args": ["/Users/englund/Projects/20250808-playground-spice/pyspice-mcp-server/pyspice_mcp_server.py"]
}
}
}
Available Tools
Circuit Creation
create_circuit
: Initialize a new circuitclear_circuit
: Clear the current circuit
Component Addition
add_resistor
: Add a resistoradd_capacitor
: Add a capacitoradd_inductor
: Add an inductoradd_voltage_source
: Add a DC voltage sourceadd_current_source
: Add a DC current sourceadd_sinusoidal_source
: Add an AC sinusoidal sourceadd_pulse_source
: Add a pulse voltage sourceadd_diode
: Add a diode
Analysis
run_dc_analysis
: DC operating point analysisrun_transient_analysis
: Time-domain transient analysisrun_ac_analysis
: AC frequency response analysis
Visualization
plot_transient
: Plot transient analysis resultsplot_bode
: Generate Bode plots from AC analysis
Utilities
get_netlist
: Export circuit netlist
Example Usage
# Create a simple RC filter
create_circuit("RC Low-Pass Filter")
add_voltage_source("V1", "in", "gnd", "1V")
add_resistor("R1", "in", "out", "1kOhm")
add_capacitor("C1", "out", "gnd", "1uF")
# Run AC analysis
run_ac_analysis("1Hz", "1MHz", 20)
plot_bode("out")
Requirements
- Python 3.8+
- PySpice 1.5+
- ngspice (system dependency)
- MCP SDK
License
MIT