# ltspice-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/Cognitohazard/ltspice-mcp  
**GitHub Stars:** 88  
**Views:** 19  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ltspice-mcp

## Description
MCP server giving LLMs the ability to design, simulate, and analyze SPICE circuits via LTSpice and NGspice

## Tools
Capabilities this server exposes over MCP:

- **plot_waveform** — Render an interactive chart (zoom/pan/hover) of one or more signals for a person to look at. The chart type follows the run (transient, DC sweep, AC Bode, noise), a .step or Monte Carlo run overlays every step, and each unit gets its own panel.

Writes a self-contained HTML file and returns its path — into ``out_dir`` if given, else the server's store. On a host that supports MCP Apps the chart is also embedded as an in-chat widget; otherwise it opens in your local browser. The reply summarizes each trace (min and max and where, first and final value, mean on a transient); attach_plot adds a PNG; in_ltspice also opens the run in the user's LTspice window.

For more numbers use analyze_results: the waveform recipe returns a table (or CSV on disk), and signal_stats and the bode_* recipes return scalars.
- **analyze_results** — Measure finished simulation results: apply typed recipes to completed jobs, RAW or log files and get values, reductions, group splits and spec verdicts attributed to case, run and .step. One call spans many sources and many metrics, so batch them instead of calling per metric. Work is bounded by a compute budget; a partial response returns a result_set_id and cursor to resume with 'continue'. On a wide sweep set include.fields to return only the numbers you need. Recipes: stability (phase margin, gain margin, unity-gain crossover, DC gain), bode_filter (cutoff, bandwidth, Q), bode_point, bode_slope (dB/decade), bode_crossing, ac_structure (poles, zeros), resonance, return_loss (VSWR), thd (distortion), tone (amplitude and phase at one frequency), noise_integral, signal_stats (RMS, ripple, peak-to-peak, percentiles), edges (rise/fall time), timing (propagation delay), periodic (duty cycle), transient_response (overshoot, settling, load step), operating_point (bias point, gm/gds/vth), measurements (.meas), value (one trace at one axis point), summary, waveform (samples, CSV), plot (chart). inspect(kind='reference', query=...) searches these by plain words and returns a recipe's fields. A signal is one trace or V(a,b), not an expression; other trace math is numpy (guide section 'signals').
- **run_experiments** — Run SPICE and get the numbers back in one call: point it at your deck(s), attach an 'analyze' block, and the measured values return with the results — from a one-off spot check to a full sweep or Monte Carlo grid. Express the whole sweep as one 'variations' grid rather than a call per point: cases run in parallel up to the server's cap, so a grid costs one call and one receipt, not one of each per case. When unsure about a behavior, assumption, or sizing, run a small experiment and read the numbers rather than reasoning it out. Quick runs return results inline; longer ones return a receipt to follow with 'jobs'. Every job is recorded on disk; pass your own request_id to make a retry replay the same job instead of running a new one.
- **jobs** — Check on, wait for, or stop a run you started, by job_id or the request_id it was submitted under. 'wait' blocks server-side until the job finishes — prefer it to polling 'status' in a loop; 'status' snapshots it now; 'cancel' stops it (owner process, or the receipt's control_token); 'runs' pages the full per-run records, artifact paths included; 'list' with no circuit is the recently-touched-circuits view for picking up work from an earlier session. 'resume' creates a child of a terminal recoverable head, preserving produced cases; use a new resume_request_id for each retry. 'place_beside_sheet' copies a case's results beside the .asc it ran, where LTspice's window opens them. Fields by action: status: job_id, request_id; wait: job_id, request_id, timeout_s, wait_for; cancel: job_id, request_id, control_token; list: circuit, limit, cursor; runs: job_id, request_id, cursor, run_fields; resume: job_id (required), resume_request_id (required), control_token, case_ids, retry_failed, retry_cancelled, wait_s; place_beside_sheet: job_id, request_id, case_id.
- **inspect** — Read-only lookups over the server and the circuits it can reach, batched as independent 'queries'. Kinds: 'capabilities', 'symbols', 'symbol', 'net', 'components', 'hierarchy', 'model', 'results', 'reference', 'guide', 'simulator_docs', 'open_in_ltspice' — each with its own arguments, described on its branch of the query schema. 'reference' searches every tool's recipes, ops, checks and their fields in plain words ('phase margin'). 'guide' returns the guide's core, or one 'section' its index names. A denied path, a stale cursor, an unknown kind, or a malformed query fails only that item; every other query still returns, and paginated kinds resume via 'cursor'. It is the only tool on this surface that never writes.
- **edit_schematic** — Apply a typed op batch to an LTspice .asc schematic in one revision-guarded, transactional call. base='blank' builds a whole circuit from an empty sheet; base='existing' applies deltas. Pass expected_sha256 of the file you edited against (required when the target exists) — a peer that committed first yields revision_conflict with nothing written. Returns geometry facts (pin/net table, wiring metric) and an optional post-commit netlist verification against a reference. To draw the sheet, call verify_circuit with a render policy.
- **verify_circuit** — Check a circuit file, and optionally render it. It does not change the file it checks, or write next to it unless export_to='sidecar'. For a netlist: SPICE syntax, directive and element arity, non-ASCII value suffixes such as µ, and connectivity facts — nodes wired to one terminal, V()/I() naming something no element declares, nets with no DC path to ground, a parameter given twice. For an .asc: symbol and pin resolution, the authoritative LTspice netlist export (which silently drops wires the file appears to contain), geometric layout facts (overlapping bodies, wires through a body, floating pins, dangling wire ends and labels, a wire drawn twice), and quality facts (net connected only by label stubs with no drawn wire; text or a label anchored inside a symbol; stacked directives; a part giving a parameter twice; a byte order mark LTspice rejects). Supply 'compare' to compare against a known-good netlist: wiring, values and directives (equivalence), or a node-blind delta (structural_diff). Every fixable finding carries its location and subject. in_ltspice also opens the file in the user's LTspice window.
- **run_code** — Run a Python snippet in a warm worker that holds this server's Python API as `api`. The snippet has the server process's own file and process authority, which no sandbox confines, so permission this tool like a shell. For loops over many runs, numpy on samples, and compute-decide-compute; a single run or measurement is a tool call. Trace math is numpy on one step's traces, r.trace(name, step=k) on r.axis(step=k); compute_signal_stats and time_weighted_quantiles weight a derived trace's statistics and quantiles by time, which np.mean and np.percentile do not (guide section 'signals'). In scope: api (the same six ops as methods on this working directory, complete results, no paging), np, load_raw, measurements, reference, window_and_clean, compute_signal_stats, time_weighted_quantiles — reference('run_experiments') lists an op's arguments, so read it before guessing them. Every call is a fresh namespace around the same live `api`; keep state on disk (a job by request_id, a file). stdout keeps the first 12000 and last 4000 characters of print() output, stderr its last 4000, result the repr of a trailing expression (4000). Bound: timeout_s, default 60 (max 600); a timeout interrupts the snippet and cancels a run it waits on. One snippet at a time: a call during another is answered busy, not queued.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "ltspice-mcp": {
    "command": "uvx",
    "args": ["ltspice-mcp"]
  }
}
```

## Documentation

## What ltspice-mcp does

ltspice-mcp gives MCP clients access to LTspice and ngspice simulations while working with the ordinary circuit files used by those applications. It can run a single simulation, execute parameter sweeps, or create Monte Carlo runs with component tolerances, model variation, and device mismatch. QSPICE and Xyce are also available for selected netlist runs; LTspice is required for `.asc` schematic editing.

Measurements cover transient, AC, DC, noise, and operating-point work. Available analyses include rise and fall time, overshoot, settling, propagation delay, RMS, THD, filter cutoff and bandwidth, resonance and Q, gain and phase margins, integrated noise, `.MEAS` results, and device values such as `gm`, `gds`, and `vth`. Results include simulator warnings, missing measurements, and extreme values alongside the affected values.

## How it works

`run_experiments` accepts one or more decks and an analysis block, returning measurements inline for short work or a receipt for longer jobs. A variations grid expresses a sweep or Monte Carlo batch in one request, with cases running in parallel up to the server limit. The `jobs` tool can wait for completion, inspect records and artifact paths, or cancel a run. Job records are stored in the working directory, and a caller-supplied request ID can make retries replay the same submitted job.

Use `analyze_results` for completed jobs or existing `.raw` files. It supports multiple sources and metrics in one call, with cursors and result-set IDs for work that exceeds the compute budget. `plot_waveform` creates a self-contained interactive HTML chart and returns its path; it displays a chart rather than numeric samples. `run_code` provides a Python worker with access to the server API, NumPy, raw-file loading, measurements, and recipe references.

## Setup and configuration

Python 3.11 or newer is required. Install the package with `uv tool install ltspice-mcp` or `pipx install ltspice-mcp`, then register the command as a standard MCP server, for example:

```json
{
  "mcpServers": {
    "spice": { "command": "ltspice-mcp", "args": [] }
  }
}
```

The machine must have LTspice or ngspice for simulation. The server locates installed simulators on Windows, Linux, and macOS; WSL requires an explicitly configured LTspice path. Netlist reading and checking can work without a simulator, while `.asc` editing needs LTspice and its symbol libraries. Claude Code can add the server with `claude mcp add -s project spice -- ltspice-mcp`. Claude Desktop can use the packaged extension from `packaging/mcpb/`. Other supported clients require their MCP configuration to point at the installed command.

Name the registration `spice` when using it alongside LTspice's own MCP server, which uses the name `ltspice`.

## Tools and capabilities

- `run_experiments` runs simulations, sweeps, and Monte Carlo grids with optional measurements.
- `jobs` waits for, checks, cancels, and lists submitted work.
- `analyze_results` applies typed measurement recipes to finished runs or `.raw` files.
- `inspect` reads capabilities, symbols, nets, components, models, and recipe references without writing files.
- `edit_schematic` creates or changes `.asc` files using transactional, revision-checked operations.
- `verify_circuit` checks syntax, connectivity, schematic geometry, LTspice netlist export, and optional graph comparisons.
- `plot_waveform` generates interactive charts for transient, DC, AC, noise, stepped, and Monte Carlo results.
- `run_code` executes Python against the live engine in a single warm worker, with time limits and captured output.

Schematic edits can place components, wire pins, and label nets. Verification reports issues such as floating pins, dangling wire ends, invalid connectivity, and wires silently omitted by LTspice's authoritative netlist export. Edits to an existing file require the expected file hash, so a concurrent change produces a revision conflict without writing partial results.

## Limitations and notes

The server is a work in progress, and its newer tool surface differs from older one-operation tools. LTspice is the primary simulator; QSPICE and Xyce are limited to selected netlist workflows, and QSPICE requires native Windows execution. Schematic editing is specific to LTspice `.asc` files and depends on LTspice's symbol libraries.

`run_code` has the file and process authority of the server rather than an isolated sandbox, so it should be permitted like a shell-capable tool. Only one code snippet runs at a time. Its default timeout is 60 seconds, with a maximum of 600 seconds; a timeout interrupts the snippet and cancels a run it is waiting for. Waveform plots are visual outputs, so numeric extraction should use `analyze_results` recipes such as `waveform`, `signal_stats`, or the Bode analyses.

_Full upstream README: https://allmcps.com/mcp/ltspice-mcp/readme_

