circuitjs-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@circuitjs-mcp Build a 1kΩ/1µF RC low-pass and simulate its response to a 1kHz square wave for 5ms"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
circuitjs-mcp
An MCP server that lets AI agents operate the Falstad CircuitJS1 circuit simulator. Since it is a standard stdio MCP server, it works with any MCP-compatible client, including Claude Code, Codex CLI, Claude Desktop, and Cursor.
CircuitJS1 is the name of the HTML5/JavaScript version of Paul Falstad's circuit simulator—long familiar as the Java applet version, "Circuit Simulator Applet", and now running in the browser at falstad.com/circuit. When browsers discontinued Java applet support, Iain Sharp ported it to JavaScript with GWT; both the simulation engine and the circuit text format are shared with the applet version (circuit files from the applet era can be loaded as-is). The JavaScript interface this server uses is a feature added in CircuitJS1 and is not present in the applet version.
The server launches the compiled CircuitJS1 web app (bundled in webapp/, works offline) inside headless Chromium (Playwright) and exposes its JavaScript interface as MCP tools. Simulator state persists across tool calls, so you can interactively load a circuit → run it → take measurements → rewrite the circuit.
Setup
Prerequisites: Node.js 18 or later.
cd circuitjs-mcp
npm install # postinstall で Playwright の Chromium も入ります
npm test # スモークテスト(RC回路の過渡応答が理論値と一致するか等を検証)If playwright install chromium is difficult in your environment, you can use an existing Chrome/Chromium:
export CIRCUITJS_CHROMIUM="/usr/bin/google-chrome" # 例Related MCP server: circuit-sim-mcp
Registering with MCP cliients
The launch command is the same for every client: node /絶対パス/circuitjs-mcp/server.mjs
Adding the environment variable CIRCUITJS_HEADFUL=1 displays the browser window, allowing a human to operate the same simulator directly alongside the agent (collaboration mode). All examples below include this variable; remove it if not needed.
Claude Code:
claude mcp add circuitjs -e CIRCUITJS_HEADFUL=1 -- node /絶対パス/circuitjs-mcp/server.mjsCodex CLI:
codex mcp add circuitjs --env CIRCUITJS_HEADFUL=1 -- node /絶対パス/circuitjs-mcp/server.mjsClients that use config files (Claude Desktop's claude_desktop_config.json, Cursor's mcp.json, etc.):
{
"mcpServers": {
"circuitjs": {
"command": "node",
"args": ["/絶対パス/circuitjs-mcp/server.mjs"],
"env": { "CIRCUITJS_HEADFUL": "1" }
}
}
}The screenshot tool returns a PNG as MCP image content. On clients that do not support image display, save it to a file with the save_path argument instead.
List of tools
Tool | Description |
| Loads a circuit in Falstad text format (with validation). Returns the element list |
| Gets the time, voltage differences / currents / terminal voltages of all elements, and voltages of labeled nodes |
| Runs for the specified simulation time and returns sampled time series from probes (node voltages, element current/voltage/power) |
| run / stop / reset / status, maximum timestep setting, and value setting for external voltage sources |
| Exports the circuit in Falstad text or SVG |
| Generates a URL ( |
| PNG screenshot of the current schematic (returned as an image; can also be saved to a file) |
| Escape hatch for operations not covered above. Executes arbitrary JS on the |
Usage examples (sample instructions for an agent)
"Build an RC low-pass filter with 1kΩ and 1µF, feed it a 1kHz square wave, and capture the output waveform for 5ms."
"Load this circuit (paste the text) and list the power dissipation of each resistor."
"Show me a screenshot of the circuit."
To measure a point of interest, place a labeled node (element type 207, e.g. 207 336 128 400 128 4 out); the voltage can then be read with a {"node":"out"} probe or via circuit_state's nodes. For per-element current and voltage, use the index returned by circuit_load / circuit_state.
Direct use from scripts
If you want to call the tools from a script without going through an MCP client, use drive.mjs. It starts the server as a child process, executes the JSON files placed in the command directory (cmd-1.json, cmd-2.json, ...) in order, and writes the results to res-N.json:
node drive.mjs /tmp/cjs-commands
# 別プロセスから: echo '{"tool":"circuit_state","args":{}}' > /tmp/cjs-commands/cmd-1.jsonWrite files under a temporary name and then rename them into place (to avoid reading them mid-write).
Environment variables
Variable | Description |
| Path to the Chrome/Chromium executable to use (default: Playwright-managed Chromium; falls back to system Chrome if it fails) |
| URL of a CircuitJS1 web app to load instead of the bundled one (e.g., |
| Set to |
Limitations
The simulation speed of
run_transientdepends on the simulation speed setting in the circuit's$line and on the CPU. If it takes too long in wall-clock time, it is cut off bywallTimeoutMsand partial data is returned (distinguishable via thereasonfield)."Editing" a circuit basically means rewriting the Falstad text and calling
circuit_loadagain (importing resets the time).Transient analysis only (CircuitJS1 itself does not have AC small-signal analysis, etc.). Frequency response can be obtained by sweeping the frequency and repeating
run_transient.
License
This entire repository is provided under GPL-2.0-or-later (COPYING.txt).
CircuitJS1 is GPLv2+ software by Paul Falstad / Iain Sharp.
webapp/is its compiled build (unmodified); the corresponding source code is available at pfalstad/circuitjs1 (the original) and thepagesbranch of code4fukui/circuitjs1 (where this build was obtained).Server code (
server.mjs,drive.mjs,test-client.mjs) © 2026 Suzu(涼鈴), GPL-2.0-or-later.
Available Tools
8 toolscircuit_exportExport circuitB
Export the current circuit as Falstad text format, or as an SVG drawing of the schematic.
Inputs: format.
circuit_linkGet shareable linkA
Return a URL that opens the circuit in the Falstad simulator in any normal browser (falstad.com, no install needed). Uses the current circuit unless text is given. Give this link to the user so they can view/edit the circuit interactively in Chrome.
Inputs: base, text.
circuit_loadLoad circuitA
Replace the current circuit with the given circuit definition in Falstad CircuitJS1 text format (the same format produced by File > Export as Text, starting with a "$" line). Resets simulation time to 0. Returns the list of parsed elements so you can verify the circuit and note element indices for probing. The simulator keeps state between tool calls.
Inputs: text (required), run.
circuit_stateRead circuit stateA
Read the current simulation state: time, running flag, timestep, and every element with its voltage difference, current, post voltages and info string. Use the element index values with run_transient probes. Optionally pass node names (of labeled nodes, e.g. from "207 ..." labeled-node elements) to read their voltages.
Inputs: nodes.
eval_jsEvaluate JavaScript against the simulatorA
Advanced escape hatch: run arbitrary JavaScript inside the CircuitJS1 page. The code is the body of an async function receiving sim (the CircuitJS1 object, see https://www.falstad.com/circuit/doc/js-interface.html). Return a JSON-serializable value. Example: "return sim.getElements().filter(e => e.getType()==='ResistorElm').map(e => e.getCurrent())".
Inputs: code (required).
run_transientRun transient simulationA
Run the simulation for a given amount of SIMULATED time while sampling probes, then stop. Returns time-series data {t, }. Probes: {"node":"name"} reads a labeled node voltage; {"element":i,"quantity":"current"|"voltageDiff"|"power"} reads element i (indices from circuit_state/circuit_load). Simulation speed is bounded by the circuit's sim-speed setting and CPU, so wall-clock time may differ from simulated time; the call aborts with partial data if wallTimeoutMs elapses first.
Inputs: probes (required), seconds (required), fromReset, maxSamples, +1 more.
screenshotScreenshot the schematicA
Take a PNG screenshot of the circuit as currently drawn (including scope traces if the circuit defines scopes). Returns the image; optionally also saves it to save_path.
Inputs: save_path.
sim_controlControl simulationB
Start/stop/reset the simulation, set the max timestep, or set the voltage of an external voltage source (an "Extern voltage" element, type ExtVoltageElm, addressed by its name). "reset" reloads the current circuit, zeroing time and all state.
Inputs: action, extVoltage, maxTimeStep.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clear, distinct role: loading/exporting circuits, reading state, controlling simulation, running transient probes, taking screenshots, generating links, and escaping to JS. circuit_state and run_transient are separated clearly as snapshot vs. time-series sampling.
Four tools use the circuit_ prefix, while sim_control, run_transient, screenshot, and eval_js follow different patterns. The names are still readable, but the convention is not uniformly applied across the server.
Eight tools is a well-scoped count for a circuit simulator server. Each tool maps to a meaningful user need without redundancy or bloat.
The set covers the full simulation workflow: load, export, inspect, control, run transient analysis, capture output, and share. eval_js provides an escape hatch for anything not explicitly exposed, leaving no obvious dead ends.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Create and manage Mermaid.js flowcharts and diagrams with AI agents via MCP.
EasyGerber brings AI printed circuit board (PCB) design, layout, and routing to MCP-compatible assistants. Describe a circuit or start from firmware pin assignments, search published electronic components, and build schematics using catalog parts with their footprints and available 3D models. Create and revise boards, generate layouts with automatic component placement and routing, inspect previews, and check saved layouts for blocking design issues. Export manufacturing ZIPs containing Gerber and drill files, a bill of materials, and component placement data, or download an editable EasyGerber (.egb) file. Start without signing up. Your agent uses one private board reference to create and continue a board, including catalog access, edits, layout, checks, previews, and exports, without a separate guest setup step or token to manage. To keep the board in your account or work with permitted saved personal or organization boards, complete EasyGerber sign-in and OAuth consent, then resume the same task. Account permissions, plan limits, and generation billing apply; support depends on your MCP client and installed integration.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGenerates, simulates, and inspects LTspice circuits via MCP tools and resources, providing structured JSON interfaces for AI agents.MIT
- FlicenseNot gradedqualityDmaintenanceProvides circuit simulation capabilities via MCP, enabling creation, simulation (DC, AC, transient), and analysis of electronic circuits using PySpice.1-
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to generate Qucs circuit schematics, run simulations, and parse results programmatically.2MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to automatically generate Multisim circuits, run simulations, extract experimental data, and export circuit diagrams, CSV, waveforms, and lab reports.44MIT