I moved my MCP servers from Claude to Codex. Here's the cheat sheet
Description and use
Migrating MCP server configurations from Claude’s JSON to Codex’s TOML while preserving functionality and secure token handling.
Problem
Migrating MCP server configurations from Claude’s JSON format to Codex’s TOML format while preserving functionality and security.
Outcome
All MCP servers function identically after migration, with tokens securely referenced via environment variables and no need to modify server commands.
Workflow
- Identify the JSON config file location (macOS:
~/Library/Application Support/Claude/claude_desktop_config.json; Windows:%APPDATA%\Claude\claude_desktop_config.json). - Export or copy the JSON content.
- Convert each server entry: create a
[mcp_servers.NAME]table, mapcommandandargsdirectly, transformenvto an inline table, useurlfor remote servers, addhttp_headersfor headers, and referencebearer_token_env_varfor tokens. - Save the resulting TOML to
~/.codex/config.tomlor within a trusted project’s.codex/config.toml. - Verify by running
codex mcp listor using the IDE extension. - Optionally use the CLI shortcut:
codex mcp add context7 -- npx -y @upstash/context7-mcp. - For bulk conversion, use the browser-based MCP config converter at https://pickaplugin.com/tools/mcp-config-converter.
Evidence
Claude Desktop and Cursor keep MCP servers in JSON. Codex keeps them in TOML, in ~/.codex/config.toml (or .codex/config.toml inside a trusted project).
Each server becomes its own [mcp_servers.NAME] table. The CLI and the IDE extension both read the same file.
env becomes an inline table. So "env": {"API_KEY": "..."} turns into env = { API_KEY = "..." }.
Remote servers use url. Put any headers in http_headers.
Keep tokens out of the file. For remote servers, bearer_token_env_var points Codex at an environment variable instead of pasting the token into config.toml.
Or skip the file and use the CLI codex mcp add context7 -- npx -y @upstash/context7-mcp codex mcp list
- Record date: 2026-11-02T23:14:09.964Z