How to add an MCP server to Codex

Codex reads its MCP servers from ~/.codex/config.toml and connects to them over stdio (a local process) and Streamable HTTP. 119,278 of the 123,036 servers we can write a config for work in it.

A local server

A local server runs on your machine, started by Codex from its package. It needs Node.js installed first. For example, Azure MCP Server goes in a terminal:

codex mcp add azure -- npx -y @azure/[email protected] server start

Every step for this server in Codex

A remote server

A remote server runs on its publisher's machines, and Codex connects to its address. Nothing needs installing. For example, Context7 goes in a terminal:

codex mcp add context7 --url https://mcp.context7.com/mcp

Every step for this server in Codex

Which servers work in Codex

Codex can send a key in a header, so the 3,251 servers that need one work in it.

RunsServersIn Codex?
Local (stdio)85,194Works
Remote, Streamable HTTP30,880Works
Remote, Streamable HTTP, key in a header3,204Works
Remote, HTTP+SSE3,711No
Remote, HTTP+SSE, key in a header47No

If the server does not show up

Matches the official docs The configs follow Codex's MCP docs, read on 2026-10-31.

Codex on plug.directory · Best MCP servers for Codex