---
title: "Cursor MCP config: file path, key, example · DotsAgent"
description: "Add MCP servers to Cursor from Anysphere: where the config file lives, the top-level key and format, remote OAuth support and a sample config."
url: https://dotsagent.io/mcp/clients/cursor
---

Anysphere

# Add MCP servers to Cursor

Cursor reads mcp.json from .cursor/ in your project, or from ~/.cursor/ for all projects.

- **macOS**: `~/.cursor/mcp.json`
- **Windows**: `~/.cursor/mcp.json`
- **Linux**: `~/.cursor/mcp.json`
- **Project file**: `.cursor/mcp.json`
- **Top-level key**: `mcpServers`
- **Format**: json
- **OAuth for remote servers**: 

## Example config

This example adds GitHub's hosted server and Playwright as a local server, in the shape this client expects.

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

## Notes and quirks

- Values can use ${env:NAME}, ${userHome} and ${workspaceFolder}.
- Remote entries take a url, optional headers, and an auth block with CLIENT_ID, CLIENT_SECRET and scopes for pre-registered OAuth apps.
- If a provider needs fixed redirect URLs, register https://www.cursor.com/agents/mcp/oauth/callback and http://localhost:8787/callback.
- No command-line add command is documented.

[Build a Cursor config →](https://dotsagent.io/mcp/config#client=cursor)

## Other clients

[Claude Desktop](https://dotsagent.io/mcp/clients/claude-desktop)

[Claude Code](https://dotsagent.io/mcp/clients/claude-code)

[VS Code (GitHub Copilot)](https://dotsagent.io/mcp/clients/vscode-copilot)

[Windsurf / Devin Desktop](https://dotsagent.io/mcp/clients/windsurf)

[Zed](https://dotsagent.io/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/mcp/clients/codex-cli)

[Gemini CLI](https://dotsagent.io/mcp/clients/gemini-cli)

[ChatGPT](https://dotsagent.io/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/mcp/clients/openclaw)

[Cline](https://dotsagent.io/mcp/clients/cline)

[Continue](https://dotsagent.io/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/mcp/clients/jetbrains-ai)

## Sources

1. [cursor.com](https://cursor.com/docs/context/mcp)/docs/context/mcp

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
