Skip to content

copper-pilot mcp: CopperPilot's design tools for Claude Code/Cursor/Codex, with login inside the MCP - #89

Merged
AdityaNG merged 6 commits into
mainfrom
feat/mcp_full_tools_30_nov_2026
Nov 30, 2026
Merged

AdityaNG merged 6 commits into
mainfrom
feat/mcp_full_tools_30_nov_2026

Conversation

@AdityaNG

@AdityaNG AdityaNG commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Why

copper-pilot mcp only exposed whole-turn delegating tools (ask/plan/run), so Claude Code over MCP got far less than a Claude Agent chat in the desktop app or CLI (BYOA), which gets every granular design tool, the guide and the playbook. Installing it also needed a terminal login before the server would do anything.

What

  • copper-pilot mcp now serves the BYOA tool session by default: about 160 design tools (reads, edits, batches, sync, ERC/DRC, autorouter skills, research), read_copperpilot_playbook, load_server_skill, and copperpilot_subagent. The CopperPilot guide becomes the server instructions when logged in, and is also available as the resource copperpilot://guide. The old delegating tools are still there behind copper-pilot mcp --conductor; --tools-session is kept as a hidden no-op for existing configs.
  • Login inside the host: without a stored login the server still starts, listing only copperpilot_login and copperpilot_status.
    • copperpilot_login starts the device flow, opens the browser (without inheriting stdout, so the stdio stream is safe) and returns the link for the agent to show the user.
    • A second call waits for the approval, connects, and sends notifications/tools/list_changed, so the design tools appear without restarting Claude Code.
    • A revoked key falls back to the login tool, and a login stored for another server URL doesn't count.
  • Design writes are routine under Auto: KiCad design files that CopperPilot's own edit tools write inside the workspace no longer need approval, the same rule as the TUI's Claude Agent runtime. Previously every edit was refused over MCP, because nobody can answer an approval prompt there.
    • .kicad_dru, sym-lib-table and fp-lib-table now count as design files too. This also helps Claude Agent and Codex chats under Auto.
    • New broker flag routine_skill_writes: the skill installers (autorouter, library search, fab order) can write under .copperpilot/skills/. Only the standalone MCP sets it, because there the host approves each CopperPilot tool call; the TUI still asks. Before this, every bench run stalled before routing.
  • copper-pilot mcp install: one command that runs claude mcp add --scope user copperpilot with this installation's absolute path, then the device login.
    • It prints the link, opens the browser and waits about 90 s. If the user isn't done by then, a detached helper finishes the login on the same link.
    • It always ends with "NEXT STEPS (tell the user)", with the restart first.
  • Staged Altium edits are applied after each edit call. An MCP host never reports a turn end, so without this they were never applied.
  • Workspace: --workspace, else CLAUDE_PROJECT_DIR, else cwd.
  • copper-pilot auth login prints the link (for SSH and headless use) and says "Already logged in" instead of starting a new flow (--force to log in again).
  • README: a two-command install block right under the badges (uv tool install copper-pilot-cli and copper-pilot mcp install, then restart), plus a detailed section for agents. It is placed at the top so it survives the WebFetch summaries Claude reads READMEs through. The tagline and the PyPI description and keywords now mention the MCP server, to help discovery. docs/cli.md and docs/harness.md are updated to match.
  • Plugin 0.2.0: uses the design tools (server name copperpilot), and its agent and review skill are rewritten for them.

Testing

  • make lint (ruff clean; ty shows only diagnostics that were already on main) and pytest -m "not live": 1149 passed. New tests/test_mcp_standalone.py covers the logged-out tool list, the login link → approve → list_changed sequence over a real in-memory MCP session, the guide as instructions, edit → apply, the revoked key, the other-server login and routine design writes.
  • Live against a local server (main 1.0.23):
    • An MCP stdio probe saw 160 tools and the 5 KB guide as instructions.
    • claude -p on Haiku 5.5 at low effort answered a net-count question through mcp__copperpilot__query_design (6 nets, about $0.005).
  • The Haiku design bench found the write-rejection bug on its first edit; it is fixed here (second commit).
  • The e2e onboarding story ST-35 is in copper-pilot-tech#58: Claude Code on Haiku is asked to "Install the CopperPilot MCP". Several of its runs drove the later commits here (install command, README order, the -e ordering, the restart step). With this branch, Claude's own copper-pilot mcp install triggered the browser login, and after a restart the question was answered through query_design.

… the MCP host

The default MCP server is now the tool session the Claude Agent and Codex chats
use (about 160 design tools, the playbook, copperpilot_subagent) instead of the
delegating ask/plan/run conductor (kept as --conductor).

- Starts without a login: lists copperpilot_login and copperpilot_status;
  copperpilot_login runs the browser device login from the host, returns the
  link to show the user, and sends tools/list_changed once approved.
- The CopperPilot guide is the server's instructions when logged in.
- Altium staged edits are applied after each edit call (MCP has no turn end).
- Workspace defaults to CLAUDE_PROJECT_DIR, else cwd.
- auth login prints the link and skips the flow when already logged in
  (--force to log in again); browsers open without inheriting stdout.
- README: step-by-step install for an agent asked to install the MCP.
- Plugin 0.2.0 uses the design tools (server name copperpilot).
…der Auto

Nobody can approve a prompt over MCP, so every edit tool's bridge write to a
.kicad_sch/.kicad_pcb was refused ('ToolRejected: write was rejected'). Same
rule as a Claude Agent chat in the TUI (runtime.py): KiCad design files inside
the workspace written by CopperPilot's tools are routine; outside still refused.
Found in the Haiku design bench (L1, first edit).
…e Code and logs in

The ST-35 onboarding story (Claude Code on Haiku asked to 'Install the
CopperPilot MCP') showed Claude following the README's separate steps but never
running the login and never telling the user to restart Claude Code.

- copper-pilot mcp install: claude mcp add --scope user copperpilot with this
  installation's absolute path; device login with the link printed and a
  ~90 s foreground wait, then a detached helper finishes the login on the same
  link; ends with 'NEXT STEPS (tell the user)', restart first.
- README install section is now two commands plus relaying those steps;
  tagline and PyPI description/keywords mention the MCP server (discovery).
…outine writes

Found by the Haiku design bench: every run stalled before routing because
install_kicad_autorouter (writes .copperpilot/skills/kicad_autorouter/main.py),
install_kicad_lib_search and set_kicad_project_design_rules (writes the
.kicad_dru) were refused: nobody can approve a prompt over MCP.

- .kicad_dru, sym-lib-table and fp-lib-table count as KiCad design files for
  tool-socket writes (also fixes the Claude Agent/Codex chats under Auto).
- New broker flag routine_skill_writes: files under .copperpilot/skills/ are
  routine; only the standalone MCP server sets it (its host approves each
  CopperPilot tool call). The TUI still asks.
ST-35 candidate2: Claude read the README through WebFetch (a prompt-shaped
summary), kept the by-hand 'claude mcp add' alternative and skipped the login.
The install block (uv tool install + copper-pilot mcp install + restart) now
sits right under the badges, and the agent section has no by-hand variant.
ST-35 candidate4: with COPPER_PILOT_API_URL set, 'claude mcp add -e K=V copperpilot'
let the variadic -e swallow the name, registration failed and the NEXT STEPS
(restart) were never shown. -e now follows the name; on a failed registration
the steps give the manual command and still say to restart. README: if Claude
Code's auto mode blocks a step, the user runs it with '!'.
@AdityaNG
AdityaNG merged commit d361f58 into main Nov 30, 2026
11 of 12 checks passed
@AdityaNG AdityaNG mentioned this pull request Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant