Who is this for?
Codex users who want local tools, GitHub context, docs, browser automation, or developer workflows.
Config path and example
~/.codex/config.toml or .codex/config.toml
[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]Installation steps
Pick a Codex-compatible MCP server
Prefer MCP servers with clear install commands, low risk, and recent maintenance.
Use Codex CLI or config.toml
For STDIO servers, use codex mcp add or paste a TOML block into the Codex config file.
codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ./Paste TOML config
Add a table under mcp_servers. For project-only config, use .codex/config.toml inside your repo.
[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]Restart Codex
Restart the Codex CLI session or IDE extension so MCP servers reload.
Confirm tools appear
If the server does not appear, check command availability, working directory, and TOML syntax.
Common setup issues
TOML syntax issue
Use quoted table names and array args. The config generator can produce the correct shape.
Command not found
Run the command in a terminal first to confirm npx, uvx, docker, or python is available.
Project vs global config
Use ~/.codex/config.toml globally or .codex/config.toml for a single project.
FAQ
Does Codex use JSON MCP config?
Codex uses TOML config, usually ~/.codex/config.toml or project-level .codex/config.toml.
Can Codex use remote MCP?
Codex can use Streamable HTTP MCP when the server provides a remote endpoint.