# Codex MCP setup: add a remote MCP server to the Codex CLI and IDE extension

By Steven Van · 2026-10-14

Unif API's guide covers codex mcp add, config.toml for remote and stdio servers, OAuth login and a troubleshooting table for the CLI and IDE extension.

Codex can now load a remote MCP server from a single command. [Unif API](<https://creatorstoolbox.com/resources/unif-api>) published a [setup guide](<https://unifapi.com/blog/codex-mcp-setup>) for adding its MCP server to the Codex CLI and the Codex IDE extension, using its own server at https://mcp.unifapi.com as the worked example. The steps apply to any remote server.

## Adding a remote server

Codex reads MCP servers from ~/.codex/config.toml, and the CLI edits that file. Running codex mcp add unifapi --url https://mcp.unifapi.com registers the server. codex mcp list shows each configured server with its transport and auth status, and codex mcp get unifapi shows a single entry. The IDE extension reads the same file, so a server added once is available in the terminal and in VS Code.

## OAuth sign-in

Codex opens the OAuth sign-in in the browser the first time a session starts with an OAuth-protected server. If that does not happen, codex mcp login unifapi starts it, and adding --no-browser prints the URL for machines without a browser. Login is only offered for streamable HTTP servers, and stdio servers have no sign-in step. The token is stored in the keyring, or in the credentials file Codex falls back to. codex mcp logout clears it and codex mcp remove deletes the server.

## The config.toml shape

- A remote server is a table under \[mcp\_servers.name\] with a url. The Unif API entry is that one line.

- Optional remote fields include bearer\_token\_env\_var for a static token, http\_headers for literal headers and env\_http\_headers for headers read from the environment.

- A local stdio server uses command and args (and optionally env) instead of url. The two shapes are exclusive, and a table that mixes them is rejected.

- A project-level .codex/config.toml in the repository root is merged over the home config when the project is trusted, so a server needed by one repo can be committed for teammates.

Unif API accepts bearer\_token\_env\_var with a workspace API key, but recommends OAuth, which leaves nothing to paste into a dotfile and gives a read-only token.

## Checking the tools load

The guide suggests asking Codex to use the unifapi server to list the operations available for Reddit, which should show a list\_operations tool call before the answer. In the IDE extension, servers and their tools appear in the settings panel, where a red status usually means a missing OAuth token or a wrong URL. Depending on the approval mode, Codex may ask before each tool call.

## Requirements and billing

The setup needs the Codex CLI (installed with npm or Homebrew) or the Codex extension in VS Code, Cursor or Windsurf, plus a signed-in Codex. MCP works with ChatGPT sign-in and with an API key. For Unif API, browsing the catalog is free. Calls to call\_api are billed per public-data record in workspace credits at $0.001 each, with one credit for most records and higher floors published in the catalog. A new workspace has no credits until its first top-up, which carries a one-time bonus. Model tokens stay on the user's OpenAI plan.

## Troubleshooting

The guide's table covers the common failures: tools missing after codex mcp list shows the server (start a new session, or reload the IDE window), an "OAuth login is only supported for streamable HTTP servers" error (the table uses command instead of url), a browser sign-in that never completes (use --no-browser), insufficient\_credits from call\_api (top up once in the console), a server missing in one repository (a project config is overriding the home config, and codex mcp get shows the source file) and refused tool calls (the approval mode is blocking them).

![Unif API](<https://creatorstoolbox.com/images/logos/unif-api-1ca5c665f23e89e0f50aae022ed0c0b6a8d768873cd543e49e57e58aad1d1f3f.png>)

Unif API

Prebuilt AI marketing agents for SEO, GEO, influencer research, social listening, and competitor analysis — run them inside Claude, ChatGPT, or Codex over one MCP server.

[View Unif API →](<https://creatorstoolbox.com/resources/unif-api>)

Sources

[Original source](<https://unifapi.com/blog/codex-mcp-setup>)

[Read Codex MCP setup: add a remote MCP server to the Codex CLI and IDE extension on Creators Toolbox](<https://creatorstoolbox.com/blog/unif-api-codex-mcp-setup-add-a-remote-mcp-server-to-the-codex-cli-and-ide>)

---
Canonical source: https://creatorstoolbox.com/blog/unif-api-codex-mcp-setup-add-a-remote-mcp-server-to-the-codex-cli-and-ide
