Skip to main content
Glama
zesun33
by zesun33

@zesun33/mcp-spice

Model Context Protocol (MCP) server for ngspice batch circuit simulation.

License: Apache-2.0 CI Protocol: MCP Runtime: Rootless Podman

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-asic

Or this server alone after it is on npm:

npx -y @zesun33/mcp-spice

Tools 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/spice

Local builds still work as localhost/zesun33/spice (the default). Override with 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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zesun33/mcp-spice'

If you have feedback or need assistance with the MCP directory API, please join our Discord server