Skip to main content
Glama
mcp-spice
by zesun33

@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.

Choose another project.

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 -y @zesun33/create-hw-agent my-asic

Or run this published server alone:

npx -y @zesun33/mcp-spice

Related MCP server: ltagent-mcp

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

Public 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

npm releases

See RELEASING.md for GitHub Actions dry runs and trusted publishing.

Available Tools

2 tools
spice_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

    A4/5.0

    Scored across 2 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A 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.
      4
      8
      GPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Generates, simulates, and inspects LTspice circuits via MCP tools and resources, providing structured JSON interfaces for AI agents.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP-compatible agents to generate Qucs circuit schematics, run simulations, and parse results programmatically.
      2
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      -