Circuit Sim Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Circuit Sim Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Model Context Protocol (MCP) server that provides circuit simulation capabilities using PySpice. This server allows you to create, simulate, and analyze electronic circuits through a simple tool-based interface.
Fully Tested & Production Ready - PySpice 1.5 + ngspice 44 compatibility verified on ARM64/Apple Silicon macOS.
# Install ngspice with ARM64 compatibility
/opt/homebrew/bin/brew install ngspice libngspicesudo apt-get install ngspice# Clone the repository
git clone <repository-url>
cd circuit-sim-mcp
# Install in development mode
pip install -e .For optimal compatibility on Apple Silicon Macs, set up the library path:
export DYLD_LIBRARY_PATH="/opt/homebrew/Cellar/libngspice/44.2/lib:$DYLD_LIBRARY_PATH"Add this to your shell profile (.zshrc, .bash_profile) for persistence.
The package will automatically install:
mcp - Model Context Protocol Python SDKpydantic - Data validationnumpy - Numerical computationsmatplotlib - Plotting (optional)The server can be run as a standalone MCP server:
python -m circuit_sim_mcpConfigure your MCP client to use this server:
{
"mcpServers": {
"circuit-sim": {
"command": "python3",
"args": ["-m", "circuit_sim_mcp"],
"env": {
"DYLD_LIBRARY_PATH": "/opt/homebrew/Cellar/libngspice/44.2/lib"
}
}
}
}Note: The DYLD_LIBRARY_PATH environment variable is crucial for ARM64/Apple Silicon compatibility with ngspice 44.
Here's a simple voltage divider example:
import asyncio
from circuit_sim_mcp.server_basic import CircuitSimServer
async def main():
sim_server = CircuitSimServer()
server = sim_server.server
# Create a voltage divider circuit
components = [
{
"component_type": "voltage_source",
"name": "V1",
"voltage": 10.0,
"nodes": ["vin", "gnd"],
"source_type": "DC"
},
{
"component_type": "resistor",
"name": "R1",
"resistance": 1000.0,
"nodes": ["vin", "vout"]
},
{
"component_type": "resistor",
"name": "R2",
"resistance": 1000.0,
"nodes": ["vout", "gnd"]
}
]
# Create the circuit
result = await server.call_tool("create_circuit", {
"name": "voltage_divider",
"components": components
})
# Perform DC analysis
dc_result = await server.call_tool("simulate_dc", {
"circuit_name": "voltage_divider",
"output_nodes": ["vin", "vout", "gnd"]
})
print(f"DC Analysis: {dc_result}")
if __name__ == "__main__":
asyncio.run(main())See examples/simple_voltage_divider.py for a complete working example.
{"component_type": "resistor", "name": "R1", "resistance": 1000.0, "nodes": ["n1", "n2"]}{"component_type": "capacitor", "name": "C1", "capacitance": 1e-6, "nodes": ["n1", "n2"]}{"component_type": "inductor", "name": "L1", "inductance": 1e-3, "nodes": ["n1", "n2"]}{"component_type": "voltage_source", "name": "V1", "voltage": 5.0, "nodes": ["n1", "n2"], "source_type": "DC"}{"component_type": "current_source", "name": "I1", "current": 1.0, "nodes": ["n1", "n2"], "source_type": "DC"}{"component_type": "diode", "name": "D1", "nodes": ["n1", "n2"], "model": "D"}{"component_type": "diode", "name": "LED1", "nodes": ["anode", "cathode"], "model": "LED"}{"component_type": "transistor", "name": "Q1", "transistor_type": "npn", "nodes": ["collector", "base", "emitter"], "model": "2N2222"}Components also accept "value" as an alternative to specific field names:
"value": 1000 (same as "resistance": 1000)"value": 1e-6 (same as "capacitance": 1e-6)"value": 5.0 (same as "voltage": 5.0 or "current": 1.0)⚠️ Important: Node names cannot be Python keywords. Use descriptive names like:
vin, vout (instead of in, out)vcc, vdd, gnd (instead of class, def, if)This repository has two main branches with different feature sets:
main branch (Current - Basic Version)advanced-features branchTo access advanced features:
git checkout advanced-featurespython -m pytest tests/circuit.pyComponent.from_dict() methodCircuit._component_to_netlist()Fixed in this version: PySpice 1.5 is patched to work with ngspice 44. If you encounter version compatibility issues:
ngspice --version should show version 44.xIf you see library loading errors:
# Set the correct library path for ARM64 Homebrew ngspice
export DYLD_LIBRARY_PATH="/opt/homebrew/Cellar/libngspice/44.2/lib:$DYLD_LIBRARY_PATH"If you get PySpice import errors:
pip uninstall numpy PySpice
pip install numpy PySpiceIf simulations fail:
debug_simulation tool to get detailed SPICE outputvalidate_circuit tool to identify common issuesFor advanced features like intelligent datasheet prompting, circuit complexity analysis, and datasheet-based components, check out the advanced-features branch:
git checkout advanced-featuresMIT License - see LICENSE file for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.