ltspice-mcp
Work in progress. Expect breaking changes across versions.
ltspice-mcp is an MCP server that lets an AI assistant simulate circuits with
LTspice or ngspice and edit LTspice schematics. Its goals are speed,
correctness, token efficiency and clean schematics.
The assistant uses ready-made, well-tested tools, which know the quirks of
SPICE and of each simulator, instead of improvised scripts.
Mechanical checks catch common errors before a file is written or run, and
direct the assistant's attention to the right place. Layout is left to the
assistant's judgment, not an auto-router.
Results come back as named numbers, such as a phase margin, instead of
waveforms to read. To see a waveform yourself, ask for an interactive chart,
shown in the chat where the client supports it.
Sweeps, corners and Monte Carlo take one call and run as background jobs that
survive a restart and can be replayed.
With LTspice 26.1 or later on Windows, you and the assistant can edit the same
open schematic (Working with LTspice open).
Everything the tools do is also available from Python, as the
ltspice_mcp.api package. The server is built on
spicelib.
Quick start
Claude Code:
/plugin marketplace add cognitohazard/ltspice-mcp
/plugin install ltspice-mcp
Claude Desktop: build the extension in packaging/mcpb/
and drag the .mcpb file onto Claude Desktop. The extension asks for an
optional sandbox folder. If you leave it blank, there is no sandbox.
Cursor, Codex and other MCP clients (Windsurf, Gemini CLI, Continue, Cline, Zed, …): install the server and add it to the client's MCP config.
uv tool install ltspice-mcp # or: pipx install ltspice-mcp
{
"mcpServers": {
"spice": { "command": "ltspice-mcp", "args": [] }
}
}
Cursor reads this JSON from .cursor/mcp.json
in the project, or from ~/.cursor/mcp.json for every project.
Codex reads TOML from
~/.codex/config.toml:
[mcp_servers.spice]
command = "ltspice-mcp"
tool_timeout_sec = 660
Codex stops a tool call after 300 s by default; run_code can run for 600 s.
The server needs Python 3.11 or newer. If a client cannot find ltspice-mcp,
set command to its full path (on Windows, the ltspice-mcp.exe in the
folder uv tool dir --bin prints). In Claude Code,
claude mcp add -s project spice -- ltspice-mcp adds it without editing the
JSON.
You also need LTspice or ngspice on the same machine. The server finds
either one on Windows and Linux. On WSL, set the LTspice path yourself
(WSL).
Editing .asc schematics needs LTspice, because the server uses LTspice's
symbol libraries. Reading and checking netlists works without a simulator.
The plugin and the extension need uv.
macOS support is experimental. Run the server as an ordinary user, not
as root.
Make sure the assistant uses the server. Some assistants run the
simulator from the shell instead. Name the server spice, as the plugin
does, and not ltspice, which is the name LTspice's own MCP server takes.
Then add this rule to your project's CLAUDE.md or your client's equivalent:
Always use the spice MCP server for any SPICE/circuit simulation, sweep,
or analysis. Do not invoke ngspice or LTspice from the shell, and do not
hand-parse .raw files or wrdata output.
If you prefer a less strict rule, When the shell is fine
lists the cases in which running the simulator from the shell is acceptable.
LTspice's own MCP server. LTspice 26.1 and later include an MCP server,
which registers as ltspice and can run beside this one. It drives the
LTspice window and returns raw samples and logs, leaving measurements and
Monte Carlo setup to the assistant. This server does not need it. Alongside
LTspice's own MCP server
describes an LTspice setting you may want to change.
Examples