Skip to main content

Design PCBs from Codex and ChatGPT

Three lines of config.toml for the Codex CLI, a custom MCP server in ChatGPT, or one tool entry in the OpenAI API. Each one gives the model PCBEditor’s 16 design tools.

Codex CLI

With a personal access token

Create a token at pcbeditor.com/profile/ai-tools, put it in an environment variable, and point Codex at the variable. The token never goes into the file.

~/.codex/config.toml
[mcp_servers.pcbeditor]
url = "https://api.robodib.com/mcp"
bearer_token_env_var = "PCBEDITOR_TOKEN"
bash / zsh
export PCBEDITOR_TOKEN="pcbe_..."
codex

With OAuth sign-in

Add the server without a token, then sign in once:

terminal
codex mcp add pcbeditor --url https://api.robodib.com/mcp
codex mcp login pcbeditor

The browser opens PCBEditor’s consent page. If Codex picks a registration method the server does not offer, run codex mcp login pcbeditor --oauth-client-registration dcr: PCBEditor supports dynamic client registration.

design_board runs as a job and get_job long-polls for progress. If a long poll hits Codex’s tool timeout, raise it in the same table, for example tool_timeout_sec = 120.

ChatGPT

ChatGPT connects to remote MCP servers over Streamable HTTP and signs in with OAuth.

  1. Go to chatgpt.com/plugins.
  2. Click +, then Add custom MCP server.
  3. Enter a name (PCBEditor) and a short description.
  4. Under Connection, choose Public endpoint and enter https://api.robodib.com/mcp.
  5. Choose OAuth for authentication, read the risk notice and select I understand and want to continue.
  6. Select Create as a plugin, review the 16 tools ChatGPT found, then sign in to PCBEditor.
ChatGPT cannot send personal access tokens: OpenAI’s documentation says it does not present custom API keys to MCP servers. Use the OAuth sign-in. Whether you can add custom MCP servers depends on your ChatGPT plan and your workspace’s policy, and OpenAI moves these menus from time to time; if yours look different, follow OpenAI’s current guide for connecting a custom MCP server.

OpenAI API (Responses)

The Responses API takes a remote MCP server as a tool. The model then calls PCBEditor’s tools inside a single request. The API does not store the authorization value, so send it with every request.

python
import os
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-6-astra",
    tools=[{
        "type": "mcp",
        "server_label": "pcbeditor",
        "server_url": "https://api.robodib.com/mcp",
        "authorization": os.environ["PCBEDITOR_TOKEN"],
        "require_approval": "never",  # your own account; use "always" to approve each call
    }],
    input="Design a 2-layer ATtiny85 LED flasher board and run the design-rule check.",
)
print(resp.output_text)

Custom GPTs and Actions

OpenAI has announced the retirement of custom GPTs (see OpenAI’s Custom GPT retirement and migration FAQ in its help center). For new work, use the custom MCP server above. If you maintain an existing GPT, the same tools are described by an OpenAPI 3.1 spec:

OpenAPI spec
https://api.robodib.com/agent-api/openapi.json
  1. In the GPT editor, open Configure and create a new action.
  2. Paste the spec from the URL above into the schema box.
  3. Set Authentication to API key, auth type Bearer, and paste a token from pcbeditor.com/profile/ai-tools.

The same spec works for any agent framework that loads OpenAPI tools. Each tool is also a plain REST call: POST https://api.robodib.com/agent-api/v1/tools/{name} with the bearer token. The request and response schemas are in the spec.

Common questions

Can ChatGPT design a PCB?
With PCBEditor's MCP server added as a custom MCP server, ChatGPT can ask PCBEditor for a complete board: parts, schematic, placement, autorouting and a design-rule check. ChatGPT runs the conversation; PCBEditor's engines do the wiring, routing and checks.
Can I use a personal access token in ChatGPT?
No. OpenAI's documentation says ChatGPT cannot present custom API keys to an MCP server; it gets its bearer token from the OAuth sign-in. PCBEditor supports that sign-in, so choose OAuth when you add the server.
Does the Codex CLI support OAuth?
Yes. Add the server without a token and run codex mcp login pcbeditor. Codex opens the PCBEditor consent page in your browser. If automatic registration picks a method the server does not offer, add --oauth-client-registration dcr.
Should I still build a custom GPT with Actions?
OpenAI has announced the retirement of custom GPTs, so new work should use the MCP connector instead. The OpenAPI spec stays useful for the OpenAI API, other agent frameworks and existing GPTs until they are retired.
Can the OpenAI API call PCBEditor directly?
Yes. The Responses API accepts a remote MCP server as a tool: pass the server URL and your token in the authorization field, and the model can call design_board, get_job and the other tools in one request.

The server needs a free PCBEditor account. Clients that support MCP sign-in open a consent page in your browser; for the rest, create a personal access token.

Related