EasyEDA MCP
MCP Server for EasyEDA PCB designer software
Ask AI about EasyEDA MCP
Powered by Claude · Grounded in docs
I know everything about EasyEDA MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
EasyEDA MCP Scaffold
Quick Start
This document describes the MCP server and EasyEDA bridge in detail. If you want to set it up and use it quickly, start here.
What You Need
- Node.js
>= 20.17.0 npm- EasyEDA Pro / JLCEDA Pro
- This repository cloned locally
1. Install Dependencies
From the repository root:
npm install
2. Build the EasyEDA Bridge Extension
npm run build
This creates the installable EasyEDA extension package under ./build/dist/.
3. Install the Extension in EasyEDA Pro
Install the generated package from ./build/dist/ into EasyEDA Pro.
After installation, the EasyEDA top menu exposes EasyEDA MCP Bridge with:
ReconnectStatus
If EasyEDA prompts for external interaction permission, allow it so the bridge can connect back to the local MCP server.
4. Start the Local MCP Server
Run this from the repository root:
npm run mcp:server
By default this starts:
- the MCP stdio server for your AI client
- the EasyEDA bridge WebSocket at
ws://127.0.0.1:19732/easyeda-mcp - the local HTTP attach endpoint at
http://127.0.0.1:19733/mcp
npm run mcp:server already exposes the HTTP attach endpoint above. If you want to run the bridge services without the stdio transport, use:
npm run mcp:server:daemon
5. Configure Your MCP Client
VS Code or another stdio-based MCP client:
{
"servers": {
"easyeda-mcp": {
"type": "stdio",
"command": "npm",
"args": ["run", "mcp:server"],
"cwd": "/path/to/EasyEDA-MCP"
}
}
}
Claude Desktop example:
{
"mcpServers": {
"easyeda-mcp": {
"command": "npm",
"args": ["run", "mcp:server"],
"cwd": "/path/to/EasyEDA-MCP"
}
}
}
Ready-to-copy examples are already included in this repo:
examples/mcp/vscode.mcp.jsonexamples/mcp/claude_desktop_config.json
6. First Connection
- Open EasyEDA Pro.
- Make sure the EasyEDA MCP Bridge extension is installed.
- Start the local MCP server.
- Connect your MCP client to
easyeda-mcp. - In EasyEDA, click
EasyEDA MCP Bridge -> Reconnect. - Call
bridge_statusfrom your MCP client.
If the bridge is healthy, continue with get_current_context to see whether EasyEDA is currently exposing a project, schematic, or PCB document.
7. Smallest Useful Smoke Test
Use this tool order to verify the full chain end to end:
bridge_statusping_bridgeget_current_contextlist_project_objects
If bridge_status reports that the bridge is disconnected, the usual fix is to go back to EasyEDA and click Reconnect once.
8. Typical First Workflow
Once the bridge is connected, a practical first workflow is:
list_project_objectsto inspect boards, schematics, PCBs, and panelsopen_documentto switch to the document you want to editsearch_library_devicesto find components by keyword or LCSC part numberadd_schematic_componentoradd_pcb_componentto place componentsget_capabilitiesorget_usage_guideif you need to adapt to host/runtime limitations
9. Troubleshooting
- Bridge not connected: In EasyEDA, use
EasyEDA MCP Bridge -> Reconnect, confirm external interaction permission is enabled, then callbridge_statusagain. - MCP client cannot start the server: confirm
npm installhas been run and use Node.js>= 20.17.0. - Extension menu missing in EasyEDA: rebuild with
npm run buildand reinstall the package from./build/dist/. - You need attach-style testing instead of stdio: use the local endpoint at
http://127.0.0.1:19733/mcp.
This repository now includes a local MCP server scaffold and a matching EasyEDA extension bridge.
The scaffold now includes three additional pieces beyond the original bridge:
- optimistic revision checks for document-source overwrite
- ready-to-copy client configuration examples
- first-pass higher-level edit tools that do not require replacing the entire document source
It now also includes:
- bridge self-test tools for round-trip health checks
- library device search for component placement flows
- component placement and editing on schematic and PCB documents
- primitive ID and bounding-box query tools for supported primitive families
- PCB net inspection and display-color editing tools
- schematic pin and PCB pad inspection plus intent-level connection helpers
- bulk schematic pin-to-net workflows and waypoint-based PCB routing
- an opt-in live MCP integration test harness for real EasyEDA bridge sessions
Components
-
src/mcp-server.tsRuns a local MCP server over stdio and exposes the EasyEDA MCP tool surface documented here.
-
src/easyeda-mcp-bridge.tsRuns inside the EasyEDA Pro extension runtime and connects back to the MCP server over WebSocket.
-
src/mcp-bridge-protocol.tsShared protocol definitions for the localhost bridge.
The MCP server also exposes a local Streamable HTTP endpoint for attach-style testing at http://127.0.0.1:19733/mcp by default.
Included MCP Tools
bridge_statusget_usage_guideping_bridgeecho_bridgesearch_library_devicesget_capabilitiesget_current_contextlist_project_objectsopen_documentsave_active_documentcreate_boardcreate_pcbimport_schematic_to_pcbcreate_panelcreate_schematiccreate_schematic_pagecopy_boardcopy_pcbcopy_panelcopy_schematiccopy_schematic_pageadd_schematic_componentmodify_schematic_componentdelete_schematic_componentadd_schematic_net_flagadd_schematic_net_portadd_schematic_short_circuit_flaglist_schematic_component_pinsset_schematic_pin_no_connectconnect_schematic_pin_to_netconnect_schematic_pins_to_netsconnect_schematic_pins_with_prefixadd_schematic_textadd_schematic_net_labeladd_schematic_wirelist_schematic_primitive_idsget_schematic_primitiveget_schematic_primitives_bboxadd_pcb_componentmodify_pcb_componentdelete_pcb_componentlist_pcb_component_padsroute_pcb_line_between_component_padsroute_pcb_lines_between_component_padsadd_pcb_lineadd_pcb_textlist_pcb_primitive_idsget_pcb_primitiveget_pcb_primitives_bboxlist_pcb_netsget_pcb_netset_pcb_net_colorget_pcb_net_primitivesmodify_schematic_textdelete_schematic_textmodify_schematic_net_labelmodify_schematic_wiredelete_schematic_wiremodify_pcb_linedelete_pcb_linemodify_pcb_textdelete_pcb_textrename_boardrename_pcbrename_schematicrename_schematic_pagerename_paneldelete_boarddelete_pcbdelete_schematicdelete_schematic_pagedelete_panelget_document_sourceset_document_sourcecompute_source_revision
Source Revisions
get_document_source now returns:
sourcesourceHashcharacters
set_document_source now expects either:
expectedSourceHash- or
force: true
It also accepts:
skipConfirmation: trueto suppress the bridge-side overwrite confirmation dialog
Recommended flow:
- Call
get_document_source. - Produce your edited source.
- Call
set_document_sourcewith the returnedsourceHashasexpectedSourceHash. - If the hash mismatches, re-read the document before retrying.
The MCP tool layer now verifies set_document_source by rereading the active document after both normal responses and timeout-recovery paths. If EasyEDA reports success but the reread source hash does not match the requested source, the tool returns an error instead of a false success.
Example request payload:
{
"source": "...updated source...",
"expectedSourceHash": "1234:deadbeef",
"skipConfirmation": true
}
If you need to bypass the optimistic check:
{
"source": "...updated source...",
"force": true,
"skipConfirmation": true
}
Bridge Self-Test Tools
These tools are intended for bridge verification rather than CAD editing:
bridge_status: inspect current bridge connection state from the MCP server sideget_usage_guide: return a compact operational guide describing recommended tool order, common identifiers, and workflow sequencingping_bridge: verify MCP server -> websocket bridge -> EasyEDA extension -> websocket bridge -> MCP server round-trip healthecho_bridge: send a message through the same path and verify the returned payload
get_capabilities returns both the full bridge surface and the subset currently supported by the live EasyEDA host runtime. On host builds missing schematic net-label APIs, supportedMethods excludes the affected net-label methods and hostRuntimeUnsupportedMethods plus hostRuntimeCapabilities describe the limitation and suggested fallbacks.
bridge_status and get_current_context also include recommendedNextSteps in their structured responses so MCP clients can choose the next tool with less guesswork.
Higher-Level Edit Tools
These tools avoid whole-document source replacement for common edit cases:
add_schematic_text: add a text primitive to the active schematic pageadd_schematic_net_label: add a net label to the active schematic pageadd_schematic_wire: add a wire primitive to the active schematic pageadd_pcb_line: add a line primitive to the active PCB document. Signal lines require a non-emptynet; board outline lines onBoardOutLinemay omitnetor use an empty string.add_pcb_text: add a text primitive to the active PCB documentsave_active_document: save the active schematic page, PCB, or panel
Each edit tool accepts saveAfter: true if you want the document saved immediately after the primitive is created.
add_pcb_text requires a fontFamily that already exists in the EasyEDA Pro environment.
The same primitive families now also support targeted modification and, where the host SDK allows it, deletion.
Delete tools also accept skipConfirmation: true to suppress the bridge-side confirmation prompt before the delete request is sent to EasyEDA.
Document Lifecycle Tools
The bridge now covers the main project object lifecycle:
create_board: create a board, optionally linking an existing schematic UUID and PCB UUID; fail if readback shows the linked schematic still advertises a different board name in its title blockcreate_pcb: create a PCB, optionally under a named boardimport_schematic_to_pcb: import linked schematic changes into a PCB; fail fast when the target PCB is not coherently linked to a board-backed schematic, fall back to linked schematic page source when project inventory has a stale title block, and on hosts wherepcb_Document.importChanges(...)falsely succeeds against an unchanged empty PCB, retry through the same host UI diff/apply flow that EasyEDA uses forDesign -> Import Changes from Schematicbefore failingcreate_panel: create a panel documentcreate_schematic: create a schematic, optionally under a named boardcreate_schematic_page: add a new page to an existing schematiccopy_board: duplicate a board by board namecopy_pcb: duplicate a PCB, optionally placing the copy under a named boardcopy_panel: duplicate a panel by UUIDcopy_schematic: duplicate a schematic, optionally placing the copy under a named boardcopy_schematic_page: duplicate a schematic page, optionally into another schematic
Recommended duplication flow:
- Call
list_project_objectsto find the source board, PCB, schematic, page, or panel. - Call the matching
copy_*tool with the source identifier. - If needed, follow with the existing rename tools to assign final names.
Component Placement And Query Tools
The bridge now supports a fuller component and inspection workflow:
search_library_devices: search the EasyEDA library by keyword or LCSC part number(s)add_schematic_component: place a searched library device onto the active schematic pageadd_pcb_component: place a searched library device onto the active PCB document, recovering the created primitive from live PCB state when some host builds throw after creationmodify_schematic_componentandmodify_pcb_component: adjust placed component properties such as coordinates, rotation, designator, and metadatadelete_schematic_componentanddelete_pcb_component: remove placed components with native EasyEDA confirmation dialogs; the MCP tool layer rereads PCB component inventory after delete and treats host-side no-op acknowledgements as failures instead of reporting false successdelete_*tools: acceptskipConfirmation: trueto suppress the bridge-side delete promptadd_schematic_net_flagandadd_schematic_net_port: place common net-aware schematic marker components without editing whole source textadd_schematic_short_circuit_flag: place the EasyEDA short-circuit marker component without editing whole source textlist_schematic_component_pins: inspect resolved symbol pins, including coordinates and pin numbersset_schematic_pin_no_connect: toggle a pin's explicit no-connect markerconnect_schematic_pin_to_net: attach a named net at a chosen component pin location, preferring a net label and falling back to a short wire stub when neededconnect_schematic_pins_to_nets: attach multiple explicit pin-to-net mappings in one request, preferring net labels and falling back to short wire stubs when neededconnect_schematic_pins_with_prefix: derive net names likeBUS_1,BUS_2, and so on from a prefix and pin numbers, preferring net labels and falling back to short wire stubs when neededlist_schematic_primitive_idsandlist_pcb_primitive_ids: enumerate supported primitive IDs by familyget_schematic_primitiveandget_pcb_primitive: read the full primitive payload for a specific IDget_schematic_primitives_bboxandget_pcb_primitives_bbox: compute combined BBoxes for selected primitive IDslist_pcb_component_pads: inspect resolved footprint pads, including coordinates, pad numbers, and current netsroute_pcb_line_between_component_pads: create a direct PCB line segment between two component pads while deriving the net when possibleroute_pcb_lines_between_component_pads: create multiple PCB line segments between two component pads using caller-supplied waypoints
Recommended component-placement flow:
- Call
search_library_deviceswithqueryorlcscIds. - Take a returned
libraryUuidanduuid. - Call
add_schematic_componentoradd_pcb_componentwith those identifiers and target coordinates.
Recommended pin-to-net flow:
- Call
list_schematic_component_pinsfor a placed component. - Select the desired
pinNumber. - Call
connect_schematic_pin_to_netwith the component primitive ID, pin number, and target net name.
Recommended bus or grouped-net flow:
- Call
list_schematic_component_pinsfor a placed component. - Choose the pins that should be attached to a shared prefix-based naming scheme.
- Call
connect_schematic_pins_with_prefixwithnetPrefixand optionalseparatororpinOffset.
Recommended explicit bulk-net flow:
- Call
list_schematic_component_pinsfor a placed component. - Build a
connectionsarray of{ "pinNumber": ..., "net": ... }objects. - Call
connect_schematic_pins_to_netsto attach all requested named nets in one request.
Recommended pad-to-pad route flow:
- Call
list_pcb_component_padsfor each placed PCB component. - Choose the source and destination
padNumbervalues. - Call
route_pcb_line_between_component_padswith both component primitive IDs, pad numbers, and a PCB line layer.
Recommended waypoint route flow:
- Call
list_pcb_component_padsfor each placed PCB component. - Choose one or more intermediate
{ "x": ..., "y": ... }waypoints. - Call
route_pcb_lines_between_component_padsto emit a multi-segment line path between the resolved pad centers.
PCB Net Tools
The PCB tool surface now includes:
list_pcb_nets: full net inventory for the active PCBget_pcb_net: detail, routed length, and current display color for a netset_pcb_net_color: update a net's display color using{ "r": ..., "g": ..., "b": ..., "alpha": ... }ornullget_pcb_net_primitives: fetch primitives associated with a net, optionally filtered by numeric PCB primitive type IDs
SDK limitation: schematic net labels are implemented as attribute primitives, and the EasyEDA Pro API does not expose attribute deletion. The bridge therefore supports modify_schematic_net_label but not delete for that primitive type.
Host compatibility limitation: some EasyEDA builds do not expose the sch_PrimitiveAttribute runtime API even though it exists in the published type definitions. On those builds, add_schematic_net_label and modify_schematic_net_label are reported as runtime-unsupported in get_capabilities, and direct calls return a compatibility error that points back to the live capability report. connect_schematic_pin_to_net, connect_schematic_pins_to_nets, and connect_schematic_pins_with_prefix still fall back to short net-assigned wire stubs so pin-level net attachment can succeed.
Host placement limitation: some EasyEDA builds can throw Cannot convert undefined or null to object from add_pcb_component even after successfully creating the component. The bridge now snapshots component primitive IDs before placement and recovers the newly created primitive from live PCB state when that false-negative pattern occurs.
Host PCB text limitation: some EasyEDA builds can leave pcb_PrimitiveString calls hanging instead of resolving or rejecting. add_pcb_text, modify_pcb_text, delete_pcb_text, and list_pcb_primitive_ids with family="text" now fail fast with a compatibility error when the host text API stops responding, instead of waiting for the full MCP bridge timeout.
Routing limitation: the current SDK surface exposed here supports creating PCB line segments and inspecting connected pads, but it does not expose a true interactive autorouter API for arbitrary multi-segment pathfinding from the extension bridge. route_pcb_line_between_component_pads therefore creates a direct segment between the resolved pad centers, while route_pcb_lines_between_component_pads follows caller-supplied waypoints rather than performing automatic obstacle-aware routing.
Usage
-
Build and install the EasyEDA extension package.
npm run build -
Start the MCP server locally.
npm run mcp:serverIf the local MCP server is already running, starting it again will stop the older instance and replace it with the new one.
This starts both:
- the stdio MCP transport used by normal MCP hosts
- a local Streamable HTTP MCP endpoint at
http://127.0.0.1:19733/mcpfor attach-style testing
For local regression coverage while developing the bridge:
npm testFor an opt-in live MCP smoke test against a real EasyEDA bridge session:
EASYEDA_MCP_LIVE_TEST=1 npm run test:liveTo fail if EasyEDA is not actually connected to the bridge:
EASYEDA_MCP_LIVE_TEST=1 EASYEDA_MCP_LIVE_REQUIRE_CONNECTED=1 npm run test:liveTo attach the live test to an already-running MCP server instead of spawning a second server:
EASYEDA_MCP_LIVE_TEST=1 EASYEDA_MCP_LIVE_ATTACH_EXISTING=1 EASYEDA_MCP_LIVE_REQUIRE_CONNECTED=1 npm run test:liveTo override the attach URL for that mode:
EASYEDA_MCP_LIVE_TEST=1 EASYEDA_MCP_LIVE_ATTACH_EXISTING=1 EASYEDA_MCP_LIVE_SERVER_URL=http://127.0.0.1:19733/mcp npm run test:live -
In EasyEDA Pro, ensure the extension is installed and has permission for external interaction.
-
Open the extension menu and use
Reconnectif EasyEDA needs to reattach to the local bridge. -
Inspect
Statusto confirm that the bridge is connected.
Client Config Examples
Ready-to-adapt example files are included in examples/mcp/claude_desktop_config.json and examples/mcp/vscode.mcp.json.
Data structure notes:
easyeda-mcpis just the server name key. You can rename it, but the same name should be used consistently within that config object.- Claude Desktop expects a top-level
mcpServersobject. - VS Code expects a top-level
serversobject. - The value under
easyeda-mcpis the actual server definition. commandis the executable to run.argsis the argument array passed to that executable.cwdis the working directory where the command should run.- VS Code also requires
"type": "stdio"for this server.
Claude Desktop
Structure:
{
"mcpServers": {
"<server-name>": {
"command": "<executable>",
"args": ["<arg1>", "<arg2>"],
"cwd": "/absolute/path/to/project"
}
}
}
Example structure:
{
"mcpServers": {
"easyeda-mcp": {
"command": "npm",
"args": ["run", "mcp:server"],
"cwd": "/home/i/repos/EasyEDA-MCP"
}
}
}
VS Code
Structure:
{
"servers": {
"<server-name>": {
"type": "stdio",
"command": "<executable>",
"args": ["<arg1>", "<arg2>"],
"cwd": "/absolute/path/to/project"
}
}
}
Workspace or user mcp.json example:
{
"servers": {
"easyeda-mcp": {
"type": "stdio",
"command": "npm",
"args": ["run", "mcp:server"],
"cwd": "/home/i/repos/EasyEDA-MCP"
}
}
}
Default Bridge Endpoint
ws://127.0.0.1:19732/easyeda-mcp
Environment Variables
EASYEDA_MCP_BRIDGE_HOSTEASYEDA_MCP_BRIDGE_PORTEASYEDA_MCP_BRIDGE_PATHEASYEDA_MCP_BRIDGE_TIMEOUT_MSbase bridge timeout in milliseconds, default30000EASYEDA_MCP_GET_DOCUMENT_SOURCE_TIMEOUT_MSoptional per-method override forget_document_sourceEASYEDA_MCP_SET_DOCUMENT_SOURCE_TIMEOUT_MSoptional per-method override forset_document_sourceEASYEDA_MCP_HTTP_ENABLEDEASYEDA_MCP_HTTP_HOSTEASYEDA_MCP_HTTP_PORTEASYEDA_MCP_HTTP_PATHEASYEDA_MCP_LIVE_ATTACH_EXISTINGEASYEDA_MCP_LIVE_SERVER_URL
Slow bridge operations such as get_document_source, set_document_source, and primitive BBox queries use higher internal per-method timeout floors so large EasyEDA documents are less likely to fail spuriously. The current server defaults are 60000 for get_document_source and 120000 for set_document_source.
If your EasyEDA build is still slow on large source writes, set EASYEDA_MCP_SET_DOCUMENT_SOURCE_TIMEOUT_MS explicitly when starting the server.
Bridge requests are also serialized server-side so the EasyEDA runtime only handles one in-flight MCP operation at a time. This reduces instability from overlapping long-running bridge calls.
Notes
- The extension side depends on EasyEDA Pro's external interaction permission for WebSocket access.
- This scaffold intentionally starts with a small, explicit tool set rather than exposing arbitrary
eda.*execution. ping_bridgeandecho_bridgeare minimal round-trip bridge diagnostics and are useful for proving the MCP call path independently of document edits.- Destructive tools are explicit MCP calls, and the EasyEDA extension shows a bridge-side confirmation dialog before delete or overwrite operations unless
skipConfirmation: trueis provided on the supported delete and source-overwrite tools. - The VS Code client configuration format follows the documented
mcp.jsonserversstructure for local stdio servers, and the Claude example follows the documentedclaude_desktop_config.jsonmcpServersstructure. - The included tests cover tool registration, local schema validation for optimistic source writes, and revision-hash stability without requiring a live EasyEDA instance.
- The included tests also cover bridge-session timeout handling, disconnect rejection, and out-of-order response correlation without requiring a live EasyEDA instance.
- The live integration test is intentionally opt-in so normal local development and CI do not depend on an interactive EasyEDA Pro session being open and bridge-connected.
