MCP server for running ngspice simulations via spicelib
Project description
spicelib-mcp
A thin MCP server that wraps spicelib for circuit simulation. The heavy lifting, such as simulator invocation, .raw file parsing, and multi-simulator abstraction, is done by spicelib, which deserves most of the credit. This project is purely a transport layer that exposes spicelib's functionality as MCP tools for use with Claude Code (and other coding agents).
Primary use case: behavioral model fitting — run simulations, compare against real measurements, iterate on SPICE models.
Tools
run_ac_analysis— AC frequency sweep, returns magnitude/phase datarun_transient— transient simulation, returns time-domain waveformsrun_dc_op— DC operating point analysisrun_sweep— run multiple simulations in parallel, sweeping component values
Results are saved as .npz files alongside the netlist for further analysis and plotting.
Supported simulators
| Simulator | SPICE_SIMULATOR value |
Install |
|---|---|---|
| ngspice | ngspice (default) |
sudo apt install ngspice |
| LTspice | ltspice |
Download from Analog Devices |
| Qspice | qspice |
Download from Qorvo |
Set the SPICE_PATH environment variable to override the simulator binary location.
Setup
Copy .mcp.json.template to .mcp.json in your project directory and adjust SPICE_SIMULATOR if needed:
{
"mcpServers": {
"spicelib": {
"type": "stdio",
"command": "uvx",
"args": ["spicelib-mcp"],
"env": {
"SPICE_SIMULATOR": "ngspice"
}
}
}
}
Requirements
- Python 3.10+
- A supported simulator installed and on PATH
License
GPL-3.0-or-later
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spicelib_mcp-0.1.5.tar.gz.
File metadata
- Download URL: spicelib_mcp-0.1.5.tar.gz
- Upload date:
- Size: 136.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20ba789614dbc0205ccc87c14f92555b782a39c9e2567f71a3e33eef7da0713a
|
|
| MD5 |
603842b1de2877e9e9d240cb7279fcf8
|
|
| BLAKE2b-256 |
d24a42dc2b08f8044f71fcef631b62ace44c833c662592af4ee7aa693961035d
|
Provenance
The following attestation bundles were made for spicelib_mcp-0.1.5.tar.gz:
Publisher:
release.yml on lucasgerads/spicelib-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spicelib_mcp-0.1.5.tar.gz -
Subject digest:
20ba789614dbc0205ccc87c14f92555b782a39c9e2567f71a3e33eef7da0713a - Sigstore transparency entry: 1304044710
- Sigstore integration time:
-
Permalink:
lucasgerads/spicelib-mcp@e62f185fd6c0f35c3fcca5adf2eda2f51ea2ac4f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasgerads
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e62f185fd6c0f35c3fcca5adf2eda2f51ea2ac4f -
Trigger Event:
push
-
Statement type:
File details
Details for the file spicelib_mcp-0.1.5-py3-none-any.whl.
File metadata
- Download URL: spicelib_mcp-0.1.5-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df59ebad545d4d6afda9e82b4d7867817932e47d5266f07cfe39c0ca002211e
|
|
| MD5 |
783d37736f7fce1f2187132a1538bfa6
|
|
| BLAKE2b-256 |
b1db18f394198028c17b4e455cf6f0b713f62c6c8a5078568c7123f6ed924236
|
Provenance
The following attestation bundles were made for spicelib_mcp-0.1.5-py3-none-any.whl:
Publisher:
release.yml on lucasgerads/spicelib-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spicelib_mcp-0.1.5-py3-none-any.whl -
Subject digest:
3df59ebad545d4d6afda9e82b4d7867817932e47d5266f07cfe39c0ca002211e - Sigstore transparency entry: 1304044781
- Sigstore integration time:
-
Permalink:
lucasgerads/spicelib-mcp@e62f185fd6c0f35c3fcca5adf2eda2f51ea2ac4f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasgerads
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e62f185fd6c0f35c3fcca5adf2eda2f51ea2ac4f -
Trigger Event:
push
-
Statement type: