Connect Cursor to MCP Servers
Cursor has native MCP support. This guide shows you exactly how to configure it, add any MCP server, and get your AI coding assistant working with external tools and data sources.
What Cursor MCP Integration Gives You
Cursor's Agent mode (Cmd/Ctrl + I) can call MCP tools directly during code generation. This means the AI can query your database, read your documentation, call your APIs, or interact with any service — all without leaving the editor.
Step 1 — Open Cursor MCP Settings
Cursor stores MCP configuration in a dedicated settings file (separate from VS Code's settings.json). There are two ways to open it:
1. Open Cursor Settings (Cmd + ,)
2. Navigate to Features → MCP Servers
3. Click "Edit in settings.json"
macOS: ~/.cursor/mcp.json
Windows: %USERPROFILE%\.cursor\mcp.json
Linux: ~/.cursor/mcp.json
Project-level config: You can also create a .cursor/mcp.json file in your project root to define MCP servers that are only active for that project. This is great for team setups checked into version control.
Step 2 — Add an MCP Server
The MCP configuration file uses the same format as Claude Desktop. Here's the basic structure:
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["/path/to/server/index.js"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}Each server entry has:
- key — a unique name for the server (shown in Cursor UI)
- command — the executable to run (node, python, npx, uvx, etc.)
- args — array of arguments passed to the command
- env — optional environment variables (for API keys, etc.)
Real examples
Filesystem server (via npx)
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/you/projects"
]
}
}
}Python MCP server (via uv)
{
"mcpServers": {
"my-python-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/my-mcp-server",
"run",
"server.py"
]
}
}
}HTTP/SSE server (remote)
{
"mcpServers": {
"remote-server": {
"url": "https://your-mcp-server.example.com/sse"
}
}
}Step 3 — Enable and Test
After saving your mcp.json, reload Cursor. MCP servers start automatically when Cursor launches.
Check server status
Open Cursor Settings → Features → MCP Servers. You should see your server listed with a green dot. If it shows red, hover for the error message.
Open Agent mode
Press Cmd + I (macOS) or Ctrl + I (Windows/Linux) to open Cursor Agent.
Ask it to use a tool
Type something like "list the files in my project root" (if using filesystem server). Cursor will show a tool call prompt — approve it and see the result.
Troubleshooting
Hover over the server name in Settings to see the full error. Common causes:
- Wrong path to command or script (must be absolute)
- Missing dependency (npm package or Python module not installed)
- Port conflict if using HTTP transport
Cursor only shows MCP tools when the server is healthy. Also check:
- You're in Agent mode, not regular Chat (Cmd+I not Cmd+L)
- Try fully restarting Cursor after config changes
Cursor launches MCP servers with a clean environment. Pass all required variables in the env object in your config, rather than relying on your shell's env.
Your mcp.json has a syntax error. Validate it with cat ~/.cursor/mcp.json | python3 -m json.tool.
Ready to build your own MCP server?
Now that Cursor is configured, build a custom MCP server to give it access to your tools.