Nice To E-Meet You!



    What marketing services do you need for your project?

    How To Install MCP Servers In Claude Code, Cursor And Codex

    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.

    Before You Start

    There are two kinds of MCP server, and each tool handles them slightly differently:

    • Remote servers run as a web service and are reached by URL over HTTP. Many SaaS vendors publish these, and most use OAuth so you sign in with your own account.
    • Local servers run on your machine as a process, usually started with a command such as 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.

    How To Install MCP Servers In Claude Code

    Claude Code manages servers with the claude mcp command.

    Add A Remote Server

    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.

    Add A Local Server

    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.

    Choose A Scope

    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.

    Manage Servers

    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.

    How To Install MCP Servers In Cursor

    Cursor reads MCP servers from a JSON file named mcp.json.

    Pick The File

    • Project servers go in .cursor/mcp.json in your project root. Commit this file to share servers with your team.
    • Global servers go in ~/.cursor/mcp.json in your home folder and apply to every project.

    If the same server is defined in both, the project file wins.

    Add A Local Server

    {
      "mcpServers": {
        "context7": {
          "command": "npx",
          "args": ["-y", "@upstash/context7-mcp"]
        }
      }
    }

    Add A Remote Server

    {
      "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.

    Check The Connection

    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.

    How To Install MCP Servers In OpenAI Codex

    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.

    Add A Local Server

    codex mcp add context7 -- npx -y @upstash/context7-mcp

    To pass a key, add --env NAME=value before the --.

    Add A Remote Server

    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.

    Edit The Config Directly

    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.

    Quick Reference

    TaskClaude CodeCursorCodex
    Add remote serverclaude mcp add –transport http name urlAdd a url entry in mcp.jsoncodex mcp add name –url url
    Add local serverclaude mcp add –transport stdio name — commandAdd a command entry in mcp.jsoncodex 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 loginHandled in Cursorcodex mcp login
    Check statusclaude mcp list or /mcpCursor Settings, MCPcodex mcp list or /mcp

    Keep MCP Servers Safe

    • Install from trusted publishers. Confirm the publisher in the official MCP Registry or a curated directory before adding a server.
    • Keep secrets out of shared files. Use environment variables and OAuth rather than committing tokens to .mcp.json, .cursor/mcp.json or config.toml.
    • Limit what tools can do. Disable tools you do not need and require approval for actions that write, delete or spend money.
    • Watch for prompt injection. Content from web pages, issues or documents can try to trick an agent into misusing a tool.
    • Run risky work in isolation. For agents that execute code, use one of the AI sandboxes for coding agents we compare.

    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.

    Troubleshooting

    The Server Does Not Show Up

    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.

    The Server Fails To Start

    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.

    Sign-In Keeps Failing

    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.

    Conclusion

    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.

      Once a week you will get the latest articles delivered right to your inbox