Cursor Integration¶
Use GitHub to MCP with Cursor IDE for AI-assisted coding with full codebase context.
Prerequisites¶
- Cursor installed
- A generated MCP server (see Quick Start)
- Node.js 18+ installed
Step 1: Generate Your MCP Server¶
Step 2: Configure Cursor¶
Cursor's MCP configuration is in your settings. Open Cursor and:
- Press
Cmd/Ctrl + ,to open Settings - Search for "MCP"
- Click "Edit in settings.json"
Or edit directly:
Step 3: Add MCP Server¶
Add your MCP server configuration:
{
"mcp.servers": {
"my-repo": {
"command": "node",
"args": ["/Users/yourname/mcp-servers/my-repo/server.mjs"]
}
}
}
Step 4: Restart Cursor¶
- Close all Cursor windows
- Relaunch Cursor
- The MCP tools should now be available
Using MCP with Cursor¶
In Chat (Cmd+L)¶
Ask questions about the connected repository:
You: How does the authentication middleware work?
Cursor: Uses MCP tools to search and read files The authentication middleware in this repo...
In Composer (Cmd+K)¶
Reference MCP tools when generating code:
You: Create a new endpoint similar to the existing /users endpoint
Cursor: Uses
search_codeto find the users endpoint,read_fileto understand the pattern
Context Awareness¶
With MCP connected, Cursor can:
- Search the entire repository for relevant code
- Understand API patterns and conventions
- Find related implementations
- Reference documentation
Multiple Repositories¶
Configure multiple repos for cross-codebase AI assistance:
{
"mcp.servers": {
"frontend": {
"command": "node",
"args": ["/path/to/frontend-mcp/server.mjs"]
},
"backend": {
"command": "node",
"args": ["/path/to/backend-mcp/server.mjs"]
},
"shared-lib": {
"command": "node",
"args": ["/path/to/shared-mcp/server.mjs"]
}
}
}
Workflow Tips¶
1. Connect External Dependencies¶
Generate MCP servers for libraries you use:
# Your project's main dependency
npx @nirholas/github-to-mcp https://github.com/prisma/prisma -o ~/mcp-servers/prisma
Then ask Cursor about Prisma patterns while coding.
2. Reference Documentation Repos¶
Ask about Next.js best practices with real code context.
3. Keep Servers Updated¶
When dependencies update, regenerate:
Troubleshooting¶
MCP Not Working¶
- Check Cursor version (MCP requires recent versions)
- Verify the config file location
- Test the server standalone:
Slow Responses¶
For large repos, optimize your MCP server:
Permission Errors¶
On macOS, you may need to allow Node.js:
- System Preferences → Security & Privacy
- Allow
nodeto run
Best Practices¶
- Local repos first - For your active project, use Cursor's built-in context
- MCP for external - Use MCP for dependencies and reference repos
- Selective tools - Exclude unused tools for faster responses
- Keep servers lean - Don't generate servers for massive repos unless needed
Next Steps¶
- VS Code Integration
- Custom Tools
- Batch Conversion - Generate multiple servers at once