What are MCP servers for Codex?

Updated October 2026 · How we answer

Short answerMCP servers for Codex are set up in Codex's configuration, where you add each server with its launch command or URL. Once connected, Codex can list and use the server's tools during a task.

Configure the server

Codex reads MCP server entries from its configuration file. Each entry names the server, gives a command to run or a URL, and can include environment variables for keys. Restart Codex after changes so it picks up the new server.

Use clear names so tools are easy to recognize during a task. Many servers add several tools, so note what each one does. A short description in your notes helps when you come back to the setup months later.

  • Edit the Codex config file
  • Add a name and a command or URL
  • Set environment variables for keys
  • Restart Codex after changes

Test the connection

Ask Codex to list the tools it can see from that server. If nothing appears, check that the command runs on its own in your terminal. A command that fails outside Codex will also fail inside it.

Keep a backup of the config file before large edits so you can roll back quickly if a change breaks other servers.

  • Ask Codex to list available tools
  • Run the server command in a terminal
  • Check paths and environment variables
  • Back up the config before big edits

Common mistakes

  • Putting API keys in plain text inside a shared config file.
  • Forgetting to restart the client after editing its config.
  • Adding many servers and then wondering why the model picks the wrong tool.
From our shopsCASEONYX: Dark-luxe tough phone cases.