MCPkicad: Instructions file for Claude Code

CLAUDE.md

MCPkicad CLAUDE.md is an instructions file for Claude Code from Bov27/MCPkicad. It costs 9,320 tokens per session, scanned A, original, MIT.

Repository instructions for a KiCAD MCP server that lets an AI assistant work with PCB and schematic design files. KiCAD is software for designing circuit boards.

In plain words
What is it for?
They are for developing or maintaining the server, its tools and resources, and its handling of .kicad_pcb, .kicad_sch, and .kicad_pro files.
Why use it?
They explain the project's TypeScript server, Python backend, configuration, and communication with KiCAD so changes fit the existing structure.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is Bov27/MCPkicad's own configuration. It tells Claude Code how to work on MCPkicad itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything MCPkicad configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Bov27/MCPkicad. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Bov27/MCPkicad/beta-test/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Bov27/MCPkicad

Made for: Claude Code.

Wrote 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.

agentmods badge for MCPkicad CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/bov27/mcpkicad/claude-md.svg)](https://agentmods.dev/instructions/bov27/mcpkicad/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/bov27/mcpkicad/claude-md"><img src="https://agentmods.dev/badge/instructions/bov27/mcpkicad/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 9,320 This file is loaded in full into every session.
When invoked 9,320 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.09320 $0.09320
Opus 5 $0.04660 $0.04660
Sonnet 5 $0.01864 $0.01864
Haiku 4.5 $0.00932 $0.00932

Measured 7d ago against content hash b3262cca31ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

MCPkicad 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 7d 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.

CLAUDE.md · 403 lines

How it starts

The opening of the file, as written. The whole thing — 403 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KiCAD MCP Server

What This Project Is

An MCP (Model Context Protocol) server that enables AI assistants to design PCBs and schematics in KiCAD. It has a TypeScript frontend (MCP server, tool registration, STDIO transport) and a Python backend (KiCAD interaction via pcbnew SWIG API and kicad-skip for schematics).

Architecture

AI Client (Claude, etc.)
  ↕ STDIO (MCP protocol)
TypeScript Server (src/)
  ↕ JSON over stdin/stdout (child process)
Python Backend (python/)
  ↕ pcbnew SWIG API / kicad-skip / S-expression manipulation
KiCAD files (.kicad_pcb, .kicad_sch, .kicad_pro)

TypeScript Layer (src/)

  • index.ts — Entry point, starts MCP server
  • server.tsKiCADMcpServer class, spawns Python child process (with auto-restart on crash), registers all tools/resources/prompts
  • config.ts — Zod-validated config loading from config/
  • logger.ts — Logger (stderr only; stdout reserved for MCP protocol)
  • tools/*.ts — Tool registration using @modelcontextprotocol/sdk. Each tool calls callKicadScript(command, args) which sends JSON to the Python process
  • resources/*.ts — MCP resource handlers
  • prompts/*.ts — MCP prompt templates

Python Layer (python/)

  • kicad_interface.py — Main entry point. Reads JSON commands from stdin, dispatches to command handlers, returns JSON on stdout. Supports IPC and SWIG backends. WARNING: This is a 7000+ line god file with duplicated pin math in 7 handlers. When fixing pin calculations, check ALL inline pin calc sites, not just pin_locator.py. Contains shared geometry parser _parse_schematic_geometry(), content-based static helpers _delete_component_from_content(), _edit_component_in_content(), T-junction helpers _point_on_wire_segment() and _find_connected_wires(), and a shared PinLocator instance (self.pin_locator).
  • commands/ — Command handlers organized by domain:
    • schematic.pySchematicManager (create schematic, template-based)
    • component_schematic.pyComponentManager (add/edit/delete/move components using kicad-skip + dynamic symbol loading). add_component snaps to 1.27mm grid. remove_component uses text-based balanced-paren deletion (not kicad-skip _elements).
    • connection_schematic.pyConnectionManager (wires, net labels, connections)
    • wire_manager.pyWireManager (thin delegation layer to sexp_writer.py)
    • pin_locator.pyPinLocator (pin position discovery via S-expr parsing, handles rotation + mirror)
    • sexp_writer.py — Text-based insertion/deletion for .kicad_sch files (wires, labels, junctions, no-connects, wire splitting). All writes use f.flush() + os.fsync(). Has _to_content/_from_content variants for all operations including add_label_to_content, add_polyline_wire_to_content, split_wire_at_point_in_content, delete_no_connect_from_content. Wire placement (add_wire, add_polyline_wire) now auto-detects T-junctions and adds junction dots via auto_add_t_junctions(). Also has _parse_wire_segments(), _parse_existing_junctions(), and _point_on_wire_mid() helpers for T-junction spatial analysis.
    • net_analysis.py — Net-level analysis using union-find graph. build_net_graph() builds complete pin→net mapping in O(W+L+P) via union-find with spatial-indexed T-junction detection. Query functions: get_component_nets, get_net_components, get_pin_net_name, export_netlist_summary, validate_component_connections, find_shorted_nets, find_single_pin_nets.
    • component.py — Board-level component operations (via pcbnew)
    • routing.py — Trace routing (via pcbnew)
    • board.py, board/*.py — Board operations (layers, outline, size, 2D view)
    • project.py — Project creation/management
    • library.py, library_schematic.py, library_symbol.py — Library operations
    • dynamic_symbol_loader.py — Loads symbols from KiCAD libraries at runtime. _extract_symbol_block handles both multi-line and single-line .kicad_sym files via balanced-paren traversal.
    • footprint.py — Footprint operations
    • export.py — Export (Gerber, PDF, SVG, BOM, 3D, etc.)
    • design_rules.py — DRC rules
    • jlcpcb.py, jlcpcb_parts.py, jlcsearch.py — JLCPCB integration
    • datasheet_manager.py — Datasheet URL extraction
    • symbol_creator.py — Custom symbol creation
    • svg_import.py — SVG logo import
  • kicad_api/ — Backend abstraction (SWIG vs IPC)
    • base.py — Abstract base class
    • swig_backend.py — pcbnew SWIG backend
    • ipc_backend.py — KiCAD IPC API backend (experimental)
    • factory.py — Backend factory
  • schemas/tool_schemas.py — Python-side tool schema definitions
  • resources/ — Resource definitions
  • utils/ — Platform detection, KiCAD process management
  • templates/ — Schematic templates (used by create_schematic)

Read the full file on GitHub · 403 lines

Changes

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.

  1. 7d ago First seen · 403 lines · 9,320 tokens per session scan A b3262cca31ef

Subscribe to this mod's changes

MCPkicad CLAUDE.md is an instructions file published in the GitHub repository Bov27/MCPkicad (0 stars, last pushed 2mo ago), licensed MIT. It adds 9,320 tokens to every session, about $0.0466 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.

Related

Other instructions, from other repositories

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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.

vercel/next.js · 7,296 tokens

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.

langchain-ai/langchain · 4,469 tokens

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).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens