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.
[mcp_servers.pcbeditor]
url = "https://api.robodib.com/mcp"
bearer_token_env_var = "PCBEDITOR_TOKEN"export PCBEDITOR_TOKEN="pcbe_..."
codexWith OAuth sign-in
Add the server without a token, then sign in once:
codex mcp add pcbeditor --url https://api.robodib.com/mcp
codex mcp login pcbeditorThe 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.
tool_timeout_sec = 120.ChatGPT
ChatGPT connects to remote MCP servers over Streamable HTTP and signs in with OAuth.
- Go to chatgpt.com/plugins.
- Click +, then Add custom MCP server.
- Enter a name (PCBEditor) and a short description.
- Under Connection, choose Public endpoint and enter
https://api.robodib.com/mcp. - Choose OAuth for authentication, read the risk notice and select I understand and want to continue.
- Select Create as a plugin, review the 16 tools ChatGPT found, then sign in to PCBEditor.
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.
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:
https://api.robodib.com/agent-api/openapi.json- In the GPT editor, open Configure and create a new action.
- Paste the spec from the URL above into the schema box.
- 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.