mcp-spice
Run ngspice circuit simulations in batch mode and retrieve parsed measurement results as JSON.
spice_run— Simulate a.cir/.spnetlist withngspice -b, returning parsed.measvalues (e.g.{name, value}) and a short log tail; no plots.netlist(required): path to the netlist file.cwd(optional): working directory.timeout_ms(optional): max runtime, default 60000 ms.
spice_toolchain_info— Probe the engine: returns the ngspice version and the active container/host runtime (e.g. rootless Podman image).Intended for AI coding agents and IDEs (Cursor, Windsurf, Copilot/Codex, Claude Code, etc.) via MCP stdio, so agents can iterate on circuit designs without scrolling raw simulator logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-spice Simulate rc_lowpass.cir and return the .meas results as JSON"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@zesun33/mcp-spice
Purpose and first steps
Run ngspice circuit netlists and retrieve measurement results through an MCP server.
Who it is for: Hardware engineers using an MCP-capable client or coding agent.
First task: Configure the server in your MCP client, then call spice_toolchain_info before running a design.
What to expect: Simulator availability, then parsed circuit measurements and execution status.
Current scope: Published MCP server. The npx command starts a stdio server that waits for a client; EDA execution also needs its documented host/container tools.
Start here: Runtime requirements and configuration.
Related projects: eda-docker-images, hw-agent-scaffold.
Model Context Protocol (MCP) server for ngspice batch circuit simulation.
mcp-spice lets AI coding agents and IDEs (Cursor, Windsurf, GitHub Copilot / OpenAI Codex, Claude Code, Google Antigravity, OpenCode, Cline) run SPICE netlists with ngspice in batch mode and get .meas results back as JSON instead of plot windows or thousand-line logs.
One-step with the rest of the family:
npx -y @zesun33/create-hw-agent my-asicOr run this published server alone:
npx -y @zesun33/mcp-spiceRelated MCP server: ltagent-mcp
Tools Exposed
Tool | Parameters | Engine | Description |
|
|
| Batch simulate a |
| none | Probe | ngspice version and active runtime/image. |
// Tool Call: spice_run {"netlist": "rc_lowpass.cir"}
{
"success": true,
"measurements": [{ "name": "vmid", "value": 0.63 }]
}Execution Runtime
mcp-spice runs inside the zesun33/spice rootless Podman image.
Public install (recommended — anyone can pull):
podman pull ghcr.io/zesun33/spice:latest
export MCP_SPICE_IMAGE=ghcr.io/zesun33/spicePublic GHCR (ghcr.io/zesun33/spice) is the default. Local builds still work as localhost/zesun33/spice via MCP_SPICE_IMAGE. To force host binaries: export MCP_SPICE_RUNTIME=host.
Universal Client & AI IDE Setup
Environment | Setup Location |
AI IDEs |
|
CLI Agents | Claude Code / OpenCode MCP config |
Desktop |
|
{
"mcpServers": {
"spice": {
"command": "npx",
"args": ["-y", "@zesun33/mcp-spice"],
"env": { "MCP_SPICE_IMAGE": "ghcr.io/zesun33/spice" }
}
}
}Until the package is on npm, point command at node and args at this repo's dist/index.js.
Verification & Testing
./scripts/verify.sh # full, needs podman + spice image
./scripts/verify.sh --quick # CInpm releases
See RELEASING.md for GitHub Actions dry runs and trusted publishing.
Available Tools
2 toolsspice_runA
Runs a SPICE netlist in ngspice batch mode (-b) and returns parsed .meas results plus a short log tail. Does not plot. Use spice_toolchain_info to probe the engine.
Inputs: netlist (required), cwd, timeout_ms.
spice_toolchain_infoA
Returns active container/host runtime and the ngspice version string.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
spice_run executes a simulation and returns results, while spice_toolchain_info reports environment/version details. Their purposes are completely distinct with no functional overlap.
Both tools share the spice_ prefix and snake_case style, but spice_run uses a verb while spice_toolchain_info is more noun-like. This is a minor inconsistency rather than a chaotic naming scheme.
With only two tools, the set is slightly below the typical 3-15 range, but it is still reasonable for a narrowly focused SPICE execution server. The small count matches the minimal scope.
The server covers the core run-and-inspect workflow with parsed .meas results and log tail access. It lacks raw output or full-log retrieval, but these are not obvious dead ends for the intended simple simulation use case.
Maintenance
Related MCP Connectors
Documentation for the Spektralwerk spectrometer SCPI API as a streamable HTTP MCP Server
Design, route, check, review and export manufacturable PCBs from plain language; KiCad import.
A free quantum job service: OpenQASM 3 run, checked and signed, with no account or key.
Remote MCP: JSON repair, JSON Schema validation, JSON to TypeScript, CSV to JSON and JSON to CSV.
Related MCP Servers
- AlicenseAqualityDmaintenanceA thin MCP server that wraps spicelib for circuit simulation. Exposes tools for running AC, transient, DC op, and parameter sweep analyses, enabling behavioral model fitting through iterative simulation and measurement comparison.48GPL 3.0
- AlicenseNot gradedqualityDmaintenanceGenerates, simulates, and inspects LTspice circuits via MCP tools and resources, providing structured JSON interfaces for AI agents.MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to generate Qucs circuit schematics, run simulations, and parse results programmatically.2MIT
- FlicenseNot gradedqualityBmaintenanceEnables debugging LTspice circuits through natural language by exposing netlists as structured text, including components, nodes, directives, static checks, and simulation logs, so LLMs can reason over circuit topology instead of screenshots.-