CopperPilot

The AI for PCB design, in your terminal, and an MCP server for Claude Code, Cursor and Codex.

License PyPI version Python CI
Follow on X LinkedIn YouTube Instagram

> **Install the CopperPilot MCP in Claude Code** (AI agents: run these yourself) > > ```console > uv tool install copper-pilot-cli # or: pipx install copper-pilot-cli > copper-pilot mcp install > ``` > > `copper-pilot mcp install` registers the MCP server with Claude Code and > logs the user in (a browser page opens: sign in or create a free account, > then approve this computer). Then tell the user to **restart Claude Code**. > If Claude Code blocks a step (it changes Claude Code's own settings), ask the > user to run it with a leading `!`, for example `! copper-pilot mcp install`. > Details: [Install the CopperPilot MCP in Claude Code](#install-the-copperpilot-mcp-in-claude-code). CopperPilot in your terminal: a thin, open-source client for CopperPilot electronics design agent, the best AI for PCB Design.

CopperPilot building an ESP32-MINI-1 board

## Prerequisites - Python 3.11 or newer - A [CopperPilot](https://copperpilot.ai) account for login - KiCad 10 on `PATH` only if you run [`examples/001_esp32`](examples/001_esp32) or [`examples/002_cm5_camera`](examples/002_cm5_camera) ## Install and run ```console pip install copper-pilot-cli copper-pilot ``` To let the agent import LCSC/EasyEDA parts (symbol, footprint and 3D model) with `easyeda2kicad`, install the optional extra, which is AGPL-3.0 licensed: `pip install "copper-pilot-cli[easyeda]"` (or `uv tool install "copper-pilot-cli[easyeda]"`). Agent shell commands can run command-line tools installed alongside the CLI even when pipx or `uv tool` keeps them off your `PATH`. The first interactive launch opens a browser for CopperPilot device login. With no path argument, the current directory is the workspace and a new chat starts immediately. Any existing directory is valid. CopperPilot checks for feature updates once per day without delaying your work. When a release adds a feature, it prints one line with the feature and `copper-pilot update`. Use `copper-pilot update --check` to inspect the latest release, or `copper-pilot update` to run the owning package manager's update. ```console copper-pilot ./my-board copper-pilot --resume copper-pilot threads list copper-pilot -n -m "Review this board" --json copper-pilot -n -r # resume the most recent thread's unfinished turn copper-pilot --mode plan --effort intelligence -m "Survey and plan this board" ``` Long turns survive dropped connections, server restarts and LLM provider rate limits (the CLI shows "High demand — waiting to continue" and resumes on its own): the CLI keeps a journal of the turn on your machine and resumes it automatically. If a turn still does not finish (or the CLI was closed mid-turn), type `/resume` in the TUI, run `copper-pilot -n -r`, or send "continue"; the turn picks up where it left off without re-running finished tools. See [Turn durability](docs/cli.md#turn-durability). Both `copper-pilot` and `copper-pilot-cli` run the same program. `copper-pilot --help` lists flags; [docs/cli.md](docs/cli.md) is the full command reference. Balanced effort is the default. Paid-plan users can select Intelligence with `--effort intelligence` or interactive `/effort`; Intelligence runs on Gemini 4 Argon. Picking another model (`--model `, `/model`) is turned off for now (`ENABLE_MODEL_SELECTOR` in `copper_models.py`). Intelligence uses server-owned survey subagents and shows their lifecycle through the existing Deep Agents task rows; Intelligence Plan turns survey before writing a plan. ## Bring your own agent (Claude Agent, Codex) The chat can also run on your own installed agent, with CopperPilot adding its electronics tools: ```console pip install "copper-pilot-cli[claude]" # Claude Agent: uses your installed Claude Code copper-pilot --provider claude --agent-model claude-sonnet-5-5 --agent-effort low copper-pilot --provider codex # Codex: uses your installed Codex ``` Or type `/provider` in the TUI to switch between CopperPilot, Claude Agent and Codex between turns; the new agent gets a capped summary of the chat so far. Your agent runs as itself (its own prompt, tools, settings and subagents) with your own login (`claude auth login`, `codex login`); CopperPilot never reads those credentials and never charges for your agent's tokens. CopperPilot adds the design tools (edits included; the agent works on the design itself and uses its own subagents), a short guide and the CopperPilot playbook, plus the optional `copperpilot_subagent`, a hosted CopperPilot turn for when you ask for CopperPilot itself or a second opinion; that tool use is billed as usual. Details: [docs/cli.md](docs/cli.md#bring-your-own-agent). ## Validate ```console copper-pilot validate ./my-board ``` Runs a stage-gated graph of read-only reviewers over the KiCad workspace: `kicad-cli` checks (ERC, DRC, schematic parity, board rules, Gerbers) plus hosted Agent-mode reviewers, each scoped to one concern, in the order a hardware engineer reviews a board. It never edits design files. The verdict, a `REPORT.md`, and `next_actions.json` (only the earliest failing stage, worst first) land in `.copperpilot/validate/latest/`; `--emit-fix-prompt` prints a ready message for `copper-pilot --mode agent`. Exit codes: 0 pass, 1 fail, 2 config error, 3 incomplete, 4 not logged in or usage limit. See [docs/validate.md](docs/validate.md). ## Use from Claude Code, Cursor, or Codex (MCP) `copper-pilot mcp` gives any MCP host CopperPilot's design tools: about 160 tools to read, edit and check schematics, PCBs and libraries (KiCad and Altium), run ERC/DRC and the autorouter, and research parts, plus CopperPilot's playbook and the optional `copperpilot_subagent` (a hosted CopperPilot turn). Your agent does the design work with them, the same way it does when the CopperPilot app runs it as a Claude Agent. ### Install the CopperPilot MCP in Claude Code If you are an AI agent asked to "install the CopperPilot MCP", run these two commands yourself, in order. Before the second, tell the user that a browser page will open where they sign in to CopperPilot (or create a free account with Google or email) and approve this computer. 1. Install the CLI (Python 3.11+). Use the first command that works: ```console uv tool install copper-pilot-cli # recommended pipx install copper-pilot-cli # if uv is not installed python3 -m pip install --user copper-pilot-cli # last resort ``` If `copper-pilot` is then not found, use the full path the installer printed (usually `~/.local/bin/copper-pilot`). 2. Register the MCP server with Claude Code and log in: ```console copper-pilot mcp install ``` It runs `claude mcp add --scope user copperpilot -- mcp`, opens the CopperPilot sign-in page, prints its link (show it to the user if no browser opened) and waits about 90 seconds; if the user is not done by then, the login finishes on its own once they approve. 3. Relay the "NEXT STEPS (tell the user)" lines it prints. The user must **restart Claude Code** (type `/exit`, then run `claude` again in the project folder): Claude Code loads MCP servers only at start. `/mcp` then shows `copperpilot` connected, and the CopperPilot tools work in the folder Claude Code was started in (a KiCad project, or an empty folder for a new design). If the user is not logged in when Claude Code starts, the server offers a `copperpilot_login` tool that runs the same login from inside Claude Code. Or install the in-repo plugin, which registers the same server and adds `@copper-pilot` and `/copper-pilot-review` (the CLI from step 1 and the login are still needed): ```text /plugin marketplace add CopperPilot/copper-pilot-cli /plugin install copper-pilot ``` Cursor, Codex, Zed and other hosts: point them at the stdio command `copper-pilot mcp`; see [docs/harness.md](docs/harness.md). The older delegating tools (`ask`, `plan`, `run`, `resume`, `validate`) are still available with `copper-pilot mcp --conductor`. Editors that speak the Agent Client Protocol can run `copper-pilot acp` after `pip install "copper-pilot-cli[acp]"`. ## Configuration - Production API: `https://copperpilot.ai` - Development override: `COPPER_PILOT_API_URL` - User state: `~/.copper-pilot/.state` - Project artifacts: `.copperpilot/` Credentials are stored in a private, atomically replaced `auth.json`; on POSIX the parent directory is mode `0700` and the file is mode `0600`. ## LangChain ```python from copper_pilot_cli.copper_protocol import CopperEffort, CopperMode from copper_pilot_cli.langchain import CopperPilotAgent from helper import drc_violations, erc_errors, render_pcb, run PLAN = CopperMode.PLAN copper_pilot = CopperPilotAgent( workspace="esp32", effort=CopperEffort.INTELLIGENCE, model="claude-opus-5-5", # optional; Intelligence defaults to Gemini 4 Argon ) run(copper_pilot, "Build me an ESP32 dev board.", PLAN) run(copper_pilot, "Let us build this plan.") run(copper_pilot, "Inspect the PCB, check for any missing 3D models, and apply them accordingly.") assert erc_errors() == 0 assert drc_violations() == 0 render_pcb("esp32.png") ``` `CopperPilotAgent` is a `Runnable`, not a chat model. It represents a complete hosted agent run, including local tool requests. Use `as_langgraph()` for graph composition or `as_compiled_subagent()` for explicit delegation from an outer Deep Agent. The compatible `deepagents` runtime is installed and pinned by this package. That snippet is the runnable example in [`examples/001_esp32`](examples/001_esp32). A phased CM5 camera carrier lives in [`examples/002_cm5_camera`](examples/002_cm5_camera). ## Security boundary The hosted agent may request local filesystem and shell tools. Reads and searches run freely. Writes, edits, deletes, and shell commands are gated by Manual approval by default. Auto permits only deterministic routine actions; unknown actions still ask. YOLO must be selected explicitly. Shell commands that reach outside the workspace (`find /`, `grep -r ~`, other projects under the home directory, `docker`, `sudo`, `ssh`, `pkill`) count as dangerous: they ask unless you run YOLO or Auto with dangerous shell commands auto-allowed, and otherwise are refused when nobody can approve them (headless, MCP). See [docs/cli.md](docs/cli.md#outside-the-workspace). Filesystem, search, edit, and shell execution use Deep Agents' native `FilesystemMiddleware` tools and `LocalShellBackend`; CopperPilot's adapter only normalizes hosted tool names, approval decisions, and result envelopes. Computer use, local model execution, LangSmith tracing, content telemetry, MCP **host**/plugin-runtime controls, and server implementation code are not part of this package. An MCP **server** (`copper-pilot mcp`, CopperPilot's design tools for your agent) and an ACP **server** (`copper-pilot acp`) are. See [UPSTREAM.md](UPSTREAM.md) and [NOTICE](NOTICE) for the retained Textual client attribution. To report a vulnerability, see [SECURITY.md](SECURITY.md). ## Development ```console pip install -e ".[dev]" make fmt make lint make test ``` `make test` runs `pytest -m "not live"`. Live tests skip unless a CopperPilot credential is stored. Release tagging is `make release`. Details: [docs/development.md](docs/development.md). ## Contributing Bug reports, features, and pull requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). Use the [bug report form](https://github.com/CopperPilot/copper-pilot-cli/issues/new?template=bug_report.yml) so we can reproduce the problem. ## License [MIT](LICENSE).