>_cca

Sharing MCP servers across Claude Code, Codex and Cursor

Register each server in each agent separately, because each one reads its own file. Claude Code keeps team servers in .mcp.json at the repository root, Cursor uses .cursor/mcp.json in your project, and Codex uses ~/.codex/config.toml or a project .codex/config.toml. Then confirm the load with /mcp in Claude Code, agent mcp list in Cursor and /mcp in the Codex TUI.

Reviewed November 2026

Where does Claude Code keep MCP servers?

Claude Code splits servers by who should see them. Team servers go in .mcp.json, a project-only file you commit, and personal servers live in ~/.claude.json with your account details.

To add a remote server from the shell, the docs show claude mcp add --transport http followed by a name and URL, as in the Notion example claude mcp add --transport http notion https://mcp.notion.com/mcp. If you already have a JSON entry, claude mcp add-json accepts it directly, and --scope user adds the server to your user configuration instead of the project one.

In Claude Code, a JSON entry that has a url also needs a type. Claude Code reads an entry with no type as stdio, so a url without a type is a configuration error and the server is skipped. The type field accepts streamable-http as an alias for http.

Shared files carry an approval step. Project-scoped servers in .mcp.json require a one-time approval, and a teammate who dismissed the prompt keeps the server disabled until they run claude mcp reset-project-choices and restart Claude Code.

Where does Cursor keep MCP servers?

Cursor reads two files. .cursor/mcp.json in the project holds project-specific tools, and ~/.cursor/mcp.json in your home directory holds tools available everywhere.

For a stdio server, Cursor's field table marks type and command as required, with args, env and envFile optional. Cursor's remote example sets url and headers under a top-level mcpServers key and has no type line.

Cursor resolves variables in command, args, env, url and headers. The variable ${workspaceFolder} stands for the folder that contains .cursor/mcp.json, which lets an entry point at a script inside the repository without an absolute path.

The Cursor CLI reads the editor's files. Its docs say MCP servers you've configured will work with both.

Where does Codex keep MCP servers?

Codex uses TOML. Each server gets an mcp_servers table named [mcp_servers.<server-name>] in ~/.codex/config.toml or a project .codex/config.toml. A stdio table needs command, the command that starts the server, and a Streamable HTTP table needs url, the server address.

From the shell, the docs show codex mcp add context7 followed by -- npx -y @upstash/context7-mcp for a stdio server. In the ChatGPT desktop app, open Settings, then MCP servers, select Add server, pick STDIO or Streamable HTTP and give the command or URL.

A project file only counts in a trusted project. For security, Codex loads project .codex/ layers only when you trust the project. One registration does reach every Codex client, since the desktop app, CLI and IDE extension share this configuration.

Which transports work in all three agents?

Stdio and Streamable HTTP are the two that all three agents document. Codex lists STDIO servers that run as a local process and Streamable HTTP servers you access at an address. Cursor's agent mcp list shows a transport method of stdio, HTTP or SSE. Claude Code's docs show a stdio server added from JSON and call HTTP the recommended option for remote servers.

Avoid SSE for new shared entries. Claude Code says the SSE transport is deprecated and recommends HTTP servers instead, where available.

Secrets for remote servers also differ by agent. In Cursor, remote servers do not support envFile, and the docs point you to config interpolation with environment variables instead. Codex takes bearer_token_env_var, an environment variable name for the bearer token.

How do I check that a server loaded?

Check inside each agent, because a file on disk does not prove a connection.

  1. In Claude Code, run /mcp to see your servers and their connection status.
  2. In Cursor, run agent mcp list. Each row shows connection status and configuration source, project or global.
  3. In Codex, run codex mcp list from the shell, or type /mcp in the TUI. The desktop app's list also shows which servers require OAuth.

When Claude Code shows a server as failed, look at paths first. Relative file paths in command or args resolve against the directory you launched from, not the location of .mcp.json. A server that connects with zero tools can be traced with claude --debug=mcp and the debug log under ~/.claude/debug/.

How do I keep the three lists in step?

Pick one file as the master and generate the other two from it. The two JSON files are close enough for a short script, provided it writes an explicit type on every entry. The Codex copy has to be written out as TOML tables. Record in the contributing notes which file is the master so nobody edits a generated copy by hand.

Keep absolute paths and raw secrets out of the master. Claude Code's docs have a section on environment variable expansion in .mcp.json, and Codex stdio servers take env_vars, a list of environment variables to allow and forward.

To pause a server without breaking the sync, disable it rather than delete it. In Codex, set enabled to false on the table. In Cursor, agent mcp enable adds the server to the local approved list, and servers disabled with agent mcp disable won't load or prompt for approval. After each change, rerun the three checks above.

For sharing instructions as well as tools between these agents, see running Claude Code and Codex together and running Cursor and Claude Code together.

What else do readers ask?

Can one Claude Code subagent get a server the main session lacks?

Yes. The mcpServers field in a subagent's definition grants servers that aren't available in the main conversation. Defining the server inline there also keeps its tool descriptions out of the main context.

Can the Cursor CLI skip MCP approval prompts in scripts?

Its docs show agent --approve-mcps to auto-approve all servers. Servers come from the files the editor already reads.

Why does a server work for me but not in a fresh clone?

Approval and trust are per tool. Claude Code needs a one-time approval for .mcp.json servers, and Codex skips project-scoped .codex/ layers for a project marked untrusted. For unattended runs, see headless coding agents.

Which related guides should you read?

Sources (reviewed Nov 2026)