@zesun33/mcp-spice
v0.1.1
Published
Model Context Protocol (MCP) server for ngspice batch circuit simulation
Readme
@zesun33/mcp-spice
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 @zesun33/create-hw-agent my-asicOr this server alone after it is on npm:
npx -y @zesun33/mcp-spiceTools Exposed
| Tool | Parameters | Engine | Description |
| :--- | :--- | :--- | :--- |
| spice_run | netlist: string, cwd?: string, timeout_ms?: number | ngspice -b | Batch simulate a .cir/.sp file. Parses .meas assignments. Does not plot. |
| spice_toolchain_info | 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 | .cursor/mcp.json or .windsurf/mcp.json |
| CLI Agents | Claude Code / OpenCode MCP config |
| Desktop | claude_desktop_config.json |
{
"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 # CI