CDX-101 · Module 3

MCPs & External Tools

3 min read

Model Context Protocol (MCP) servers extend Codex with external tool access — connecting to services like GitHub, Asana, Figma, databases, and custom APIs. MCPs are configured in your config.toml and loaded when Codex starts. Each MCP server exposes a set of tools that Codex can call during a session.

MCP is an open protocol, and the same MCP servers work across multiple AI tools — the same Figma MCP that works in Claude Code also works in Codex. This is by design: MCP standardizes tool integration so you are not locked into any single AI provider.

# Configure MCP servers
[mcp.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_TOKEN = "ghp_..." }

[mcp.postgres]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres"]
env = { DATABASE_URL = "postgresql://..." }
# List installed MCP servers
codex mcp list

# Add an MCP server
codex mcp add github npx -y @modelcontextprotocol/server-github

# Remove an MCP server
codex mcp remove github

# Run Codex itself as an MCP server (for integration with other tools)
codex --mcp-server

The MCP model is identical to Claude Code's approach — both tools use the same protocol, the same server implementations, and the same config patterns. If you have MCP servers configured for Claude Code, you can often reuse them directly with Codex by copying the relevant config sections. The context bloat problem is also shared: be equally selective about MCPs in both tools.