MCP install guide

Codex MCP config.toml example

Copy a Codex MCP TOML example and generate Codex CLI commands from MCP install commands.

Who is this for?

Codex users who need the correct TOML format for STDIO MCP servers.

Config path and example

~/.codex/config.toml

[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]

Installation steps

1

Create an mcp_servers table

Each MCP server gets its own TOML table under mcp_servers.

[mcp_servers."filesystem"]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "./"]
2

Use command and args

STDIO MCP servers need a command plus args array.

3

Alternatively use Codex CLI

You can add a server with codex mcp add.

codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ./
4

Restart Codex

Reload the CLI or IDE session after changing config.toml.

Common setup issues

Unquoted server name

If the server name contains special characters, quote it in the TOML table.

Args not an array

Codex expects args as a TOML array, for example ["-y", "package"].

FAQ

Where do I put Codex MCP config?

Use ~/.codex/config.toml globally, or .codex/config.toml in a project.

Can I generate TOML automatically?

Yes. Use the MCP config generator and choose Codex.