How to Add MCP Tools to Cursor
Developer-focused guide to adding MCP servers to Cursor IDE — covers .cursor/mcp.json configuration, useful coding servers, and real productivity workflows.
Cursor supports MCP natively — and for developers, it is arguably the best AI client for tool use. MCP tools in Cursor can query databases, review GitHub PRs, check Sentry errors, and interact with any API — all without leaving your code editor. This guide covers how to set it up, which servers to install, and real workflows that save time.
If you need MCP basics first, see What Is MCP?. If you are looking for the Claude Desktop guide, see MCP Setup for Claude Desktop.
Why MCP in Cursor matters
Cursor's AI already understands your codebase. Adding MCP tools extends that understanding to external systems:
- Ask about production errors — "What are the top Sentry errors in the last hour?" without opening the Sentry dashboard
- Query your database — "How many users signed up today?" without writing SQL or switching to a database client
- Manage GitHub — "Show me the open PRs and summarize the changes" without opening the browser
- Check deployments — "What is the status of the last deployment?" without switching to your CI dashboard
The AI has your code context plus external tool access. That combination is powerful.
Configuration
Cursor uses a JSON config file at .cursor/mcp.json in your project root (or globally at ~/.cursor/mcp.json). The format is similar to Claude Desktop's config.
Create .cursor/mcp.json:
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-name"],
"env": {}
}
}
}For remote servers (like drio-deployed tools):
{
"mcpServers": {
"my-tool": {
"url": "https://app.getdrio.com/my-app/mcp"
}
}
}After saving the config, restart Cursor or use the command palette to reload MCP servers. The official Cursor MCP docs have the complete reference.
Best servers for coding workflows
Here are the MCP servers that make the biggest difference for developers using Cursor:
Git
View diffs, check status, read commit history, blame files. Combined with Cursor's code understanding, this lets you ask questions like "what changed in the authentication module since last release?"
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-git"]
}
}
}Filesystem
Read files, list directories, search by content. Cursor already indexes your project, but the filesystem server lets the AI access files outside the project scope — documentation, config files, or related repositories.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/projects"
]
}
}
}GitHub
Full GitHub integration — search repos, read files, create/review PRs, manage issues. Requires a personal access token.
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}PostgreSQL / Database
Query your development or staging database directly from Cursor. The AI sees the schema and writes queries from natural language.
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}Use a read-only connection for safety. Never point this at production without appropriate access controls.
Memory
Persistent key-value memory across sessions. Useful for storing project-specific context: "Remember that we use Vitest for testing" or "The auth module is in src/lib/auth.ts."
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}Sequential Thinking
Structured reasoning for complex problems. Useful for architecture planning, debugging complex issues, and evaluating trade-offs.
Real workflows
Workflow 1: Debug a production error
"Check Sentry for the top 3 errors in the last 24 hours, then look at the relevant code files and suggest fixes."
Cursor uses the Sentry MCP server to fetch errors, its code index to find the relevant files, and the AI to analyze the stack traces and suggest patches. What used to be: open Sentry, read the error, find the file, switch to IDE, read the code, think about the fix — is now one prompt.
Workflow 2: Code review
"Show me the changes in PR #42 and review the code for potential issues."
The GitHub MCP server fetches the PR diff. Cursor's AI reads the changes with full project context — it knows the codebase, the patterns, and the conventions. The review is more accurate because the AI is not looking at the diff in isolation.
Workflow 3: Data-driven development
"How many active users do we have by plan tier? Show me the raw numbers."
The database MCP server runs the query against your staging database. No SQL writing, no switching to a database client, no formatting results manually.
Workflow 4: End-of-day status
"Summarize what I committed today and draft a standup message."
The Git MCP server reads today's commits. The AI drafts a standup update based on the actual changes.
Project-level vs. global config
.cursor/mcp.jsonin project root — Servers available only in this project. Useful for project-specific databases, APIs, or tools. Add this file to.gitignoreif it contains credentials.~/.cursor/mcp.json— Servers available in all projects. Useful for general tools like Git, filesystem, and memory.
You can have both. Project-level configs override global ones for servers with the same name.
Connecting drio tools
If you have built custom tools with drio — an internal dashboard, a support tool, a data explorer — you can connect them to Cursor the same way:
{
"mcpServers": {
"company-dashboard": {
"url": "https://app.getdrio.com/my-company/mcp"
}
}
}This means the same tool you use in ChatGPT for business purposes is also available in Cursor for development context. One MCP server, multiple clients.
Troubleshooting
Servers not appearing
- Restart Cursor — MCP config is read at startup. Some versions support hot-reload, but a restart is the reliable option.
- Check file location — The config must be at
.cursor/mcp.jsonin the project root or~/.cursor/mcp.jsonglobally. - Validate JSON — Syntax errors break the entire file. Use a JSON validator.
Tool invocations fail
- Check credentials — API keys in the
envfield must be correct. Test the server manually in your terminal first. - Test with Inspector — Use the MCP Inspector to verify the server works before connecting to Cursor.
- Check Node.js version — Some servers need Node.js 18+.
Performance issues
- Too many servers — Each server is a running process. Start with 3-4 essential servers, not 15.
- Slow API responses — If a server's API calls are slow, the AI will wait and Cursor may feel sluggish. Consider servers that cache responses.
- Memory usage — Monitor system resources if you run many local MCP servers simultaneously.
A good starter config
For most developers, this covers the core workflow:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"git": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-git"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}Add GitHub, database, and Sentry servers as your workflow demands. For a comparison of MCP support across all AI clients, see MCP Client Comparison.
The best Cursor MCP setup is the one where you forget the tools are there — you just ask questions and get answers that incorporate your code, your data, and your external systems.


