Codex MCP Server

[![npm version](https://img.shields.io/npm/v/%40agentclientprotocol%2Fcodex-acp)](https://www.npmjs.com/package/@agentclientprotocol/codex-acp)

Local serverstdio

What is the Codex MCP server?

Codex MCP server exists for a simple reason — assistants are far more useful when they can act on Codex directly instead of describing what you should do. .

What you get

codex-acp is a stdio ACP agent server. It starts the Codex App Server, translates ACP requests into Codex operations, and maps Codex events back into the client.

  • ChatGPT, API key, and client-provided custom gateway authentication
  • Model, reasoning effort, fast mode, approval, and sandbox mode configuration
  • Text prompts, embedded context, images, resource links, and additional workspace directories
  • Shell command, file change, permission request, MCP tool call, terminal output, reasoning, plan, web search, image generation, image view, token usage, and review events
  • Subagent launches as standard ACP tool calls, with Codex thread identity and activity details in namespaced _meta.codex.subagent metadata
  • Client-provided MCP servers over command-based stdio config and HTTP transport

Setting it up

The server ships on npm as @agentclientprotocol/codex-acp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What the assistant can call

Once Codex is connected, these are the calls the assistant has available:

  • Client — provided MCP servers over command-based stdio config and HTTP transport
  • CODEX_API_KEY — API key used when the API-key auth method is selected. Takes precedence over OPENAI_API_KEY
  • OPENAI_API_KEY — fallback API key used when the API-key auth method is selected
  • CODEX_PATH — run a specific Codex executable instead of the bundled package dependency
  • CODEX_CONFIG — JSON object merged into the Codex session config
  • MODEL_PROVIDER — model provider to pass to Codex for new sessions
  • DEFAULT_AUTH_REQUEST — ACP auth request JSON used when Codex requires authentication
  • INITIAL_AGENT_MODE — initial mode id: read-only, agent, or agent-full-access
  • NO_BROWSER — hide browser-based ChatGPT auth when set
  • APP_SERVER_LOGS — directory for adapter logs

Configuration and credentials

You will need 3 environment variables: CODEX_PATH, CODEX_API_KEY, OPENAI_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 10 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Codex.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the codex mcp server does with a few real requests.

Choosing this one

This sits in the browser automation group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Codex's toolset — Client, CODEX_API_KEY, OPENAI_API_KEY and 7 more — is a fair guide to whether it matches your workflow. It is maintained by GitHub Actions; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Codex's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
Clientprovided MCP servers over command-based stdio config and HTTP transport.
CODEX_API_KEYAPI key used when the API-key auth method is selected. Takes precedence over OPENAI_API_KEY.
OPENAI_API_KEYfallback API key used when the API-key auth method is selected.
CODEX_PATHrun a specific Codex executable instead of the bundled package dependency.
CODEX_CONFIGJSON object merged into the Codex session config.
MODEL_PROVIDERmodel provider to pass to Codex for new sessions.
DEFAULT_AUTH_REQUESTACP auth request JSON used when Codex requires authentication.
INITIAL_AGENT_MODEinitial mode id: read-only, agent, or agent-full-access.
NO_BROWSERhide browser-based ChatGPT auth when set.
APP_SERVER_LOGSdirectory for adapter logs.

How to install the Codex MCP server

{
  "mcpServers": {
    "codex": {
      "command": "npx",
      "args": ["-y", "@agentclientprotocol/codex-acp"],
      "env": {
        "CODEX_PATH": "your-value",
        "CODEX_API_KEY": "your-value",
        "OPENAI_API_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
CODEX_PATHFilesystem location the server is allowed to use.Optional
CODEX_API_KEYCredential the server authenticates with.Yes
OPENAI_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Codex to Client.
  • Use Codex to CODEX API KEY.
  • Use Codex to OPENAI API KEY.

Frequently asked questions

It connects Codex to MCP-compatible AI assistants such as Claude and Cursor, exposing 10 tools (Client, CODEX_API_KEY, OPENAI_API_KEY, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Codex directly.