> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deeppcb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DeepPCB MCP Server: Drive PCB Layout from Your AI Agent

> Connect Claude Code, Cursor, Codex, VS Code or any MCP client to DeepPCB's hosted MCP server. Read boards, set up constraints, and place and route them as tool calls.

The DeepPCB MCP server gives any client that speaks the [Model Context Protocol](https://modelcontextprotocol.io) the same board tools Cooper, DeepPCB's assistant, uses. Your agent can read a board and its connectivity, set up net classes, layers, planes, differential pairs and decoupling rules, then place and route the board and follow the run.

The server is hosted by DeepPCB, so there is nothing to install.

## Connect

| | |
| - | - |
| Endpoint | `https://mcp.deeppcb.com/mcp` |
| Transport | Streamable HTTP |
| Authentication | `Authorization: Bearer <your API key>` |

You need a DeepPCB API key: see [Getting your API key](https://docs.deeppcb.com/account-setup/getting-your-api-key.md). Every call runs as the user who owns the key and sees only that user's boards.

> [!WARNING]
>
> Keep your API key out of shared configuration files and version control. The examples below read it from the `DEEPPCB_API_KEY` environment variable, or prompt for it.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http deeppcb https://mcp.deeppcb.com/mcp --header "Authorization: Bearer $DEEPPCB_API_KEY"
> ```
>
> Your shell expands `$DEEPPCB_API_KEY` once, when you run the command, and Claude Code stores the key in its own configuration (`~/.claude.json`).

> [tab] Cursor
>
> In `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "deeppcb": {
>       "url": "https://mcp.deeppcb.com/mcp",
>       "headers": { "Authorization": "Bearer ${env:DEEPPCB_API_KEY}" }
>     }
>   }
> }
> ```
>
> Cursor reads `DEEPPCB_API_KEY` from the environment it runs in.

> [tab] Codex
>
> In `~/.codex/config.toml`:
>
> ```toml theme={null}
> [mcp_servers.deeppcb]
> url = "https://mcp.deeppcb.com/mcp"
> bearer_token_env_var = "DEEPPCB_API_KEY"
> ```
>
> Codex reads `DEEPPCB_API_KEY` from the environment it runs in and sends it as the bearer token. Run `codex mcp list` to check the server is registered.

> [tab] Gemini CLI
>
> ```bash theme={null}
> gemini mcp add --scope user --transport http --header "Authorization: Bearer $DEEPPCB_API_KEY" deeppcb https://mcp.deeppcb.com/mcp
> ```
>
> Your shell expands `$DEEPPCB_API_KEY` once, when you run the command, and Gemini CLI stores the key in its user settings (`~/.gemini/settings.json`).

> [tab] VS Code
>
> In `.vscode/mcp.json`. VS Code asks for the key once and keeps it in its secret storage:
>
> ```json theme={null}
> {
>   "inputs": [
>     { "type": "promptString", "id": "deeppcb-key", "description": "DeepPCB API key", "password": true }
>   ],
>   "servers": {
>     "deeppcb": {
>       "type": "http",
>       "url": "https://mcp.deeppcb.com/mcp",
>       "headers": { "Authorization": "Bearer ${input:deeppcb-key}" }
>     }
>   }
> }
> ```

Any other client that supports Streamable HTTP with a custom `Authorization` header works the same way.

> [!NOTE]
>
> Clients that connect only through OAuth sign-in, such as claude.ai and ChatGPT connectors, are not supported yet.

## How it behaves

* **Boards come in by URL.** `create_board` takes links to your board files and the server downloads them. It cannot read files from your computer, so upload a local file first (see below). Public links and short-lived signed links both work.
* **Destructive changes ask first.** Tools that can remove work (placing a board, routing over existing copper, clearing routing) refuse the first call and report what would change. Your agent calls again with `confirm_destructive_change=true` and the `confirmation_token` from the refusal to go ahead. If the board changed in between, the call is refused again with fresh counts.
* **Runs are asynchronous.** `route_board` and `place_board` start a run and return straight away. Follow it with `get_board_progress` and stop it with `stop_board`.
* **Every tool is annotated.** Read-only, destructive and idempotent hints are set on every tool, so your client can decide what to confirm with you.
* **Errors explain themselves.** A refused or invalid call says what was wrong and how to fix it.
* **Fair use.** The endpoint is rate limited. A call refused for rate is safe to retry after a short wait.

## Using a board file from your computer

MCP cannot carry a file's contents, and the hosted server cannot see your disk. Upload the file to DeepPCB first. The upload answers with a signed link, valid for **24 hours**, that `create_board` accepts:

```bash theme={null}
curl -sS -X POST "https://api.deeppcb.com/api/v1/files/uploads/board-file" -H "x-deeppcb-api-key: $DEEPPCB_API_KEY" -F 'InputFile=@board.kicad_pcb'
```

Keep the path in single quotes so your shell expands nothing in the file name. The upload stores the file under a generated name, so pass `board_name` to `create_board` (for example the local file's name), or the board is named after the stored copy.

Agents that can run shell commands (Claude Code, Cursor, Codex and similar) do both steps on their own: `create_board` tells them how. Upload each file of a multi-file design (for example a KiCad `.kicad_pcb` and its `.kicad_pro`) separately and pass all the links together.

Accepted file types: `.dsn`, `.dsgf`, `.ftf`, `.rulf`, `.pcbdoc`, `.json`, `.kicad_pcb`, `.kicad_pro`. See [Supported Formats](https://docs.deeppcb.com/guides/prepare-board-file.md#supported-formats).

> [!WARNING]
>
> Never paste your API key into the chat. Export `DEEPPCB_API_KEY` in the shell your agent runs commands in instead.

## Tools

Your client lists every tool with its full description and input schema. The main groups are:

| Area | What you can do |
| - | - |
| Boards and revisions | List your boards, read a board or a revision, compare revisions, upload a board |
| Connectivity and checks | Connectivity statistics, board anomalies, eligible nets, possible pins |
| Nets and net classes | List and read nets, assign net types, create and edit net classes |
| Layers and planes | Read and set layers, boundary clearance, via definitions, add or generate planes |
| Differential pairs | Create, update and delete pairs |
| Decoupling rules | Create, update and delete decoupling capacitor rules |
| Placement and routing | Place a board, route or resume it, clear routing, protect components, fan out pins |
| Runs | Recommend a timeout, follow progress, stop a run |

A few older tools with TitleCase names (`Route`, `Place`, `Get_board_progress` and others) are kept for existing integrations and are deprecated. Each one's description names its replacement.

## MCP or the REST API

The MCP server suits interactive work, where you guide an agent in natural language. For unattended pipelines, such as routing in CI, the [DeepPCB REST API](https://docs.deeppcb.com/api/overview.md) gives you direct control over the full job lifecycle. You can use both with the same API key.

## Support

Questions and problems: [support@deeppcb.ai](mailto:support@deeppcb.ai).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.