Connect Claude Code
Connect Claude Code to Codex and ask it to read the outline of Salt and Signal. You need a signed-in Codex, and Claude Code installed on the machine where you work. For other clients and the full list of options, see Connect an agent.
Address: https://<your-codex>/account, in the Agent access section. The MCP server is at https://<your-codex>/mcp. On the quick start, that is http://localhost:8080/mcp.


Create a token
Section titled “Create a token”The agent signs in with a personal access token. Codex shows the token once.
- Open your account and find Agent access.
- In Name, enter
Claude Code on my laptop. The name shows in the token list. - Read your books stays ticked, and you cannot clear it. Reading the outline needs nothing else. Tick Edit outlines, prose and the Knowledge base only when you want the agent to change the book.
- Leave Expires after at 90 days, or choose another.
- Select Create token.


Codex then shows the token, which starts with cdx_pat_, with Copy and Done buttons. Below them is a ready claude mcp add command with your address and token filled in. The Copy button copies only the token, so select the whole command and copy it by hand, then select Done. Codex keeps only a hash, so nobody can show the token again. If you lose it, revoke it and create another.


Add the server
Section titled “Add the server”Paste the command into a terminal in the folder where you run Claude Code. It looks like this, with your own address and token.
claude mcp add --transport http codex https://<your-codex>/mcp \ --header "Authorization: Bearer cdx_pat_<your token>"The command stores the server for the current project only, which is Claude Code’s default scope. Add --scope user to use Codex from every project. Do not use --scope project with a real token, because it writes the token into .mcp.json, which you may commit.
Claude Code saves the configuration without checking the token. To check it, run:
claude mcp listThe codex server shows ✔ Connected. Inside a Claude Code session, /mcp shows the same status.
Ask for the outline
Section titled “Ask for the outline”Start Claude Code and ask:
Show me the outline of Salt and Signal.The agent calls get_outline with the book’s title, or calls list_books first to find the book. get_outline returns the acts, chapters and scenes in book order, with display numbers, titles, labels, status and word counts. In the running example, it answers with the three acts The Light, The Keepers and The Last Watch, and the chapters and scenes under them.
Compare the answer with the book. The Library is the list list_books reads, and the Plan is the outline get_outline reads.




The token acts as you, with only the access you give it. It reaches your books and the books shared with you, at your role on each one, and its ticked boxes limit what it can do there. The tool reference lists every tool, and Example prompts has more to ask.
If the connection fails
Section titled “If the connection fails”If the token is unknown, revoked, expired or missing, or its user is disabled, Codex answers HTTP 401 with this message:
Send a Codex personal access token: Authorization: Bearer cdx_pat_…. Create one under Account → Agent access.Claude Code does not offer to sign in, because you set the Authorization header yourself. claude mcp list shows ✘ Failed to connect, and /mcp shows the HTTP status, such as 401, in the failure detail. Check these in order.
- The token is the one Codex showed, with all of its characters, and the header reads
Authorization: Bearer cdx_pat_.... - The token is still in the list under Agent access and has not expired. If not, create a new one.
- The address ends in
/mcpand points at your Codex.
To replace the token, run claude mcp remove codex, then add the server again with the new one. A tool call that fails with forbidden is a different problem. The token lacks a scope, or your role on the book is too low. Tokens and scopes covers both.