Connect Codex
Connect Codex to CodeBook over MCP, sign in with Bookbag, and check that your chat has loaded the tools. Understand local work and the current proof limitations.
Connect Codex to https://app.codebook.work/mcp to reach the factories your Bookbag account can use. There are three separate steps: save the server configuration, sign in with Bookbag, and load the tools into your chat. Seeing a configured server does not prove the other two steps succeeded.
This guide is for Codex's local clients. For the ChatGPT website use Connect ChatGPT; for the CodeBook plugin in Claude Code use Connect Claude.
Add the MCP server
Open a terminal where the Codex CLI is installed. Run this at the shell prompt, not as a chat message:
codex mcp add codebook --url https://app.codebook.work/mcp
The name codebook identifies this connection in later commands. If it is already configured, check it with codex mcp list before adding another copy. If adding the server opens a sign-in page, follow the Bookbag steps below.
Alternatively, add this table to your existing ~/.codex/config.toml, preserving its other settings:
[mcp_servers.codebook]
url = "https://app.codebook.work/mcp"
Use either the CLI or the TOML edit to create the entry. Codex also supports a project-scoped .codex/config.toml in trusted projects. Check which profile and project your client is using if the setting appears in one place but not another. OpenAI's MCP configuration guide · Configuration locations and precedence
Sign in with Bookbag
Open CodeBook once with the Bookbag account you want to connect. If server setup did not already complete sign-in, run:
codex mcp login codebook
Finish the Bookbag sign-in in the browser. Review the consent screen: read access shows factories, run access operates work, and manage access changes agents and stations where your account permits it. Allow only the access you intend to give. The connector still obeys your organization and workspace roles; it does not grant access to another person's factories.
CodeBook uses OAuth. You do not need to paste a Bookbag password, API token or client secret into a chat or configuration example.
For a terminal without a local browser, use:
codex mcp login codebook --no-browser
Follow the terminal's instructions privately. Open the authorization URL in a browser and return the full callback URL to the waiting terminal, even if the callback page cannot load. Keep both URLs out of chats, screenshots and shared logs. OpenAI's OAuth login instructions
Load and verify the tools
First check the saved server entry:
codex mcp list
This lists configuration; it is not a successful tool call. Open a fresh Codex chat and ask:
Use CodeBook's list_factories tool to tell me which factories I can see. Read only; do not start or change any work.
The answer should come from the connected tool. Compare the factory names with the same Bookbag account in CodeBook. An authorized empty list means there are no visible factories; it is different from a missing tool or a sign-in error. Listing factories does not start a station or a cloud work order.
If the server and sign-in are saved but the desktop chat cannot find CodeBook tools, quit and reopen the desktop app, then start a fresh chat. This reloads the client session; it does not grant permissions or replace OAuth sign-in.
| What you see | What to check |
|---|---|
No codebook entry in codex mcp list |
Add the server in the profile or trusted project used by this client. |
| A sign-in or authorization error | Run codex mcp login codebook and review Bookbag consent. Check that you used the intended account. |
| The entry exists, but the chat has no CodeBook tools | Restart the desktop app and use a fresh chat. Check whether your workspace's policy disables the server or tools. |
| Tools load, but a particular action is refused | Read the refusal. The action may need a different consent scope or organization role; reconnecting alone does not change your role. |
Connect this Mac to a factory
On the Mac that will host the worker, open Codex with your ChatGPT subscription and the signed-in CodeBook MCP connection. In CodeBook, open the factory’s Factory settings → Models → Execution source → Connect Codex. Choose Open in Codex, review the prefilled request, and send it. You can also choose Copy request and paste it into a local Codex chat.
The request identifies your factory. Ask Codex to confirm the workflow and start the local supervisor in observation mode. For example, “Connect this Mac to the Payments factory, workflow wf12. Start the observer and report when the connection is online.” Use your own factory and workflow in place of the example. A new observer connects without --manage-ready. Use that flag when you want it to take eligible station assignments. An existing supervisor can retain an earlier management choice across restarts. Codex supervisor setup and operating modes
Back in CodeBook, refresh and look for Online on this Mac’s Codex row. Select the connection and choose Save if you want to use it. In use confirms the source for the factory. Choose an execution source
Local work and proof
With local workspace tools and the appropriate permissions, Codex can read a checkout, edit files and run commands while coordinating a CodeBook story through MCP. Follow the story's station instructions, repository access and claim lease. Run your factory from the chat
Adding this MCP server does not install the Claude Code plugin. Its /factory commands, Factory pane, automatic repository guard, conversation capture and native proof hooks are Claude Code features. There is no Codex version of that plugin installed by these steps. Claude plugin setup
For a story with a linked pull request, the required proof must cover its current head commit. Commands you run yourself are recorded as reported evidence. Local checkouts and proof
For a verification-only story, you can prove an existing default-branch commit without opening a pull request. Signed-in Codex requests the approved command and reads its result. The registered Linux executor checks out the pinned commit, runs the command and returns the receipt. The signed-in factory connection authorizes the check. Follow the steps to enroll the runner, retry a waiting request, and inspect the approved ref, SHA, actual OS and executor receipt. Verify a story without a pull request on a Linux runner
Disconnect
To sign this connection out, run codex mcp logout codebook. To remove its saved server entry, run codex mcp remove codebook. Closing Codex or removing a connection does not cancel work already running in CodeBook; inspect that work in the factory before deciding whether to stop it.