Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I moved my MCP servers from Claude to Codex. Here's the cheat sheet

说明与用途

将 MCP 服务器配置从 Claude 的 JSON 迁移到 Codex 的 TOML,保持功能并安全处理令牌。

问题

Migrating MCP server configurations from Claude’s JSON format to Codex’s TOML format while preserving functionality and security.

结果

All MCP servers function identically after migration, with tokens securely referenced via environment variables and no need to modify server commands.

工作流

  • 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, map command and args directly, transform env to an inline table, use url for remote servers, add http_headers for headers, and reference bearer_token_env_var for tokens.
  • Save the resulting TOML to ~/.codex/config.toml or within a trusted project’s .codex/config.toml.
  • Verify by running codex mcp list or 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.

证据

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

来源

  • 记录日期: 2026-11-02T23:14:09.964Z