OpenAI API names and request fields can change after a model was trained. The OpenAI Docs MCP server lets Codex search and read current OpenAI documentation while answering a product or API question.

OpenAI provides this public Model Context Protocol connection for read-only documentation access. The server does not call the OpenAI API on your behalf or need an API key, and the CLI and IDE extension share its saved configuration when they use the same configuration environment.

A signed-in Codex CLI, an existing project, and outbound HTTPS access are required for a documentation query. Search terms and requested documentation URLs go to the remote service, so private code and secrets do not belong in a lookup.

Steps to add OpenAI Docs MCP server to Codex:

  1. Register the official documentation endpoint as openaiDeveloperDocs.

    The endpoint is public. API keys, bearer tokens, cookies, and other credentials do not belong in its URL or headers.

    $ codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp
    Added global MCP server 'openaiDeveloperDocs'.

    The server name and URL follow OpenAI's Docs MCP setup. Registration saves the connection in the user-level configuration, normally ~/.codex/config.toml or under a custom CODEX_HOME.

  2. Start a new Codex CLI session in your project.
    $ codex

    A fresh session loads the saved server configuration; an already-open session needs a restart to pick up the addition.

  3. Ask Codex a public documentation question using openaiDeveloperDocs.
    Use openaiDeveloperDocs: how do I view active MCP servers in Codex CLI? Include the source link.
  4. Confirm the answer shows a completed documentation tool call and a relevant source link.
    • Called openaiDeveloperDocs.search_openai_docs
    ##### snipped #####
    • Called openaiDeveloperDocs.fetch_openai_doc
    ##### snipped #####
    In the Codex CLI interactive session, type /mcp to view active MCP servers.
    ##### snipped #####
    Source: Official OpenAI documentation — MCP
    (https://developers.openai.com/codex/mcp#configure-with-the-cli).

    The tool-call names identify the documentation server used for the lookup. The answer's MCP documentation reference explains the /mcp command. A connection error, failed tool call, or answer without a relevant reference does not confirm that the lookup worked.

Share this guide