ltspice-mcp
Provides tools to read and modify LTspice schematics, run simulations, parse results, and generate plots.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ltspice-mcp
I wanted to learn about MCP, slash commands and claude.md files. Are DSLs a thing of the past? I created the following with Claude:
An MCP (Model Context Protocol) server that gives an LLM direct, tool-based access to LTspice circuit simulations — read schematics, set component values, run simulations, parse results, and generate plots, all from a Claude conversation.
What it does
Read & modify schematics — parse
.ascfiles, inspect components and parameters, patch valuesRun simulations — invoke LTspice headlessly via Wine (
-bbatch mode), get back log and output filesAnalyze results — parse
.raw/.op.rawbinary output: waveforms, node voltages, device currentsGenerate plots — auto-generated matplotlib scripts saved next to the schematic as a reproducible record
Related MCP server: LTspice MCP
MCP Tools
Tool | Description |
| Discover |
| Parse components, params, includes, directives from |
| Read |
| Write/overwrite |
| Run LTspice via Wine ( |
| Parse transient/AC |
| Parse DC operating point |
| Patch |
| Generate a new |
/analyze-circuit slash command
The flagship workflow. Run it from Claude Code on any .asc schematic:
/analyze-circuit examples/rc_filter/mystery_circuit.asc
/analyze-circuit /absolute/path/to/my_filter.asc
/analyze-circuit ← lists available schematics and promptsIt will:
Run the simulation via
run_simulationRead the DC operating point — transistor bias, operating region
Discover all waveforms (names, ranges, simulation type)
Detect high-frequency signals and switch to full-resolution rendering automatically
Write and execute a
<stem>_analysis.pyplot script next to the schematicDisplay the plot inline and provide a written circuit explanation
Example Analysis Output: AM Modulator (mystery_circuit.asc)
A collector-modulated AM transmitter built around a single 2N3904 NPN BJT.
; Sources
V1 30 V DC ; supply
V2 SINE(0 30m 600k) ; RF carrier — 30 mV, 600 kHz
V3 SINE(0 3.5 1k) ; audio modulating signal — 3.5 V, 1 kHz
; Bias network
R1 56k ; base voltage divider (top)
R2 15k ; base voltage divider (bottom)
R3 10k ; collector load
R4 4.7k ; emitter resistor — V3 (audio) connects at its bottom terminal
; Signal coupling
C1 100n ; AC-couples carrier (V2) into base
C2 100n ; emitter bypass (shorts R4 at RF frequencies)
C3 470p ; output coupling cap — collector → V(n002) load output
Q1 2N3904 ; common-emitter RF amplifier
R5 1k ; output loadHow it works: V3 (audio, 3.5 V) sits in series with R4 between the emitter and ground. As the audio signal swings, it shifts the effective emitter voltage at 1 kHz, varying Vbe and hence gm. Since the RF carrier is simultaneously being amplified at the base, its gain varies at the audio rate — producing AM modulation. C3 AC-couples the collector output to the load.
DC bias (Q1 in active region):
Parameter | Value |
Vcc | 30.0 V |
Vc (collector) | 18.0 V |
Vbe | 0.66 V |
Vce | 12.4 V |
Ic | 1.20 mA |
β | 334 |
/analyze-circuit output:

The top panel uses LTspice-style min/max-per-pixel rendering to produce the AM "football" shape at full 2 ms resolution — the green filled band is the 600 kHz carrier, its amplitude envelope tracing the 1 kHz audio signal (red dashed). The bottom panel zooms to 10–30 µs to show individual carrier cycles.
Setup
# Install in editable mode
pip install -e .
# LTspice runs via Wine — set path if different from default:
export LTSPICE_EXE="/home/user/.wine/drive_c/Program Files/LTC/LTspiceXVII/XVIIx64.exe"MCP config (~/.config/claude/claude_desktop_config.json)
{
"mcpServers": {
"ltspice": {
"command": "ltspice-mcp"
}
}
}Or without installing the package:
{
"mcpServers": {
"ltspice": {
"command": "python",
"args": ["-m", "ltspice_mcp.server"],
"cwd": "/path/to/ltspice-mcp/src"
}
}
}Workflow example: RC filter optimization
list_schematics(directory="examples/rc_filter/")
read_schematic(path="rc_filter.asc") # inspect components
read_parameters(path="params.inc") # current R=1k, C=100n → fc≈1.6kHz
write_parameters(path="params.inc", parameters={"R": 2200, "C": 47e-9})
run_simulation(schematic_path="rc_filter.asc")
read_waveforms(raw_path="rc_filter.raw", signals=["V(out)"])
# adjust values, repeatProject structure
src/ltspice_mcp/
server.py — MCP server, all tool definitions
raw_parser.py — .raw file parser (binary UTF-16-LE and ASCII)
runner.py — Wine subprocess runner (two-step: netlist → sim)
schematic_writer.py — .asc generator (auto-layout + wire routing)
examples/
rc_filter/
rc_filter.asc — RC low-pass filter demo
mystery_circuit.asc — AM modulator (this example)
mystery_circuit_analysis.py — auto-generated plot script
mystery_circuit_analysis.png — analysis output
.claude/commands/
analyze-circuit.md — /analyze-circuit slash command definitionRequirements
Python 3.10+
Wine with LTspice XVII installed
matplotlib,numpy(for generated plot scripts)MCP-compatible client (Claude Desktop or Claude Code)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- FlicenseCqualityCmaintenanceMCP server for automating LTspice on macOS, enabling simulation, schematic generation, data extraction, verification, and rendering via natural language or agents.7122-
- AlicenseNot gradedqualityBmaintenanceThis MCP server enables agents to control LTspice on macOS for running simulations, generating schematics, extracting data, and automating verification workflows.MIT
- AlicenseAqualityBmaintenanceAn MCP server that connects LLM assistants to real circuit simulation: LTspice and ngspice, plus direct editing of LTspice .asc schematics. Simulation results come back as structured numbers so the assistant can design, verify, and iterate on circuits.48868 PyPI81GPL 3.0
- AlicenseAqualityDmaintenanceMCP server for Micro-Cap 12 SPICE simulator enabling LLM agents to run analog circuit simulations, including analyses, sweeps, and retrieval of curve data and plots.205MIT