KiCad MCP Server (IPC API)

KiCad MCP Server (IPC API)

Controls a running KiCad 9+ instance via the official IPC API, enabling board edits, queries, and exports without reload.

Category
访问服务器

README

KiCad MCP Server (IPC API)

MCP server that controls a running KiCad 9+ instance via the official IPC API and kicad-python (kipy).

Board edits appear immediately in the KiCad UI — no reload required. The server wraps the full Board + Project IPC surface available in kicad-python 0.7.1 (KiCad 10).

Prerequisites

  1. KiCad 9.0+ running with a PCB open
  2. IPC API enabled: Preferences → Plugins → Enable IPC API Server
  3. Python 3.10+

Install

cd kicad_mcp_server_ipc
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Run

kicad-mcp-ipc
# or
python -m kicad_mcp_ipc

Cursor / Grok MCP configuration

{
  "mcpServers": {
    "kicad-ipc": {
      "command": "/path/to/kicad_mcp_server_ipc/.venv/bin/kicad-mcp-ipc"
    }
  }
}

Optional environment variables:

Variable Description
KICAD_API_SOCKET Path to KiCad IPC socket (auto-detected if unset)
KICAD_API_TOKEN Auth token from KiCad when launched as plugin
KICAD_IPC_TIMEOUT_MS Request timeout in ms (default: 5000)

Architecture

server.py              → FastMCP entry point
services/api.py        → Unified KiCadAPI facade (board + project + session)
services/export.py     → Export jobs via IPC RunJob, kicad-cli fallback
tools/definitions.py   → Tool definitions mapped to API methods
tools/registry.py      → Categories, search, JSON schemas
tools/register.py      → Dynamic MCP tool registration
layers.py / serialize.py → Layer aliases and JSON serialization

Design principles:

  • Service layer — MCP tools call KiCadAPI, not kipy directly
  • Registry — tool metadata (category, parameters, schema) is separate from handlers
  • Transactions — edits use begin_commit / push_commit for undo support
  • Meta tools — discover and invoke tools without loading all schemas upfront

Tools (77 total)

Use list_tool_categories, search_tools, or get_tool_schema to explore the full set at runtime.

Meta / discovery

Tool Description
list_tool_categories Browse all categories and tool names
search_tools Search by name, description, or category
get_tool_schema Get parameter schema for a specific tool
execute_kicad_tool Run any tool by name with a JSON arguments object

Session (5)

ping_kicad, get_kicad_status, list_open_documents, get_kicad_version, run_kicad_action

Board query (21)

Read-only inspection: get_board_info, get_board_size, get_board_as_string, get_selection_as_string, list_components, get_component, list_tracks, list_vias, list_pads, list_nets, list_zones, list_groups, list_dimensions, list_board_text, list_board_shapes, list_barcodes, get_items_by_id, get_items_by_net, get_connected_items, get_stackup, get_title_block

Board edit (16)

save_board, revert_board, place_component, move_component, rotate_component, delete_component, route_trace, add_via, add_copper_pour, refill_zones, add_board_text, add_board_outline, add_mounting_hole, set_board_size, delete_items_by_id, set_title_block

Layers (8)

get_layer_list, get_visible_layers, get_active_layer, set_active_layer, set_visible_layers, get_copper_layer_count, set_enabled_layers, get_layer_name

Selection (4)

get_selection, add_to_selection, remove_from_selection, clear_selection

Geometry (2)

get_item_bounding_box, hit_test

Origins (2)

get_board_origin, set_board_origin

Appearance (1)

get_editor_appearance

Project (4)

get_net_classes, get_text_variables, set_text_variables, expand_text_variables

Export (10)

Manufacturing and documentation output. Each export tries the IPC RunJob API first, then falls back to kicad-cli if needed.

Tool Output
export_gerbers Gerber copper/silk/mask layers
export_drill Excellon drill files
export_pdf PDF plot
export_svg SVG plot
export_dxf DXF
export_3d STEP, GLB, STL, VRML, etc.
export_position Pick-and-place centroid files
export_ipc2581 IPC-2581 package
export_odb ODB++ package
export_stats Board statistics report

Response format

All tools return JSON strings:

{
  "success": true,
  "components": [...],
  "count": 42
}

On failure:

{
  "success": false,
  "message": "No PCB board is open in KiCad. Open a .kicad_pcb file first.",
  "operation": "get_board_info"
}

Limitations (kicad-python 0.7.1)

The following are not exposed because they are unavailable or unstable in the installed IPC bindings:

  • Schematic editing (Schematic class exists; IPC commands not wired in 0.7.1)
  • get_design_rules / import_netlist (KiCad 11+)
  • set_editor_appearance_settings (read-only for safety)
  • run_kicad_action (unstable KiCad internal API)

Project layout

src/kicad_mcp_ipc/
├── server.py           # MCP entry point
├── connection.py       # KiCad IPC connection singleton
├── services/
│   ├── api.py          # KiCadAPI facade
│   └── export.py       # Export via IPC jobs + kicad-cli
├── tools/
│   ├── definitions.py  # All tool definitions
│   ├── registry.py     # Category/search/schema registry
│   └── register.py     # Dynamic FastMCP registration
├── layers.py           # Layer name ↔ enum helpers
├── serialize.py        # kipy object → JSON helpers
├── board.py            # Backward-compat alias for KiCadAPI
├── errors.py
└── utils.py

License

Uses KiCad IPC via kicad-python, which is licensed under the GPL. This MCP server is a separate client application that communicates with KiCad over IPC.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选