How to Add an MCP Server to Cursor

Updated November 5, 2026

Short answer: Add the server to an mcp.json file under mcpServers. Use .cursor/mcp.json in your project for one project, or ~/.cursor/mcp.json in your home folder to make it available everywhere.

Add a remote server

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

If the server uses an API key, add a headers object next to url:

{
  "mcpServers": {
    "my-server": {
      "url": "https://api.example.com/mcp",
      "headers": { "API_KEY": "value" }
    }
  }
}

Add a local server

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

Add an env object if the server needs a key. Keep secrets out of any file you commit to git.

How does sign-in work?

For servers that use OAuth, Cursor reads the server's details and takes you through a browser sign-in, then renews the token for you. If your provider needs a fixed client ID, add an auth object to the server entry. See Cursor's MCP docs.

Which file should I use?

Good servers to start with

See our picks for coding and browser automation. Every listing includes its own config snippet.

Frequently asked questions

Where is the Cursor MCP config file?

At .cursor/mcp.json in your project, or ~/.cursor/mcp.json in your home folder for all projects.

Can I use the same config in Cursor and Claude?

Mostly. Both use an mcpServers object, though remote entries in Claude Code also need a type field. VS Code uses a different key, servers.

More guides