The Model Context Protocol (MCP) is an open protocol designed to help tools and external services interact seamlessly with Cursor agents. This article guides you through clearly connecting MCP tools to Cursor.
What is MCP?
MCP allows Cursor to connect with external tools or services easily. Imagine it like apps on your phone, but for Cursor. It helps Cursor automatically get context or take actions from sources like databases or GitHub, making your tasks quicker and easier.
For more details, visit the official MCP documentation.
Why Use MCP?
With MCP, Cursor can integrate smoothly with:
- Databases – get data without manually entering information.
- Notion – read notes to guide development.
- GitHub – make pull requests, create branches, and fetch code.
- Memory tools – remember tasks and data.
- Stripe – manage customer subscriptions automatically.
MCP Server Architecture
MCP servers connect Cursor with other services. Choose one of two MCP server types:
- stdio Transport (local)
- SSE Transport (local or remote)
StdIO Transport (Recommended for Local)
- Easy setup for local use
- Automatically managed by Cursor
SSE Transport (Remote or Distributed Teams)
- Can be hosted locally or remotely
- Communicates over an HTTP endpoint
Configuring MCP Servers in Cursor
Step 1: Create an MCP Configuration File
Create .cursor/mcp.json inside your project, or ~/.cursor/mcp.json globally for all projects.
Step 2: Set up Your MCP Configuration
Here’s a JSON example of how to set up an MCP Node.js CLI server:
{
"mcpServers": {
"sample-server": {
"command": "npx",
"args": ["-y", "mcp-server"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}The env field helps manage API keys safely.
Configuration File Location:
- Project specific setup:
{project}/.cursor/mcp.json - Global setup:
~/.cursor/mcp.json
Using MCP Tools in Cursor
Your cursor agent recognizes MCP tools when they’re available in your configuration.
- Automatic Usage: Cursor may automatically suggest MCP tools if they seem useful.
- Intentional Usage: To intentionally activate MCP, give clear instructions, like:
"Please use the GitHub tool to create a pull request."MCP Tool Approval
Cursor asks your permission by default before activating MCP tools. You’ll see details on the arguments and actions the tool will perform.
Enabling YOLO Mode
Activate YOLO Mode to let Cursor automatically execute MCP tools without approval prompts. Enable YOLO Mode from your Cursor settings.
Viewing MCP Responses
After running an MCP tool, Cursor shows the response clearly in chat, allowing you to review the results or troubleshoot issues quickly.
Limitations of MCP (So Far)
MCP is new and evolving. Be aware of these current limitations:
- Continuous development may lead to periodic changes in usage.
- May encounter minor quirks in certain interactions.
Common MCP Examples and Use Cases
Easily add MCP for common integrations:
- Query database schemas directly.
- Automate GitHub workflows.
- Manage Notion notes.
- Stripe payment actions.
Wrap-Up
Now you’re equipped to use MCP in Cursor. This integration will make your workflow faster and simplify the connection between Cursor and your everyday tools.
Keep exploring MCP to streamline your daily tasks even more effectively!