MCP + Cursor: Setting Up AI-Powered Coding
Overview
Last month I wasted an entire Saturday afternoon setting up MCP in Cursor, and I want to save you from the same headache. I’d already gotten the Model Context Protocol working perfectly for Claude Desktop, so I assumed I could just copy my existing config over
Key Concepts
- • **Config location is completely different**: As I learned the hard way, Cursor doesn’t share Claude Desktop’s config file. It stores its MCP settings in a separate location, which we’ll cover in detail below.
- • **Native workspace integration**: Cursor is a full IDE, so MCP servers automatically get access to your open workspace context. You don’t need to hardcode every project folder into your config like you do for Claude Desktop, which makes the setup far cleaner.
- • **Different permission model**: If you installed Cursor via the App Store or Microsoft Store, it runs with tighter default permissions than Claude Desktop, which causes silent connection failures if you don’t adjust settings upfront.
- • **Auto-reload for config changes**: Newer versions of Cursor automatically reload your MCP config when you save it, so you don’t need to restart the app every time you add a new server, which Claude Desktop still requires.
- • Open Cursor
- • Open Settings with `Cmd+,` (macOS) or `Ctrl+,` (Windows/Linux), or click the gear icon in the bottom left of the sidebar
Last month I wasted an entire Saturday afternoon setting up MCP in Cursor, and I want to save you from the same headache. I’d already gotten the Model Context Protocol working perfectly for Claude Desktop, so I assumed I could just copy my existing config over to Cursor and be done. I restarted the app a dozen times, regenerated my API key, reinstalled Node, and even toggled firewall settings trying to get the servers to connect. Turns out my mistakes were two tiny, easy-to-miss issues: I’d put the config file in the wrong location (Cursor doesn’t use the same path as Claude Desktop), and I’d never given Cursor permission to access my project folders on macOS. That 3-hour debugging session is why I put together this practical, tested guide to getting AI-powered coding with MCP and Cursor working right the first time.
If you’re new to this, MCP (Model Context Protocol) is Anthropic’s open standard that lets your AI coding assistant connect to local tools on your machine. Before MCP, Cursor’s AI could only see the files you had open, and you had to manually copy terminal output, git diffs, and unopened file content into the chat to get accurate help. With MCP set up right, Cursor can autonomously read your entire codebase, check git history, run tests, and verify fixes—all without you switching between tools or pasting content back and forth. It turns Cursor from a smart text editor into a true AI pair programmer that works with your local environment, not just against it.
Key Differences Between Cursor MCP and Claude Desktop MCP
Most existing MCP tutorials focus on Claude Desktop, so it’s important to call out the key differences that trip new users up:
- **Different permission model**: If you installed Cursor via the App Store or Microsoft Store, it runs with tighter default permissions than Claude Desktop, which causes silent connection failures if you don’t adjust settings upfront.
- **Auto-reload for config changes**: Newer versions of Cursor automatically reload your MCP config when you save it, so you don’t need to restart the app every time you add a new server, which Claude Desktop still requires.
- **Config location is completely different**: As I learned the hard way, Cursor doesn’t share Claude Desktop’s config file. It stores its MCP settings in a separate location, which we’ll cover in detail below.
- **Native workspace integration**: Cursor is a full IDE, so MCP servers automatically get access to your open workspace context. You don’t need to hardcode every project folder into your config like you do for Claude Desktop, which makes the setup far cleaner.
There’s also a big workflow tradeoff here: Using MCP in Cursor means you keep all your coding in one app, instead of switching between Claude Desktop and your editor. The downside is that Cursor’s MCP implementation is still relatively new compared to Claude Desktop, so you may run into minor edge cases with less popular servers. For the three core coding servers we’ll cover here, though, it’s rock solid.
Where Cursor Stores MCP Config
The easiest way to access your MCP config directly through Cursor’s GUI, which eliminates 100% of path-related errors. Here’s how:
- Open Cursor
- Open Settings with `Cmd+,` (macOS) or `Ctrl+,` (Windows/Linux), or click the gear icon in the bottom left of the sidebar
- Search for “MCP” in the settings search bar
- Click the *Open MCP Config* button in the Model Context Protocol section
*Screenshot description*: The MCP settings screen shows a toggle for enabling MCP (it’s on by default in new Cursor versions), the “Open MCP Config” button, a list of detected MCP servers with status indicators, and a note that config changes are reloaded automatically. The status indicator uses a green dot for running servers, red for disconnected, and yellow for connecting.
If you ever need to edit the file manually (for example, to back it up or copy it to a new machine), here are the default paths per operating system, contrasted with Claude Desktop’s path for reference:
| OS | Cursor MCP Config Path | Claude Desktop Config Path |
|----|---------------------------|------------------------------|
| macOS | `~/.cursor/mcp.json` | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Windows | `%APPDATA%\Cursor\mcp.json` | `%APPDATA%\Claude\claude_desktop_config.json` |
| Linux | `~/.config/cursor/mcp.json` | `~/.config/claude/claude_desktop_config.json` |
If your file is empty when you open it, just add the base JSON structure first: `{"mcpServers": {}}`. All your servers will go inside that `mcpServers` object.
Recommended MCP Servers for Coding Workflows
After testing dozens of MCP servers for daily coding, these three give you the biggest boost in productivity with minimal setup. I’ll cover the practical tradeoffs for each, so you can decide what fits your workflow.
1. Official Filesystem MCP Server
This is the most impactful server for daily coding, and the one you should install first. It lets Cursor read, search, and write files on your local machine, so it can access every file in your project even if you only have a handful open. It’s maintained by Anthropic, so it’s well-supported and stable.
**Practical tradeoffs**:
- If you give Cursor access to your entire home directory, you get maximum convenience, but you increase the risk of accidental modification to sensitive files (like `.env` files with API keys) or system files. It also uses more context window, because Cursor may pull in unnecessary files from outside your project, increasing your API costs.
- Restricting access to your root projects folder adds a tiny bit of setup, but eliminates almost all of that risk. That’s the approach I recommend.
- It requires Node.js 18+ to run, which is a standard dependency for most developers these days.
2. Git MCP Server
This community-maintained server lets Cursor interact with your local git repository. It can run `git status`, show commit history, display diffs between branches or commits, and even create new branches. For debugging regressions or refactoring old code, it’s a game-changer: you can just ask “Find the last commit that changed the checkout flow, explain what changed, and check if it introduced the bug I’m seeing” and Cursor will pull all the context it needs automatically.
**Practical tradeoffs**:
- It only accesses local git history, so it can’t pull pull request comments or remote issue data unless you add an extra GitHub MCP server. It’s meant to augment your existing git workflow, not replace it.
- If you allow it to make commits, there’s a risk of AI committing bad code to a shared branch. I always require approval for any git changes, and I still review every commit before pushing, which adds a small step but eliminates that risk.
- It’s Node-based, so no extra dependencies beyond what you already have for the filesystem server.
3. Code Execution MCP Server
This server lets Cursor run arbitrary code, install dependencies, and execute tests directly in your local environment. If you’re debugging a failing test, Cursor can run the test, see the output, fix the bug, and re-run the test to confirm the fix—all without you touching the terminal.
**Practical tradeoffs**:
- This is the highest risk server on this list: it lets AI run arbitrary code on your machine. If you use it with untrusted prompts or unvetted code, you risk malware or accidental data loss. I never recommend using it on a machine with sensitive data unless you run it in a isolated Docker container.
- For personal side projects, the convenience far outweighs the risk if you keep approval enabled for all code runs. It cuts my debugging time in half for small projects.
- It’s Python-based, so you’ll need Python 3.10+ and a package installer like `uv` or `pipx` to run it.
Step-by-Step Setup
Before you start, make sure you have the latest version of Cursor (versions before 0.40 don’t support MCP at all) and Node.js 18+ installed. If you’re adding the code execution server, install `uv` for the easiest setup (it’s a one-line install from [astral.sh/uv](https://astral.sh/uv)).
When you open your MCP config via the Cursor settings button, add the following JSON to the `mcpServers` object. Replace `/Users/your-username/projects` with the path to your root projects folder on your machine:
```json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@anthropic-ai/mcp-server-filesystem",
"/Users/your-username/projects"
]
},
"git": {
"command": "npx",
"args": [
"-y",
"ktrankina/mcp-server-git"
]
},
"code-execution": {
"command": "uvx",
"args": [
"mcp-server-code-runner"
]
}
}
}
```
*Screenshot description*: After saving the config, the MCP settings screen in Cursor will update to show all three servers, each with a green status dot if they connected successfully. If any have a red dot, you can hover over the dot to see the error message.
If you use nvm to manage Node versions like I do, you’ll want to replace `npx` with the absolute path to your npx binary. You can get that path by running `which npx` in your terminal, and paste it into the `command` field. That fixes most connection issues right off the bat.
Testing Your Setup
Once your config is saved and all servers show a green status dot, it’s time to test everything to make sure it works. Create a new folder for testing, open it in Cursor, and add this buggy Python file to test the full workflow:
```python
def add_numbers(a, b):
return a * b # Bug: this should return a + b, not a * b
result = add_numbers(2, 3)
print(f"Sum of 2 and 3 is: {result}")
```
Initialize a git repo in the folder with these commands in your terminal:
```bash
git init
git add .
git commit -m "Add initial test file"
```
Now open a new Agent chat in Cursor, and paste this prompt:
> Use the filesystem to find the test file in this workspace, check the git history of this repo, run the script to confirm the bug, fix the bug, and re-run it to verify the fix works.
If everything is working correctly, here’s what will happen:
- Cursor will use the filesystem server to find the `test_mcp.py` file even if it’s not open, and read its content
- It will use the git server to pull the commit history and confirm the initial commit
- It will use the code execution server to run the script, see that it outputs `Sum of 2 and 3 is: 6` instead of the correct 5
- It will fix the bug by changing `*` to `+`
- It will re-run the script to confirm it now outputs 5, and report the result back to you.
When I tested this for the first time after fixing my config issue, I was blown away by how seamless it is. I didn’t have to touch the terminal, copy any output, or switch between tools—it all happened autonomously in the editor I was already using.
Troubleshooting Common Issues
After helping a few friends set this up, these are the most common issues I’ve seen, and how to fix them:
- **All servers show red, won’t connect**: 9 times out of 10, this is because you put the config in the wrong location (like Claude Desktop’s folder instead of Cursor’s). Always use the “Open MCP Config” button in Cursor settings to confirm you’re editing the right file. If that’s not the issue, your `npx` or `uvx` path is not in Cursor’s PATH. Use absolute paths for all commands in your config, which fixes this immediately.
- **Filesystem server can’t read files**: On macOS, this is almost always a permissions issue. Go to System Settings > Privacy & Security > Full Disk Access, and toggle on Full Disk Access for Cursor. This was the second issue that tripped me up during my 3-hour debugging session—Cursor couldn’t read my project folders, so the server crashed silently with no clear error.
- **Servers are running but Cursor won’t use them**: First, make sure you’re using Agent mode (older versions of Composer don’t support MCP). Second, update Cursor to the latest version—support for MCP was rolled out gradually, so older versions won’t work. If that doesn’t fix it, explicitly mention using the tools in your prompt (e.g., “use the filesystem to find the file”) to nudge Cursor to use the MCP integration.
- **Code execution returns no output**: If you’re using `uvx`, make sure you actually installed uv first. If you don’t want to use uv, you can replace the `uvx mcp-server-code-runner` line with `pipx run mcp-server-code-runner` if you have pipx installed. Also, make sure you approved the code execution run when Cursor prompted you—approval is required by default for all code changes.
One final tradeoff to remember here: You can adjust approval rules per server in Cursor’s MCP settings. I auto-approve all file reads (for faster workflow) and require approval for all file writes, git changes, and code execution (for security). That’s a good middle ground for most developers, but you can tighten or loosen the rules based on your risk tolerance.
Actionable Next Steps
Now that you have all the info you need to get set up, here’s what to do next to get this working today:
- Spend 2 minutes checking for Cursor updates: Open the Cursor menu, click “Check for Updates”, and install any available updates to make sure you have full MCP support.
- Open your MCP config via the settings search bar, and add the Filesystem MCP server to your config (it’s the lowest risk, highest reward server, and takes 5 minutes to set up).
- Test your setup with the buggy `add_numbers` example I shared above to confirm the server connects and works as expected.
- Adjust your approval rules in MCP settings to auto-approve reads and require approval for writes and code execution, which balances speed and security for most workflows.
- Next time you debug an issue in your code, try asking Cursor to use git and code execution to diagnose the problem for you, and see how much time you save compared to manually pulling context and running tests.
This setup completely changed my daily coding workflow, cutting out all the tedious context copying and terminal switching that used to break my focus. With 10 minutes of setup, you can get the same boost today.
Official / Source Links
Related Guides In This Intent
These pages cover nearby scope with different focus, helping reduce overlap and choose the right guide.
What To Do Next
Move from this guide to a concrete workflow and a matching tool page to apply the concepts.
References
- Model Context Protocol (MCP) — Official Documentation
- MCP Specification & Quick Start
- MCP GitHub Organization
Last updated: April 5, 2026