How to add an MCP server to Cursor

Last verified against the official documentation linked below.

Cursor can install MCP servers in one click from its Marketplace, or read them from an mcp.json file. That file can live in a project (for that project's tools) or in your home folder (for every project). This guide follows Cursor's own MCP documentation.

Steps

  1. Try the one-click route first

    Open Customize in the sidebar and browse the Cursor Marketplace. Click 'Add to Cursor' on an entry to install it and sign in with OAuth if asked.

    Source: cursor.com/docs/context/mcp

  2. Or choose where an mcp.json goes

    Create .cursor/mcp.json inside a project for project-specific tools, or ~/.cursor/mcp.json in your home folder for tools available everywhere.

    Source: cursor.com/docs/context/mcp

  3. Add a local (stdio) server

    Give the command that starts the server, its arguments and any environment variables. The command must be on your PATH or be a full path.

    {
      "mcpServers": {
        "server-name": {
          "command": "npx",
          "args": ["-y", "mcp-server"],
          "env": { "API_KEY": "${env:API_KEY}" }
        }
      }
    }

    Source: cursor.com/docs/context/mcp

  4. Or add a remote server

    For a server reached over HTTP, give its URL and any headers it needs. Cursor supports OAuth for servers that require it.

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

    Source: cursor.com/docs/context/mcp

  5. Keep secrets out of the file

    Use ${env:NAME} to pull keys from environment variables instead of typing them into mcp.json. Cursor also resolves ${userHome} and ${workspaceFolder}.

    Source: cursor.com/docs/context/mcp

  6. Switch servers on or off

    Open Customize in the sidebar and use the toggle next to a server. Disabled servers don't load or appear in chat.

    Source: cursor.com/docs/context/mcp

Check it worked

Safety notes

Related listings

More guides

Sources: cursor.com/docs/context/mcp. Menus and file paths change between versions: if a step doesn't match what you see, follow the official page linked for that step.