Borrowing it
Nothing to install: this file belongs to antonmadto/kicad-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/antonmadto/kicad-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/antonmadto/kicad-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/antonmadto/kicad-mcp/claude-md)<a href="https://agentmods.dev/instructions/antonmadto/kicad-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/antonmadto/kicad-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/antonmadto/kicad-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/antonmadto/kicad-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04197 | $0.04197 |
| Opus 5 | $0.02099 | $0.02099 |
| Sonnet 5 | $0.00839 | $0.00839 |
| Haiku 4.5 | $0.00420 | $0.00420 |
Grade A, and why
kicad-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — kicad-mcp project constitution
This file is the durable operating agreement for building kicad-mcp. Read it every session. It is a distilled rulebook; the full spec is in PLAN.md. When the two conflict, PLAN.md wins and you should flag the conflict.
Read first, every session
HANDOFF.md— START HERE. The current goal, what's done, and what to do next (making the MCP genuinely usable on real boards). Session-to-session baton.PLAN.md— master execution plan (architecture, pinned stack, repo layout §4, phases §8).docs/rules/hartley-rules.md,docs/rules/philslab-rules.md— the rule catalogs the review engine encodes.docs/rules/CHANGES.md— corrections verified against the source videos; severity and sourcing fixes you MUST honor.
Current status
- Phase: ALL PHASES 0–6 complete and green (2026-07-04). Lint (ruff) + 179 pytest pass (2 GUI tests auto-skip without a GUI; they PASSED against live KiCad 9.0.8). 45 tools + 4 router tools, 4 prompts, 23 review rules across 10 families. Three adversarial multi-agent reviews run (Phase 0/1, Phase 2, Phase 4–6): 6 + 12 + 20 = 38 confirmed findings, ALL fixed. Highlights fixed: path-traversal guard, UTF-8 encoding, span-based plane detection (L-shaped boards), DEC-1 connector FP, R5 abutting-zone tolerance; and Phase 4–6: diff-pair bare-P/N mis-pairing (VIN/VIP false pair + USB_DP/DM miss), atomic schematic write (temp+os.replace — a failed edit now leaves the original byte-identical), C4 cross-segment overlap accumulation, microstrip prop delay 5.8→6.1 ps/mm, TaskStore locked snapshots + atexit shutdown, sqlite URI escaping, router double-wrap unwrap.
- Phase 0: repo scaffold,
pyproject.toml(hatchling, pinned stack), FastMCP bootstrap (kicad_mcp/server.py),config.py(KICAD_MCP_*), backend factory + capability router with graceful degradation (backends/{base,cli,sexpr,ipc,factory}.py), kicad-cli discovery (mac/win/linux + override), path confinement +shell=Falsesubprocess helpers, CI (.github/workflows/ci.yml, 3 OSes × py3.10–3.13),get_server_statusdiagnostics tool. - Phase 1: project discovery/info/create (
tools/project.py), S-expr read layer — components (kicad-skip), stackup + board info (sexpdata) — cli wrappers for ERC/DRC (normalized JSON), netlist, BOM, gerbers, drill, STEP, pos, SVG, 3D render, andexport_fab_package(gerbers+drill+BOM+CPL zip). 17 tools registered. Nets via clikicadxmlnetlist +trace_net. - Phase 2 — review engine v1 (
kicad_mcp/review_engine/): normalizedDesignModel(stackup + copper-layer role inference from zones, footprints/pads with absolute positions, tracks/vias/zones, net classification, geometry helpers),Rule/Finding/registry/report framework, and 11 cited rules across 5 families — stackup (K1/K2/K5/K6), grounding (G1/G2), return_path (R5, geometric trace-over-gap via point-in-polygon), decoupling (DEC-1 proximity), dfm (RTE-2/RTE-3/DFM-4). Toolsreview_design/review_topic/set_design_context+review_boardprompt. 20 tools total. Golden fixtures intests/fixtures/review/(generatorgenerate_review_fixtures.py) with must-trigger + must-not-trigger + anti-myth (90° corners → 0 findings) tests. Heuristic rules (G2, DEC-1) softened to WARNING to limit false positives, documented inline. - Phase 3 — live editing via IPC (
backends/ipc.py,tools/board_edit.py,tools/routing.py): kipy connection mgmt with per-PID socket discovery (each KiCad process serves its own/tmp/kicad/api-<pid>.sock; we probe all and prefer one with an open board),commit()context manager (begin→push, drop on exception = single undo step), move/rotate footprint (rotate must assign via theorientationsetter — the getter returns a copy), route_trace (polyline), add_via, route_differential_pair (miteredoffset_polyline), add_zone (PolygonWithHoles), refill_zones, save_board. 30 tools total. Verified live against KiCad 9.0.8: moved/rotated R2, routed traces + diff pair, via, GND zone, refill, save → re-parsed the saved file (all edits present) → rendered headless (edits visible). Graceful errors when GUI down (all non-GUI tests still pass headless). NOT yet done (deferred to Phase 6 polish): place NEW footprint from a library via IPC (needs the symbol/footprint definition pipeline), netclass management tools. - Phase 4 — review engine v2: +5 families, 23 rules total. transmission (F2 critical-length keyed off
set_design_contextrise time, F4 intra-pair skew in picoseconds), crosstalk (C4 aggressor-near-diff-pair via segment proximity + 3×H), smps (PWR-3 FB-near-SW), subcircuits (XTL-1, STM-1 NRST=WARNING, STM-2, STM-6, USB-2, MIX-2 — schematic-connectivity viamodel.schematicfrom the netlist), connectors (CON-1, ESD-1). Explicit anti-myth test (test_antimyth.py) asserts no rule mentions a myth term. New golden fixtureshighspeed_4layer{F2,F4,C4},smps_4layer{PWR-3}. - Phase 5 — schematic edit + libraries: transactional write pipeline in
sexpr.py(edit_schematic: flag gate + lock check → mutate → re-parse rollback on corruption → ERC report with delta),set_symbol_property/duplicate_symbol(clone, not lib injection — safer).backends/library.py: ranked symbol/footprint search over installed KiCad libs (exact>prefix>substring), JLCPCB SQLite search (jlcparts schema, actionable error whenKICAD_MCP_JLCPCB_DBunset). - Phase 6 — advanced + polish: async
TaskStore(tasks.py, thread pool) +get_task_status/list_tasks/cleanup_tasks; tool router (tools/router.py, 14 categories,list_tool_categories/get_category_tools/search_tools/execute_tool, completeness enforced by test); review/DRC history (history.py,.kicad-mcp/history.jsonl); Freerouting (backends/freerouting.py, async via task queue); promptsplan_stackup/debug_emi/prepare_fab;docs/architecture.md. - Rip-up / delete routing (2026-07-24): added
rip_up_nets(nets)andrip_up_footprint(reference)tobackends/ipc.py+tools/routing.py. Closes the delete-copper gap: the server could create tracks/vias but never remove them, andmove_footprintstranded old copper.rip_up_netsvalidates names againstboard.get_nets(), collectsget_tracks()+get_vias()on those nets (tracks/vias ONLY — never pads/zones),board.remove_items(victims)inside onecommit()(single undo, rollback on error).rip_up_footprintscopes to the part's local pad nets (fanout ≤ 2 footprints), skipping shared GND/power nets so a plane is never torn up (include_shared=Trueto override). Both use KiCad-9-safeget_tracks()/get_vias()— NOTget_items_by_net/get_connected_items, which are kipy 0.7 / KiCad 10.0.1+ only (verified viaversionaddedannotations). 8 new fake-board unit tests + 1requires_kicad_guiroute-then-rip-up test.router.pyrouting category now lists both. 49 tools now. - v1.0 release prep + deferred gaps (2026-07-04): closed two gaps —
duplicate_footprint(IPC proto-copy of a placed footprint; KiCad 9 IPC has NO library-instantiation API, verified) andget_netclasses(IPC read of netclass constraints), both verified live against KiCad 9.0.8. 47 tools at that point. Release: version → 0.1.0 (pyproject +__init__+ server.json in sync),CHANGELOG.md,docs/example.md(STM32 review→fix→export walkthrough),.github/workflows/release.yml(PyPI Trusted Publishing on tag),server.json(MCP registry manifest),PUBLISHING.md. Built + twine-checked the wheel/sdist and smoke-installed the wheel in a clean venv (version 0.1.0, 47 tools,kicad-mcpconsole entry point present). NOT published (outward-facing, needs the maintainer's PyPI/registry credentials — see PUBLISHING.md).
- Phase 0: repo scaffold,
- Remaining honest gaps (documented, not blockers): placing a NEW footprint/symbol from a LIBRARY — KiCad 9 IPC exposes no library-instantiation API and there is no schematic IPC at all, so
duplicate_footprint/duplicate_symbolclone existing parts instead; DSN export is not available via kicad-cli in KiCad 9 soautoroute_boardneeds a GUI-exported.dsn; the tool router does not hide routed tools — a deliberate NON-goal (true hiding needs a FastMCP tool-visibility feature and 47 tools is manageable; forcing a dispatch-registry would add fragility for marginal benefit); JLCPCB/Freerouting exercised against a synthetic DB / interface only; cross-OS (uvxon Linux/Windows) only via CI so far, not a live KiCad smoke on those OSes. - Next action: publish (maintainer runs
PUBLISHING.md: tagv0.1.0→ PyPI Trusted Publishing, thenmcp-publisherfor the registry) and do a liveuvx kicad-mcp+ KiCad 9 smoke on Linux and Windows. The project is feature-complete against PLAN §8 and meets the §11 v1.0 definition of done. - Machine note:
~/Library/Preferences/kicad/9.0/kicad_common.jsonhadapi.enable_serverflipped totruefor the live smoke (backup:kicad_common.json.kicad-mcp.bak). Leave enabled for IPC work. - Smoke test:
KICAD_MCP_SEARCH_PATHS=$(pwd)/tests/fixtures ./.venv/bin/python -m kicad_mcpthen callget_server_status; or run./.venv/bin/python -m pytest -q. - Keep this section current. Update it at the end of every session with the phase reached and what is left.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 84 lines · 4,197 tokens per session scan A e776aba0ea97
kicad-mcp CLAUDE.md is an instructions file published in the GitHub repository antonmadto/kicad-mcp (0 stars, last pushed 27d ago), licensed MIT. It adds 4,197 tokens to every session, about $0.0210 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.