Codex with the Reachd MCP server reads a business’s AI visibility score, its place among competitors and the actions Reachd has open. Each action points to a page and says what that page lacks, which gives a Codex task in the site’s repository a concrete edit to make.
The Codex CLI, the IDE extension and the ChatGPT desktop app read one config file, so Reachd added once works in all three. Codex connects in two ways: OAuth with a Reachd login, which codex mcp add starts on its own, or a personal API key read from an environment variable.
Before you add the MCP server to Codex
- A Reachd account with at least one business. A free AI visibility check creates one in a few minutes.
- For the key route, an API key. In the Reachd app open Settings with the gear in the top bar, choose API & MCP and click Create key. Reachd shows the key once, so copy it before leaving the page.
Add Reachd to Codex with codex mcp add
codex mcp add reachd --url https://api.reachd.ai/mcp
Codex finds that Reachd supports OAuth, prints “Detected OAuth support. Starting OAuth flow…” and opens a browser tab on the Reachd sign-in. Sign in with the email used in the Reachd app and approve access on the consent screen. Codex keeps the token, and the agent reads every business that login can open in Reachd.
If the sign-in was closed halfway, run it again:
codex mcp login reachd
In a terminal without a local browser, codex mcp login reachd --no-browser prints the sign-in link instead of opening it.
Add Reachd to Codex with an API key
The key travels in the Authorization header with every request. Codex reads it from an environment variable, so the key stays out of the config file:
export REACHD_API_KEY="rk_your_key"
codex mcp add reachd --url https://api.reachd.ai/mcp --bearer-token-env-var REACHD_API_KEY
With a token variable set, Codex skips the OAuth sign-in. The variable has to exist wherever Codex starts, so put the export line in ~/.zshrc or ~/.bashrc. An app started from the Dock may not see variables from the shell profile. For that case the header can sit in config.toml itself, as shown below.
The key reads the Reachd workspace it was created in, with its creator’s access, and stops working if that person leaves the workspace. If it leaks, revoke it in Settings → API & MCP and set the variable to a new one.
The Reachd entry in Codex config.toml
codex mcp add writes a table to ~/.codex/config.toml. With the key route it reads:
[mcp_servers.reachd]
url = "https://api.reachd.ai/mcp"
bearer_token_env_var = "REACHD_API_KEY"
The same file takes a fixed header in place of the variable, which an app started outside a terminal always sees:
[mcp_servers.reachd]
url = "https://api.reachd.ai/mcp"
http_headers = { "Authorization" = "Bearer rk_your_key" }
Other fields a server table accepts:
| Field | What it does |
|---|---|
env_http_headers | Header names mapped to environment variables that hold their values |
enabled | false switches the server off without deleting it |
startup_timeout_sec | How long Codex waits for the server to start, 10 seconds by default |
tool_timeout_sec | How long one tool call may run, 60 seconds by default |
Add Reachd in the Codex app and IDE extension
Both read the same config.toml, so a server added from the terminal already shows up there. To add it from the interface instead:
- ChatGPT desktop app: open Settings, choose MCP servers and select Add server. Enter a name, choose Streamable HTTP and enter
https://api.reachd.ai/mcp. Save the server, then select Restart. - IDE extension: open the gear menu, choose MCP servers and add the same server. Save it, then select Restart extension.
In both, the server list shows which servers need OAuth, with Authenticate next to them.
Check that the Reachd MCP server works
codex mcp list
The reachd row should show enabled, with Bearer token or a logged-in state under Auth. Inside the codex interface, /mcp lists the active servers. Then ask:
How is the AI visibility of my business this week?
What insights has Reachd found to get my business recommended first by ChatGPT?
Codex finds the business with list_businesses, then answers the first question from get_visibility_status, which returns the score, the main competitors and how often each AI engine recommends the business. For the second it calls get_action_items and lists the insights Reachd has open, each with the page to change and what that page is missing. With several businesses in the account, the question should name one. Ask next:
- “Which competitors does AI recommend ahead of my business, and what does it quote about the leader?”
- “Take the Reachd action for the pricing page and make that change in this repository.”
Reachd reads a changed page on its next run and closes the action once the page carries the change. The Reachd MCP server page shows what else Codex can ask Reachd.
Codex MCP problems and what they mean
Auth shows Not logged in
The OAuth sign-in never finished. Run codex mcp login reachd and complete it in the browser.
Reachd refuses the key
Reachd answered 401. Check the variable in the same terminal with echo $REACHD_API_KEY: it has to hold the whole key, without Bearer, since Codex adds that word itself. The key must also be active in Settings → API & MCP.
The server works in the terminal and fails in the app
The app doesn’t see REACHD_API_KEY from the shell profile. Move the key into http_headers in config.toml.
Codex gives up while the server starts
The first connection took longer than startup_timeout_sec. Set it to 30 in the [mcp_servers.reachd] table and start Codex again.
Codex answers without calling Reachd
Name Reachd in the request, for example “using Reachd, list the open actions for my business”.
Frequently Asked Questions
Where does Codex store MCP server config?
In ~/.codex/config.toml, one [mcp_servers.<name>] table per server. The Codex CLI, the IDE extension and the ChatGPT desktop app share that file. A trusted project can add its own servers in .codex/config.toml.
How do I add a remote MCP server to Codex?
Run codex mcp add <name> --url <address>. For a server that supports OAuth, Codex starts the sign-in right away, and codex mcp login <name> runs it again later. A server that takes a token gets --bearer-token-env-var with the name of the environment variable that holds it.
How do I pass a bearer token to an MCP server in Codex?
Put the token in an environment variable and name that variable in bearer_token_env_var, or pass --bearer-token-env-var to codex mcp add. Codex then sends Authorization: Bearer with the variable's value and skips the OAuth sign-in. A fixed header can also go in http_headers.
Can Codex change my website based on Reachd data?
Yes, when Codex runs in the repository that holds the site. Each Reachd action names the page to change and what that page is missing, so Codex can open the file and make the edit. Reachd reads the page on its next run and closes the action once the page carries the change.