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. One-click install
Open Customize, browse the Cursor Marketplace and click Add to Cursor. Remote servers then ask you to authenticate with OAuth.
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. 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. 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. Debug
Open the Output panel (Cmd+Shift+U) and choose MCP Logs to see connection, auth and crash errors.
Tips
- Use ${env:NAME}, ${workspaceFolder} and ${userHome} interpolation instead of hard-coding paths and secrets.
- envFile works for stdio servers only.
- For static OAuth, register https://www.cursor.com/agents/mcp/oauth/callback and http://localhost:8787/callback with the provider.
- Enterprise admins can allowlist servers and tools under Team Settings > MCP Configuration.
Next steps
Verified MCP servers for Cursor
Generate an MCP config for Cursor
Cursor hub
Cursor vs Claude Code: documented features compared
How to add an MCP server to Codex
Sources
- https://cursor.com/docs/context/mcp · checked 2026-10-16