How to Setup MCP in Cursor
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
Locate mcp.json
Find the configuration file at %USERPROFILE%\.cursor\mcp.json.
Add MCP server entries
Open the file and add your server definitions inside the configuration schema.
Set environment variables
Provide any required API keys, database URLs, or access tokens in the environment section.
Save and reload
Save mcp.json and hot-reload or restart Cursor.
Verify in chat
Ask Cursor to list tools or execute a task with the connected MCP server.
Cursor Protocol Support
Local stdio transports via npx, python, uvx
Remote SSE servers with authentication headers
Composer agent autonomous tool calls
Context reference via @ mentions
Not yet exposed in chat slash commands
Binds to active project workspace root
Auto-reloads on mcp.json save
Cursor Setup FAQ
Where is the Cursor MCP config file located?
On Windows: %USERPROFILE%\.cursor\mcp.json. On macOS: ~/.cursor/mcp.json. On Linux: ~/.cursor/mcp.json.
Does Cursor support MCP tools and stdio transports?
Cursor supports stdio transports and supports autonomous tool calling.
How do I reload MCP servers in Cursor?
Auto-reloads on mcp.json save