Guides › Cursor

How to add MCP servers to Cursor (mcp.json)

Cursor reads MCP servers from an mcp.json file. You can also install servers from the Cursor Marketplace on the Customize page.

Checked against the official docs on 2026-11-26. Apps change often; the sources are linked at the bottom.

Where the config file lives

Global, all projects (macOS, Linux; on Windows in your user folder)~/.cursor/mcp.json
One project.cursor/mcp.json in the project root
Top-level keymcpServers

Add a local server (runs on your computer)

  1. Add a command-based (stdio) server
    Give the command, its arguments and any environment variables. Use ${env:NAME} to read a secret from your environment instead of pasting it.
    {
      "mcpServers": {
        "github": {
          "command": "docker",
          "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
          "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${env:GITHUB_TOKEN}" }
        }
      }
    }
  2. Turn it on
    Open Customize in the sidebar, find the server under MCP and make sure its toggle is on.

Add a remote server (a URL)

  1. Add the server URL
    Remote servers just need a url. Add headers only if the service uses an API key.
    {
      "mcpServers": {
        "linear": { "url": "https://mcp.linear.app/mcp" },
        "remote-with-key": {
          "url": "https://api.example.com/mcp",
          "headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" }
        }
      }
    }
  2. Sign in
    For OAuth servers, Cursor runs the sign-in for you (authorization code flow with PKCE) and finishes it in your browser. Servers installed with Add to Cursor from the Marketplace sign in with OAuth as part of the install.

Tips

  • Logs: open the Output panel (Cmd/Ctrl+Shift+U) and pick MCP Logs.
  • Updating an npm-based server: remove it in Customize, run npm cache clean --force, then add it again.
  • Cursor supports stdio, SSE and Streamable HTTP servers.
  • The global ~/.cursor/mcp.json applies in the editor and the Cursor CLI. Hosted Cloud Agents don't read it: they use the servers set up at cursor.com/agents and your team's servers, and keep their own sign-ins (to sign out there, use the server's Cloud row in Customize).

Common problems in Cursor

Sources

Weekly MCP digest
New servers, breaking changes, and fresh fixes. One email a week.