How to add MCP to Codex: start with a documentation server
Understand local and remote MCP connections in Codex. Add the official read-only OpenAI documentation service, check its configuration and verify an actual call.
Start with a working Codex CLI
Install and sign in to Codex CLI using its official guide. CLI means the command-line tool run in a terminal; this guide uses it to configure MCP. Start with available Codex access rather than purchasing a new plugin service.
MCP supplies external tools and information. Adding a server does not retrain the model or automatically grant every permission.
Choose a local command or a remote address
A local STDIO server starts through a command; check its runtime and arguments. A remote Streamable HTTP server uses an address and may require authorization.
The default configuration is ~/.codex/config.toml; trusted projects can use .codex/config.toml. Clients on the same Codex host share configuration. Another device or cloud environment still needs its own connectivity checks.
Try the official read-only documentation example
OpenAI’s public documentation MCP reads developer documentation; it does not call the OpenAI API for you. These are official setup examples, not commands executed by this website.
- In a terminal with Codex CLI installed, run: codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp
- Run: codex mcp list. Check for openaiDeveloperDocs.
- Use /mcp in the Codex terminal interface to inspect the active connection, then ask a documentation question with sources.
Saved configuration is not a successful connection
A listed entry confirms configuration, not a working call. Check startup, authorization and an actual result. For an OAuth server, follow the provider’s requirements and codex mcp login server-name; not every server needs login.
- For a local failure, check the runtime, executable and arguments.
- For a remote failure, check the address, network and required authorization.
- After changes, restart or reconnect as your client instructs and verify a call.
Add tools for a specific task
Choose a service for the task, read its source, permissions and setup, then try a checkable request. Keep credentials in appropriate local configuration, outside public repositories.
Sources checked on 2026-10-12. Installation, login and connectivity were not tested here. Follow current client and server guidance.