Are you the author? Sign in to claim
MCP server and live XML bridge for DipTrace
English | Русский
DipTrace MCP is a local Model Context Protocol server for reading, analyzing, reviewing, and safely editing DipTrace designs through the official XML formats. The repository contains two cooperating components:
diptrace-mcp, the MCP server used by Codex, Claude Desktop, and other MCP clients;diptrace_mcp_bridge.exe, the executable plug-in that connects the server to a design currently open in PCB Layout or Schematic Capture.The project is already usable as a human-in-the-loop engineering tool for PCB/schematic reading and review, guarded semantic edits, schematic authoring, schematic-to-PCB synchronization, bounded placement/routing, differential-pair analysis, and release-review workflows.
It is not yet a full replacement for DipTrace's interactive EDA engine. The main remaining gap is no longer MCP tool count; it is broad, automated, redistributable evidence that all important write paths survive real DipTrace 5.3 open/save/re-export cycles with the intended semantics.
Native Component/Pattern Library mutation and native manufacturing output generation are therefore intentionally not presented as completed capabilities.
See the roadmap for the current priority order and exit criteria. Runtime truth for a specific document always comes from get_capabilities.
get_capabilities, including precise unavailability reasons;create_schematic_document, create_pcb_document); these produce synthetic MCP-generated XML, not DipTrace-verified files;create_document_from_seed);ComponentStyle, pin/net connectivity, official Wire/Points wires, and net labels (add_sheet, place_part, connect_pins, disconnect_pins, add_wire, delete_wire, add_net_label);exact reconciliation modes;Panel, V-Scoring / Tab Routing) through set_panelization and clear_panelization;route_connections) and read-only priority evidence (analyze_routing_congestion);read_only, review, interactive_edit, automation, and manufacturing;get_capabilities is authoritative for a particular installation and document. A registered tool may still be unavailable when the active source type lacks required geometry, rules, stackup data, or an external adapter.
The repository CI separates platform responsibilities:
diptrace_mcp_bridge.exe artifact.The current main branch passes this matrix. Regression coverage includes the fail-closed trust authority boundary, required semantic-comparison categories for PCB/schematic, native Windows atomic-job behavior, and terminal cancellation semantics for Freerouting, ngspice, and openEMS jobs.
Synthetic 4.3 fixtures cover PCB, schematic, Component Library, Pattern Library, geometry, transactions, review, routing, DSN/SES, and server contracts. A separate live DipTrace 5.3.0.2 schematic acceptance test verified:
RefDesMarking edits on the Power sheet;This is strong evidence for the tested paths, not a claim of complete compatibility with every DipTrace version or XML object.
MCP client diptrace-mcp
(Codex/Claude) <--------> analysis and guarded XML edits
|
| shared state directory
v
DipTrace <--------> diptrace_mcp_bridge.exe
temporary plugin_exchange.xml
DipTrace starts the plug-in as a separate executable and passes a temporary XML path. The bridge stores a working copy under %LOCALAPPDATA%\DipTraceMCP, waits for an MCP apply or cancel request, verifies the expected SHA-256, and exits only after the session is finalized. DipTrace then imports the exchange XML on apply.
C:\Program Files\DipTrace or DipTrace5.Offline XML analysis also works on Linux, macOS, and WSL.
git clone https://github.com/fireostendere/mcp_diptrace.git
cd mcp_diptrace
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .
Install the optional GEOS geometry backend when exact polygon, ellipse, obround, swept-trace geometry, and the supported exact spatial-clearance paths are needed:
.\.venv\Scripts\python.exe -m pip install -e ".[geometry]"
Verify the entry point:
.\.venv\Scripts\diptrace-mcp.exe --help
Build the unsigned executable locally from this repository:
powershell -ExecutionPolicy Bypass -File .\plugin\build_bridge.ps1
Close all DipTrace modules, open PowerShell as Administrator, and install the bridge in PCB Layout, Schematic Capture, Component Editor, and Pattern Editor:
powershell -ExecutionPolicy Bypass -File .\plugin\install_plugin.ps1
The installer checks C:\Program Files\DipTrace5 first and then the legacy C:\Program Files\DipTrace directory. Override it when necessary:
.\plugin\install_plugin.ps1 -DipTraceDir "D:\Apps\DipTrace" -Mode All
-Mode Both installs only PCB/Schematic support. -Mode Libraries installs only Component/Pattern Editor bridges. Library sessions export the complete active library for inspection but use ImpMode=None; finish them with cancel because native library mutation remains evidence-gated.
codex mcp add diptrace `
--env "DIPTRACE_MCP_WORKSPACE=C:\Users\you\Documents\DipTrace" `
-- "C:\path\to\mcp_diptrace\.venv\Scripts\diptrace-mcp.exe"
codex mcp list
Alternatively, merge examples/codex-config.toml into ~/.codex/config.toml and replace the example paths.
Tools > Plugins > DipTrace MCP Bridge.finish_live_session(action="apply") or cancel the session.The bridge buttons provide the same explicit apply/cancel controls. Component and Pattern Editor bridge profiles are read-only and should be cancelled after inspection.
Pass a path inside DIPTRACE_MCP_WORKSPACE or DIPTRACE_MCP_ALLOWED_ROOTS:
Run
summarize_designforboards/controller.xml, then list the power nets.
Legacy binary .dip/.dch files must first be exported with File > Export > DipTrace XML. A native XML .dip/.dch can be read directly only when the file actually begins with an official DipTrace XML root.
High-level writes default to preview/dry-run behavior. A safe workflow is:
expected_sha256;apply_xml_edits remains an expert escape hatch. It requires exact match counts, preserves bytes outside targets, reparses the result, creates a backup before commit, and rejects SHA conflicts.
XML containing DOCTYPE or ENTITY is rejected. Caller-supplied design and source
paths are constrained to configured roots; server state and executable paths are
separate operator-owned settings. External processes are available only through typed
allowlisted adapters.
~ are not
expanded. Expansion is reserved for operator-owned server configuration;
caller-supplied design and source paths remain subject to allowed-root enforcement.NaN
and infinities. DSN output refuses quoted values requiring unverified escaping or
non-ASCII encoding, while SES input refuses backslash escapes and literal controls
in quoted tokens. The real DipTrace conventions remain open evidence questions.The server distinguishes provenance from authority. A client may submit evidence but cannot promote its own document to a high-trust validation level.
create_schematic_document or create_pcb_document is classified as synthetic_parser_only until stronger independently verified evidence exists.create_document_from_seed from a real DipTrace export preserves seed provenance but does not create round-trip authority.record_roundtrip_evidence method binds before/after files, exact paths, source type, SHA-256 values, and semantic comparison. It is not registered on the MCP surface yet; the Phase 7 evidence harness must make intake reachable before clients can rely on it. User-supplied evidence is not a trusted root.diptrace_roundtrip_verified or external_tool_roundtrip_verified is intentionally unavailable until the project has an authenticated server-owned registry, signature verifier, or committed allowlist.Trust invalidation is implemented for the main verified mutation paths, but the capability layer intentionally does not claim complete coverage for every write path yet. Current explicitly reported gaps are plan_apply, ses_import, schematic_to_pcb_sync, and live_session_apply. Closing these fail-closed trust paths is a near-term roadmap priority.
Evidence manifests are revalidated on use and rollback; path aliases, source-type mismatches, stale hashes, incomplete comparison categories, and semantic differences fail closed.
The current baseline can inspect and validate existing Pattern Libraries, compare pad mapping, and assign an existing pattern to a component when pad numbers match. Pattern Editor bridge sessions are deliberately read-only.
Persistent feedback/recommendation tools such as record_pattern_example, accept_pattern_suggestion, and reject_pattern_suggestion are not implemented yet. The revised roadmap prioritizes DipTrace 5.3 evidence closure, trust-path coverage, and mask/paste/courtyard verification before this recommendation layer.
After that baseline is stronger, the planned path is an append-only provenance-bound feedback dataset, deterministic retrieval of similar accepted examples, and measurable ranked existing-pattern suggestions. Fine-tuning is later optional work.
Native Pattern/Component Library creation or mutation remains blocked until controlled DipTrace 5.3 before/after and open/save/re-export fixtures prove writer semantics.
route_connections.Lay1/Lay2 span on multilayer boards.calculate_impedance remains a preliminary analytical estimate; field-solver results are available only through a configured run_openems_stripline_analysis backend.place_part references a library ComponentStyle by name; DipTrace resolves symbol graphics and pin mapping from its own libraries on import.Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows