← MCP server and skill grades

KiCAD-MCP-Server

mixelpixx/KiCAD-MCP-Server

D
Type
MCP server
Scanned
Nov 13, 2026
Version
9dd467c2ba8d
Files read
478

KiCAD-MCP-Server lets AI assistants create, edit, route, and export circuit schematics and PCB designs in KiCad. Its biggest risk is that a tricked AI assistant could run any Java program on your computer through the routing tool, or on Linux, read and click inside any open desktop app.

What it can reach

Files
Reads, creates, and modifies KiCad projects, schematics, PCB layouts, and libraries, writes exports and screenshots to chosen file paths, installs a KiCad helper plugin, and accesses local caches and Claude MCP logs.
Shell commands
Runs local programs including a background Python worker, KiCad and kicad-cli, Java, Docker or Podman, git, curl, 7-Zip, and Inkscape or ImageMagick.
Network
Connects over the internet to JLCPCB, LCSC, Digi-Key, PartReel, and community mirrors to search catalogs and download parts, and uses a local network port when the optional KiCad GUI plugin is enabled.
Secrets
Reads optional JLCPCB and Digi-Key API keys from environment variables or a local .env file, plus a session token from your KiCad settings folder for the GUI plugin.
System
Checks for and launches KiCad, takes window or desktop screenshots, and can read windows and click menus or buttons through Linux desktop accessibility tools or opt-in KiCad GUI controls.

Findings

3 high2 medium5 low
  1. HighArbitrary Java code execution via freeroutingJar parameter in autoroute

    python/commands/freerouting.py:1073

    The autoroute tool accepts a caller-supplied freeroutingJar path and passes it directly to java -jar (or mounts and runs it inside Docker if local Java is absent). If an AI agent is tricked by prompt injection while reviewing an untrusted KiCad repository, it can point freeroutingJar at a malicious JAR file inside that repository, or at a remote UNC/WebDAV share on Windows, executing arbitrary code on the user's machine.

    Fix: Remove freeroutingJar from tool parameters and resolve the JAR path exclusively from the trusted FREEROUTING_JAR environment variable or default user directory, matching how KICAD_CLI and SEVEN_ZIP are handled.

  2. HighArbitrary Java code execution via agent-controlled freeroutingJar path in autoroute

    src/tools/freerouting.ts:25

    The autoroute tool accepts freeroutingJar as a tool argument from the AI agent and passes it to the Python backend, which executes it with java -jar (and Java runs any ZIP/JAR archive regardless of file extension, such as a file disguised as a .step model inside a cloned project or downloaded via download_registry_part). If untrusted text in a schematic, datasheet, or issue tricks the agent into calling autoroute with a malicious archive path, arbitrary code runs on the user's machine.

    Fix: Remove freeroutingJar from the autoroute tool schema and resolve the Freerouting JAR path exclusively from ~/.kicad-mcp/freerouting.jar or the trusted FREEROUTING_JAR environment variable.

  3. HighLinux AT-SPI GUI tools are enabled without opt-in and can read and click non-KiCad desktop apps

    src/tools/gui-driver.ts:23

    Although the README states that the GUI driver is opt-in behind install_gui_driver and KICAD_GUI_DRIVER_ENABLE=1 and only drives KiCad, kicad_gui_tree_atspi and kicad_gui_click_atspi are enabled by default in normal write mode, do not use the token-gated KiCad helper, and accept an arbitrary app filter. On a Linux desktop with AT-SPI accessibility enabled, a prompt-injected agent can set app to any running desktop program (such as a browser, password manager, or the IDE/MCP client itself) to read widget labels and trigger button or menu clicks, including approval prompts.

    Fix: Require KICAD_GUI_DRIVER_ENABLE=1 before allowing kicad_gui_tree_atspi or kicad_gui_click_atspi to run, and remove the app parameter so AT-SPI operations are restricted strictly to KiCad windows.

  4. MediumLinux AT-SPI GUI tools are ungated and can read or click any desktop application

    python/commands/gui_driver.py:664

    Unlike the wx GUI helper plugin, kicad_gui_tree_atspi and kicad_gui_click_atspi do not check KICAD_GUI_DRIVER_ENABLE and are active by default in normal write mode. Both accept an arbitrary app substring parameter (where an empty string matches every accessible application on the Linux desktop), allowing a prompt-injected agent on a Linux system with AT-SPI enabled to read widget trees and click buttons or menus in browsers, terminals, or IDE approval dialogs.

    Fix: Require KICAD_GUI_DRIVER_ENABLE=1 before running AT-SPI commands, remove the caller-supplied app filter, and restrict matching strictly to KiCad application names.

  5. Mediumsnapshot_project copies Claude MCP session logs without KICAD_MCP_DEV and allows path traversal

    python/kicad_interface.py:5190

    Although the README states that session logs are only copied into a project's logs folder when KICAD_MCP_DEV=1 is set, _handle_snapshot_project omits the KICAD_MCP_DEV check and unconditionally copies Claude Desktop's mcp-server-kicad.log into the project and snapshot directories, risking accidental disclosure when projects are shared. In addition, the step and label parameters are concatenated into file and snapshot directory names without sanitizing path separators or '..' segments, allowing shutil.copytree to write outside the snapshots folder.

    Fix: Gate session log copying in _handle_snapshot_project behind os.environ.get('KICAD_MCP_DEV') == '1' and reject path separators and '..' sequences in step and label.

  6. Lowkicad_gui_screenshot captures the entire desktop when frame does not match

    gui_driver_plugin/plugins/driver.py:395

    When the opt-in GUI driver is enabled and a caller passes a frame filter that matches no KiCad window, screenshot() does not raise an error like full_tree() and click() do; instead it falls back to capturing the entire screen across all visible applications into a PNG file.

    Fix: Raise a RuntimeError when find_frame(frame_match) returns None instead of falling back to a full-screen capture.

  7. LowSO_REUSEADDR on Windows GUI driver listener allows local port and token hijacking

    gui_driver_plugin/plugins/listener.py:323

    The GUI driver TCP server sets allow_reuse_address = True, which enables SO_REUSEADDR on Windows. Unlike POSIX, SO_REUSEADDR on Windows allows another local user's process on a shared machine to bind the same 127.0.0.1:8770 port and intercept connections from the MCP client, capturing the session token that %APPDATA% file permissions were meant to protect.

    Fix: Set allow_reuse_address = False on Windows and enable socket.SO_EXCLUSIVEADDRUSE before binding the listener socket.

  8. LowLinux install helper pipes unpinned remote script into sudo bash

    scripts/install-linux.sh:88

    The optional Linux installation script downloads https://deb.nodesource.com/setup_20.x with curl and pipes it directly into sudo -E bash - without verifying a pinned hash. This script is not run by the MCP server at runtime, only if invoked manually during setup.

    Fix: Configure the NodeSource APT repository using a pinned GPG keyring rather than piping a remote shell script into sudo bash.

  9. LowExport tools in manufacturing mode can overwrite design, configuration, and arbitrary files

    src/tools/operating-mode.ts:191

    Setting KICAD_MCP_OPERATING_MODE=manufacturing is documented to prevent an agent from changing the design, project, libraries, or KiCad settings while allowing fabrication exports. However, EXPORT_TOOLS permits 29 export tools (including export_sch_bom, export_netlist, export_vrml, and export_3d_cli with force=true) that write to any caller-supplied outputPath without checking file extensions or target directories, and export_sch_bom even lets the caller supply custom header text via labels. A prompt-injected agent in manufacturing mode can point outputPath at .kicad_pcb, .kicad_sch, .kicad_dru, sym-lib-table, or user files outside the project and overwrite them.

    Fix: In manufacturing mode, reject outputPath and outputDir values that target KiCad design, rule, or library-table filenames, refuse overwriting existing non-export files, or confine exports to a dedicated output subdirectory.

  10. LowHTTP redirects bypass the asset host allowlist in download_registry_part

    src/tools/parts-registry.ts:445

    download_registry_part checks assetUrlAllowed(url) before fetching a part file so a malicious or compromised registry index cannot redirect downloads to arbitrary hosts, local services, or plaintext HTTP. However, fetch(url) runs with Node's default redirect: 'follow' setting and never checks redirect target URLs, so an HTTP 301/302/307/308 response from an allowed host will still follow redirects to internal addresses (such as 127.0.0.1 or cloud metadata endpoints) or unapproved hosts and save the response to dest_dir.

    Fix: Use redirect: 'manual' in fetch and validate each redirect Location URL with assetUrlAllowed() before following it, or set redirect: 'error'.