Claude DesktopCursorWindsurf (Cascade)Cline / Roo CodeOpenAI Codex CLIAntigravityZed EditorLangChain / LangGraph
How to Setup MCP in Cursor
Popular IDE
Step-by-step setup guide for connecting Model Context Protocol (MCP) servers to Cursor by Anysphere.
Configuration File: mcp.json
%USERPROFILE%\.cursor\mcp.json
Example mcp.json Template
Open in Config Generator{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@/db"]
}
}
}Installation Steps
1
Locate mcp.json
Find the configuration file at %USERPROFILE%\.cursor\mcp.json.
2
Add MCP server entries
Open the file and add your server definitions inside the configuration schema.
3
Set environment variables
Provide any required API keys, database URLs, or access tokens in the environment section.
4
Save and reload
Save mcp.json and hot-reload or restart Cursor.
5
Verify in chat
Ask Cursor to list tools or execute a task with the connected MCP server.
Cursor Protocol Support
Stdio Transport Supported
Local stdio transports via npx, python, uvx
SSE / HTTP Transport Supported
Remote SSE servers with authentication headers
Tool Calling Supported
Composer agent autonomous tool calls
Resources API Supported
Context reference via @ mentions
Prompts API Unsupported
Not yet exposed in chat slash commands
Roots Boundary Supported
Binds to active project workspace root
Dynamic Hot-Reload Supported
Auto-reloads on mcp.json save