Claude Code Setup
mcltspice communicates over standard MCP stdio transport. The examples below show the three main ways to configure it.
Add to Claude Code
Section titled “Add to Claude Code”The quickest option. This pulls the latest published version from PyPI and runs it with uvx:
claude mcp add mcltspice -- uvx mcltspiceIf you need to pin a specific version:
claude mcp add mcltspice -- uvx mcltspice==2026.2.10For working on mcltspice itself, point at your local checkout:
claude mcp add mcltspice -- uv run --directory /path/to/mcltspice mcltspiceThis uses uv run to resolve dependencies from the local pyproject.toml and run the entry point. Changes to the source take effect on the next server restart.
Create or edit .mcp.json in your project root (or ~/.mcp.json for global scope):
{ "mcpServers": { "mcltspice": { "command": "uvx", "args": ["mcltspice"], "env": { "LTSPICE_DIR": "/home/you/ltspice/extracted/ltspice" } } }}The env block is optional. Include it only if your LTspice files are not at the default path.
For local development, swap the command:
{ "mcpServers": { "mcltspice": { "command": "uv", "args": ["run", "--directory", "/path/to/mcltspice", "mcltspice"] } }}Other MCP clients
Section titled “Other MCP clients”Any MCP client that supports stdio transport can use mcltspice. The generic configuration is:
| Field | Value |
|---|---|
| Transport | stdio |
| Command | uvx |
| Arguments | ["mcltspice"] |
| Environment | LTSPICE_DIR (optional) |
The server reads from stdin and writes to stdout using JSON-RPC over the MCP protocol. No HTTP server, no ports to configure.
Passing environment variables
Section titled “Passing environment variables”If your LTspice installation is not at the default path, set LTSPICE_DIR in whichever way your client supports:
- Claude Code CLI: Pass it through the
envfield in.mcp.json(shown above). - Shell:
export LTSPICE_DIR=/path/to/ltspicebefore launching the client. - Docker: Add
-e LTSPICE_DIR=/path/to/ltspiceto yourdocker runcommand.
Verify the connection
Section titled “Verify the connection”After adding the server, ask your MCP client to call the check_installation tool:
check_installation()If the server is connected and LTspice is found, you will get a status report confirming the Wine version, LTspice binary path, and library availability. If anything is missing, see Prerequisites.