Cursor supports MCP (Model Context Protocol) for connecting AI to external tools and data sources. This means Cursor’s AI can query databases, manage GitHub issues, search documentation, run containers, and interact with any service that has an MCP server — all from within your IDE.
What MCP adds to Cursor
Without MCP, Cursor’s AI can only see your code files and terminal output. With MCP, it gains access to:
- Live data — query databases, APIs, and services directly
- Tool execution — run commands, manage infrastructure, deploy code
- External context — pull in documentation, issue trackers, design specs
- Custom workflows — any tool you build an MCP server for
This transforms Cursor from a code-aware assistant into a full development environment assistant that understands your entire stack. For a deeper dive into the protocol itself, see our MCP complete developer guide.
Step-by-step setup
1. Open MCP settings
In Cursor, navigate to:
- macOS:
Cmd + ,→ Features → MCP - Windows/Linux:
Ctrl + ,→ Features → MCP
You’ll see a list of configured MCP servers (empty initially) and an “Add Server” button.
2. Add a server via UI
Click “Add Server” and fill in:
- Name: A descriptive label (e.g., “github”, “postgres”)
- Type: Choose “command” (stdio) or “sse” (HTTP)
- Command: The executable to run (e.g.,
npx) - Arguments: Command arguments as an array
3. Or configure via .cursor/mcp.json
For project-level configuration that your team can share, create .cursor/mcp.json in your project root:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}
This file is checked into your repo so all team members get the same MCP configuration (minus secrets, which should use environment variables).
4. Verify the connection
After adding a server:
- Look for the green indicator next to the server name in MCP settings
- Open a new Composer session (Cmd+I)
- You should see the MCP tools listed in the available tools panel
- Try asking Cursor to use one: “List my open GitHub issues”
Configuring .cursor/mcp.json in detail
The configuration supports several server types:
Stdio servers (most common — runs a local process):
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["./path/to/server.js"],
"env": { "API_KEY": "..." }
}
}
}
SSE servers (connects to a remote HTTP endpoint):
{
"mcpServers": {
"remote-server": {
"url": "https://mcp.example.com/sse",
"headers": {
"Authorization": "Bearer your-token"
}
}
}
}
Docker-based servers (isolated execution):
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/puppeteer"]
}
}
}
Recommended MCP servers for Cursor
Here are the most useful servers for development workflows:
| Server | Package | Use case |
|---|---|---|
| GitHub | @modelcontextprotocol/server-github | Issues, PRs, code search |
| Filesystem | @modelcontextprotocol/server-filesystem | Sandboxed file access |
| PostgreSQL | @modelcontextprotocol/server-postgres | Database queries |
| Brave Search | @modelcontextprotocol/server-brave-search | Web/docs search |
| Memory | @modelcontextprotocol/server-memory | Persistent knowledge graph |
| Puppeteer | @modelcontextprotocol/server-puppeteer | Browser automation |
| Slack | @modelcontextprotocol/server-slack | Team communication |
| Linear | Community server | Issue tracking |
| Sentry | Community server | Error monitoring |
For a comprehensive list with setup instructions, see our best MCP servers guide.
Troubleshooting
Server shows red/disconnected
- Check the command exists: Run the command manually in your terminal to verify it works
- Check Node.js version: Most MCP servers require Node 18+. Run
node --version - Check npx cache: Run
npx clear-npx-cacheand try again - Check logs: In Cursor, click the server name → “View Logs” to see error output
Tools not appearing in Composer
- MCP tools only appear in Composer (Cmd+I), not in regular chat (Cmd+L)
- Make sure you’re using Agent mode in Composer, not Ask mode
- Restart Cursor after adding new servers
Environment variables not working
- Cursor reads env vars from the MCP config, not your shell profile
- For secrets, use a
.envfile and reference it, or set them in the MCP settings UI - Don’t commit secrets to
.cursor/mcp.json— use environment variable references
Server crashes on startup
- Run the server command directly in terminal to see the full error
- Common issue: missing API keys or invalid configuration
- Some servers need initial setup (e.g., GitHub server needs a valid token with correct scopes)
Permission errors
- Filesystem server only accesses directories you explicitly allow in args
- Database servers need valid connection strings with correct permissions
- GitHub server needs a token with appropriate scopes (repo, issues, etc.)
Cursor vs Claude Code for MCP
Both Cursor and Claude Code support MCP natively. The same servers work with both — MCP is model-agnostic. Key differences:
| Feature | Cursor | Claude Code |
|---|---|---|
| Interface | IDE (GUI) | Terminal |
| Config file | .cursor/mcp.json | .mcp.json |
| Tool approval | Per-session | Per-invocation |
| Server types | stdio + SSE | stdio + SSE |
If you’re already using Cursor, MCP extends it naturally. If you prefer terminal workflows, Claude Code’s MCP support is equally capable.
Security considerations
MCP servers can access sensitive data and execute commands. Before adding any server:
- Review what permissions it requests
- Limit filesystem access to specific directories
- Use read-only database credentials where possible
- Don’t expose MCP servers to untrusted networks
- Audit community servers before use
FAQ
Does Cursor support MCP?
Yes. Cursor has native MCP support in Composer mode (Agent). You can add MCP servers through the settings UI or via a .cursor/mcp.json file in your project. Both stdio (local process) and SSE (remote HTTP) server types are supported. MCP tools appear automatically in the Composer panel once a server is connected.
Which MCP servers work with Cursor?
All standard MCP servers work with Cursor — the protocol is universal. The most popular ones for development are GitHub (issues/PRs), PostgreSQL (database queries), Filesystem (sandboxed file access), and Brave Search (documentation lookup). Community servers for Linear, Sentry, Slack, and dozens of other tools also work. See our best MCP servers list for recommendations.
Is MCP free in Cursor?
MCP itself is free and open-source — there’s no additional cost from Cursor for using it. However, you still need a Cursor subscription (Pro or Business) for the AI features that use MCP tools. The MCP servers themselves are free to run locally. Some servers may connect to paid APIs (like GitHub or databases), but that’s the API cost, not an MCP cost.
Related: MCP Complete Developer Guide · What is MCP? · Best MCP Servers · Claude Code vs Cursor 2026