Free toolGenerate .mcp.json configs for Claude Code, Cursor & Codex →
▲

Anysphere · Cursor editor · Cursor CLI

Cursor config file: where it lives & format

Cursor MCP config file: where .cursor/mcp.json lives, its format and copy-paste examples. For the full walkthrough, see the step-by-step guide.

Step-by-step guideHow to add an MCP server to Cursor →The full walkthrough with verification and troubleshooting. This page is the quick config reference.

1. Find the config file

  • .cursor/mcp.json (project)
  • ~/.cursor/mcp.json (global)

Uses the "mcpServers" key. Remote servers take a "url" (plus optional "headers").

2. Add a local (stdio) server

Example: Context7, which runs locally with npx.

.cursor/mcp.json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}

3. Add a remote (HTTP) server

Example: Notion's hosted server. You sign in with OAuth the first time it connects.

.cursor/mcp.json
{
  "mcpServers": {
    "notion": {
      "url": "https://mcp.notion.com/mcp"
    }
  }
}

4. If it won't connect

  • Validate the file. One trailing comma breaks the whole file.
  • Check the top-level key: VS Code uses servers; Claude Code, Cursor and Antigravity use mcpServers; Codex uses TOML tables.
  • If npx isn't found, the app may not see your shell's PATH (common with nvm). Use the full path to npx.
  • Restart the agent or reload the window after editing.
Generate your config →

Cursor MCP transports, variables and OAuth

Cursor supports three MCP transports: stdio (a local command Cursor manages), SSE and Streamable HTTP (a URL, with OAuth). Official servers install with one click from the Cursor Marketplace in Customize, and team admins can distribute servers through a team marketplace; those appear in Customize alongside your personal and workspace servers.

mcp.json supports interpolation, so secrets can stay out of the file: ${env:NAME} for environment variables, ${userHome}, ${workspaceFolder} (the folder containing .cursor/mcp.json) and ${workspaceFolderBasename}. Stdio servers can also load an envFile such as ${workspaceFolder}/.env, but remote HTTP and SSE servers do not support envFile.

For providers without OAuth dynamic client registration, mcp.json accepts static OAuth credentials: CLIENT_ID is required, CLIENT_SECRET and scopes are optional. Without scopes, Cursor reads scopes_supported from /.well-known/oauth-authorization-server. Cursor uses fixed OAuth redirect URLs, so when you set up the provider's OAuth app, register both the web and desktop callbacks if your users sign in from both. For community servers, Cursor points to cursor.directory.

Source: cursor.com · Checked Oct 24, 2026

Frequently asked questions

.cursor/mcp.json (project) or ~/.cursor/mcp.json (global).

Guides, pricing & comparisons