Claude Code, Cursor and OpenAI Codex all support the Model Context Protocol, so you can give each of them the same tools: your issue tracker, your docs, a database or a browser. The setup is quick once you know where each tool keeps its configuration. This guide shows how to add local and remote MCP servers in all three, how to share them with a team and how to keep them safe, using each vendor’s documentation as of November 2026.
If you are new to the protocol, read our explainer on what MCP is first. If you need servers to install, our list of the best MCP servers and our guide to MCP directories and registries are good places to start.
There are two kinds of MCP server, and each tool handles them slightly differently:
npx or uvx, and talk to the client over standard input and output (stdio).Check who publishes a server before you install it. Prefer official servers from the vendor that owns the system, and never paste production secrets into a shared config file.
Claude Code manages servers with the claude mcp command.
claude mcp add --transport http notion https://mcp.notion.com/mcp
If the server uses OAuth, start Claude Code, run /mcp and complete the sign-in in your browser. You can also run claude mcp login <name> from the shell. For servers that use a fixed token instead, pass it as a header with the --header option.
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server
Everything after -- is the command that starts the server. Put another option, such as --transport stdio, between --env and the server name so the name is not read as an environment variable.
Use --scope to decide where the server is saved:
local (the default) applies to the current project for you only.project writes a .mcp.json file at the project root that you can commit to git, so the whole team gets the server. Claude Code asks each person to approve project servers before using them.user makes the server available in all of your projects.Run claude mcp list to see servers and their health, claude mcp get <name> for details and claude mcp remove <name> to delete one. Inside a session, /mcp shows status and tool counts. Plugins can also bundle MCP servers, which install and uninstall with the plugin; see our list of Claude Code plugins and skills.
Cursor reads MCP servers from a JSON file named mcp.json.
.cursor/mcp.json in your project root. Commit this file to share servers with your team.~/.cursor/mcp.json in your home folder and apply to every project.If the same server is defined in both, the project file wins.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
{
"mcpServers": {
"linear": {
"url": "https://mcp.linear.app/mcp"
}
}
}
Cursor handles OAuth sign-in for remote servers. To keep keys out of the file, use Cursor’s environment variable interpolation, which reads values from your environment instead of storing them in mcp.json.
Open Cursor Settings and look at the MCP section to confirm the server is connected and its tools are enabled. You can also open the config file from there. If a server does not appear, check the JSON syntax and restart Cursor.
Codex stores MCP servers in config.toml, and the same file is shared by the Codex CLI, the IDE extension and the ChatGPT desktop app, so a server you add once appears everywhere.
codex mcp add context7 -- npx -y @upstash/context7-mcp
To pass a key, add --env NAME=value before the --.
codex mcp add linear --url https://mcp.linear.app/mcp
For servers that use OAuth, run codex mcp login <name> to sign in, and codex mcp logout <name> to remove the stored credentials.
codex mcp add writes to ~/.codex/config.toml. Each server gets its own table; note the snake_case key:
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
For servers that belong to one repository, create .codex/config.toml in the project. Codex only loads project config for projects you have marked as trusted. Use codex mcp list, codex mcp get <name> and codex mcp remove <name> to manage servers, and /mcp inside the terminal interface to see what is active.
| Task | Claude Code | Cursor | Codex |
| Add remote server | claude mcp add –transport http name url | Add a url entry in mcp.json | codex mcp add name –url url |
| Add local server | claude mcp add –transport stdio name — command | Add a command entry in mcp.json | codex mcp add name — command |
| Team-shared config | .mcp.json with project scope | .cursor/mcp.json | .codex/config.toml in trusted projects |
| Personal config | ~/.claude.json | ~/.cursor/mcp.json | ~/.codex/config.toml |
| OAuth sign-in | /mcp or claude mcp login | Handled in Cursor | codex mcp login |
| Check status | claude mcp list or /mcp | Cursor Settings, MCP | codex mcp list or /mcp |
.mcp.json, .cursor/mcp.json or config.toml.Our guide on how to secure AI agents and MCP integrations and our lists of MCP security tools and MCP gateways cover team-wide controls.
Check that the config file is in the right place and the syntax is valid, then restart the tool. In Claude Code, confirm the scope you used; in Codex, confirm the project is trusted if you used project config.
For local servers, run the start command on its own in a terminal to see the error. Missing runtimes such as Node.js or Python, and missing environment variables, are the usual causes.
Remove the server, add it again and repeat the OAuth flow. Make sure you are using the vendor’s current endpoint, since some older hosted addresses have been retired.
Adding MCP servers takes one command in Claude Code and Codex and one JSON entry in Cursor. Use project-level files to share approved servers with your team, personal files for your own tools, and OAuth or environment variables for credentials. Start with two or three official servers your team will use every day, check who publishes each one, and expand from there.