Based on Anysphere’s official docs, checked

How to add an MCP server to Cursor

Cursor supports stdio, SSE and Streamable HTTP MCP servers. Install official ones from the Cursor Marketplace, or configure any server in mcp.json.

  1. 1. One-click install

    Open Customize, browse the Cursor Marketplace and click Add to Cursor. Remote servers then ask you to authenticate with OAuth.

  2. 2. Add a local (stdio) server

    Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project) with an mcpServers entry.

    {
      "mcpServers": {
        "server-name": {
          "command": "npx",
          "args": ["-y", "mcp-server"],
          "env": { "API_KEY": "${env:API_KEY}" }
        }
      }
    }
  3. 3. Add a remote server

    Use a url instead of a command. Add headers for token auth, or an auth block for providers that need a fixed OAuth client.

    {
      "mcpServers": {
        "remote-server": {
          "url": "https://api.example.com/mcp",
          "headers": { "Authorization": "Bearer ${env:MY_SERVICE_TOKEN}" }
        }
      }
    }
  4. 4. Enable and use it

    Toggle the server in Customize. Agent uses MCP tools when relevant and asks for approval before running them by default.

  5. 5. Debug

    Open the Output panel (Cmd+Shift+U) and choose MCP Logs to see connection, auth and crash errors.

Tips

Next steps

Sources