OpenAI's codex as an mcp server

I just found that out that OpenAI’s codex tool could operate as an MCP server. This means that you can make it available to any agentic coding tool. The MCP exposes two tools:

  • codex creates a codex session.
  • codex-reply pursues an existing codex session based on a unique session ID.

I managed to set it up quite easily in Claude Code. In the command-line, I ran:

claude mcp add codex --scope user -- codex -m gpt-5 mcp

The --scope argument ensures the change is reflected for a user’s entire config (i.e. in ~/claude.json rather than in a specific project environment). Then, I modified my ~/.claude/CLAUDE.md file and added:

  • “You can access OpenAI models via the codex mcp. By default, you have access to the gpt-5 model. When using it, pick the reasoning level that seems most adequate to the task at hand. You can input a file for context by using the @path/to/file syntax in your prompt.”

Now, I can just tell Claude “Ask GPT-5 for a code review of the script at @a_cool_script.py” or “Ask GPT-5 for an external perspective on which pre-processing techniques to apply to street pictures before calling text detection models”, and Claude just figures out that it can use its codex tool to do that.