MCP server (AI assistants)¶
mc9 mcp starts a Model Context Protocol server so an AI assistant (Claude Code, Claude
Desktop, any MCP client) can run MC9 for you: build a circuit from a description, run analyses, read the numbers and look at
MC9's screenshots.
Set it up¶
-
Install with the
mcpextra, inside the virtual environment from the install page:pip install "mc9py[mcp]" -
Find where the
mc9program is, because the assistant starts it itself and does not know about your virtual environment:which mc9 # PowerShell: (Get-Command mc9).Source # e.g. /home/you/mc9-env/bin/mc9 or C:\Users\you\mc9-env\Scripts\mc9.exe -
Claude Code: run this in an ordinary terminal (not in Python), with the path from step 2:
claude mcp add microcap9 -- /home/you/mc9-env/bin/mc9 mcp claude mcp listIf
mc9is on yourPATH(for example afterpipx install),claude mcp add microcap9 -- mc9 mcpis enough. Without a direct path you can also usepython -m mc9 mcpwith the environment's Python. -
Claude Desktop and other clients: add this to the client's config and restart it. Claude Desktop: Settings -> Developer -> Edit Config (
~/.config/Claude/claude_desktop_config.jsonon Linux,%APPDATA%\Claude\claude_desktop_config.jsonon Windows):{ "mcpServers": { "microcap9": { "command": "/home/you/mc9-env/bin/mc9", "args": ["mcp"] } } }
Tools¶
| Group | Tools |
|---|---|
| Files | import_circuit, export_circuit (never overwrites), list_circuits, circuit_info, set_component, set_analysis |
| Analyses | ac_sweep, transient, dc_sweep, operating_point, distortion_plot, dynamic_dc, dynamic_ac |
| Plot tools | place_cursors, screenshot, exit_analysis |
| Measurements | measure_bandwidth, measure_rin, measure_rout, measure_thd |
| Audio amplifier | amp_design, build_power_amplifier, amp_measure |
| Many runs | step_parameter, clear_steps, set_tolerance, monte_carlo, add_model_text, optimize |
| Building | build_schematic (JSON parts + wires), build_netlist (SPICE-like, auto-placed) |
| Housekeeping | stop_mc9, reset_sandbox |
The server is a thin layer over the Python library, so everything an assistant does is reproducible as a script. Screenshots are returned as images the assistant can look at.