The library is a zero-dependency MCP server. Point any MCP-capable client at it and it can semantically find a whole board, then pull the board's files (tscircuit .tsx + spice tests), BOM, specs, prompt, and the curated parts it uses — a head start on repeats.
{
"mcpServers": {
"circuit-library": {
"command": "node",
"args": ["/path/to/promptpcb/circuit_library/mcp.js"]
}
}
}
search_circuits(query) — semantic lookup by what you want to build ("drive a brushed dc motor").
get_circuit(id) — full record + the actual file contents (tsx + spice tests) + BOM + specs + prompt.
list_circuits() — everything in the library.
save_circuit(...) — add a reusable board/module or append a version, then regenerate layout, schematic, and studio-PBR 3D views.
test_circuit({id}) — discover the circuit's versioned .spice.json requirements, compile native tscircuit sources/probes with curated SPICE models, run SpiceLab/ngspice, and return real pass/fail results plus plots.
search_circuits("...") -> get_circuit(id) -> regenerate its curated_parts
via the parts get_part into ./parts/ -> build/adapt. A working, curated-
grounded board in seconds instead of from a blank file. After adapting it,
save_circuit(..., tests:{version:1,tests:[...]}) stores the functional requirements
beside the TSX. test_circuit({id}) then runs them through SpiceLab without making
the agent repeat assertions on every call.