MCP Documentation
Disclaimer: MCPCursor is not affiliated with or endorsed by Cursor IDE. We're just passionate developers who love Cursor and created this resource site to help others leverage MCP. Many of the MCP servers listed here are community contributions and not our own. This is a documentation-style website that may include ads or monetized content.
The Model Context Protocol (MCP) is an open protocol in Cursor that allows users to provide custom tools to agentic language models, primarily used with the Agent in Composer feature. This documentation provides detailed information for developers looking to implement, configure, and use MCP with Cursor IDE.
Protocol Specification
Detailed technical specifications of the Model Context Protocol, including request/response formats, context structure, and communication standards.
View SpecificationImplementation Guide
Step-by-step guides for implementing MCP servers, including code examples, best practices, and common implementation patterns.
View Implementation GuideGetting Started with MCP Development
Setting Up Your First MCP Server
This guide walks you through creating a basic MCP server from scratch, including setting up the communication layer, handling context, and implementing response generation.
# Clone the MCP starter template
git clone https://github.com/mcpcursor/mcp-starter
cd mcp-starter
# Install dependencies
npm install
# Configure your server
cp .env.example .env
# Edit .env with your settings
# Start development server
npm run dev
Testing Your MCP Implementation
Learn how to test your MCP server implementation using our testing tools and validation suite to ensure compatibility with Cursor IDE.
# Install MCP testing tools
npm install -g @mcpcursor/test-suite
# Run validation tests against your server
mcp-test --url http://localhost:3000/api/mcp
# Generate test report
mcp-test --url http://localhost:3000/api/mcp --report
API Reference
MCP Request Format
The standard format for requests sent from Cursor IDE to MCP servers:
{
"version": "1.0",
"request_id": "uuid-v4-string",
"query": "User's request or question",
"context": {
"files": [
{
"path": "relative/path/to/file.ext",
"content": "File content as string",
"language": "file-language"
}
],
"cursor_position": {
"file": "relative/path/to/current/file.ext",
"line": 42,
"character": 10
},
"selection": {
"file": "relative/path/to/current/file.ext",
"start": { "line": 40, "character": 5 },
"end": { "line": 45, "character": 20 }
}
}
}
MCP Response Format
The standard format for responses sent from MCP servers to Cursor IDE:
{
"version": "1.0",
"request_id": "uuid-v4-string-from-request",
"response": {
"type": "text|code|action",
"content": "Response content as string",
"language": "language-identifier-for-code",
"actions": [
{
"type": "edit|create|delete",
"file": "relative/path/to/file.ext",
"content": "New content for edit/create actions",
"position": {
"start": { "line": 40, "character": 5 },
"end": { "line": 45, "character": 20 }
}
}
]
}
}
Managing MCP Servers in Cursor
To add and manage MCP servers in Cursor:
- Access Settings: Go to Cursor Settings > Features > MCP
- Add New Server: Click the "+ Add New MCP Server" button
- Configure Server: Select the transport type (stdio or sse), provide a name, and specify either a command or URL
- Project-Specific Configuration: Create a
.cursor/mcp.json
file in your project directory for project-specific MCP configurations
When using MCP tools with the Agent:
- The Agent automatically uses available tools when relevant
- You can prompt specific tool usage by mentioning the tool by name or description
- By default, the Agent asks for approval before using an MCP tool
- You can enable "Yolo mode" for automatic tool execution without approval
Ready to Implement Your Own MCP Server?
Get started with our comprehensive resources and join the growing ecosystem of MCP developers.