Cursor IDE
AI-first IDE with deep integration via MCP servers. Primary tool for AI-assisted development with codebase awareness and inline editing.
Welcome to the complete guide for using Cursor IDE with AI Templates! This document will walk you through installation, MCP server configuration, and leveraging AI to boost your productivity.
Overview
Cursor IDE is an AI-powered development environment that integrates with MCP servers to provide intelligent assistance for:
- Application Development: AI pair programming and code generation
- MCP Server Development: Building and testing MCP tools
- Agent Development: Creating LangGraph workflows
- Documentation: Writing and improving docs
Part 1: Getting Started with Cursor
Step 1: Install Cursor IDE
Download and Install
Visit cursor.sh and download for your operating system
Install the application:
- macOS: Drag to Applications folder
- Windows: Run the installer
- Linux: Install the package
Launch Cursor and sign in with your Cursor account
Verify your email address via the confirmation link
Time estimate: 5-10 minutes
Info Info
New to Cursor? Cursor is an AI-powered IDE built on VSCode that enhances developer productivity through intelligent code assistance and natural language interactions.
Step 2: Basic Cursor Configuration
Configure AI Model
- Open Settings (Cmd+, on Mac, Ctrl+, on Windows)
- Navigate to Cursor section
- Choose your preferred AI model:
- GPT-4 - Best for complex reasoning
- Claude - Great for coding tasks
- GPT-3.5 - Faster for simple tasks
Trust External Websites (Optional)
If you want Cursor to access documentation sites:
- Go to Settings → Cursor → External Websites
- Add trusted domains (e.g.,
github.com, your documentation site)
Part 2: MCP Server Integration
What is MCP Integration?
Model Context Protocol (MCP) allows Cursor to connect to specialized servers that provide additional capabilities:
- Custom tools for domain-specific operations
- Data access from databases and APIs
- Context about your systems and workflows
Configure MCP Servers in Cursor
Info Info
Prerequisites: You need an MCP server running locally or accessible via network. See MCP Server Template to build your own.
Step 1: Navigate to MCP Settings
- Open Cursor Settings
- Search for “MCP” or navigate to Cursor → Model Context Protocol
- Click “MCP Integrations”
Step 2: Add Custom MCP Server
- Click “Add Custom MCP Server”
- Configure your server:
{
"mcpServers": {
"my-mcp-server": {
"command": "node",
"args": ["/path/to/mcp-server/build/index.js"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
For HTTP-based MCP servers:
{
"mcpServers": {
"my-http-mcp-server": {
"url": "http://localhost:3000/mcp",
"transport": "http"
}
}
}
Step 3: Verify Connection
- After saving, Cursor will attempt to connect
- Check the MCP status indicator
- You should see your server’s tools available in the agent
Tip Tip
Connection Issues? Make sure your MCP server is running and accessible. Check the server logs for connection attempts.
Part 3: Using Cursor with AI Templates
Chat with Your Agent
- Open a new chat (Cmd+L on Mac, Ctrl+L on Windows)
- Select Agent mode from the dropdown
- Ask questions or request help:
- “Help me build a new MCP tool for database queries”
- “Create a LangGraph workflow for this task”
- “Explain how this code works”
Inline AI Editing
- Select code in your editor
- Press Cmd+K (Mac) or Ctrl+K (Windows)
- Describe changes in natural language:
- “Add error handling to this function”
- “Refactor this to be async”
- “Add type hints and docstrings”
Codebase Questions
- Press Cmd+Shift+L (or Ctrl+Shift+L)
- Ask about your codebase:
- “Where is the authentication logic?”
- “How does the MCP server register tools?”
- “Show me examples of async tools”
Part 4: MCP-Powered Workflows
Example: Building an MCP Tool
Ask Cursor:
“I need to create a new MCP tool that queries a database. Can you help me build it following the template pattern?”
Cursor will:
- Understand your MCP server structure
- Generate the tool following your patterns
- Add proper type hints and documentation
- Suggest testing approaches
Example: Testing MCP Tools
Ask Cursor:
“Help me write tests for the database query tool we just created”
Cursor will:
- Create pytest test cases
- Mock external dependencies
- Test both success and error cases
- Follow your testing patterns
Tips for Effective Use
Best Practices
- Be specific: “Add error handling for network timeouts” vs “improve this code”
- Provide context: Reference your MCP server patterns and conventions
- Iterate: Start simple, then refine with follow-up prompts
- Review AI suggestions: Always review and understand generated code
Common Workflows
New Feature Development
- Describe the feature to Cursor
- Review generated code
- Test with your MCP client
- Iterate based on results
Debugging
- Share error messages with Cursor
- Ask for explanation and fixes
- Test the suggested solutions
Code Review
- Select code and ask “Can this be improved?”
- Request security review
- Ask for performance optimization suggestions
Troubleshooting
MCP Server Not Connecting
Symptoms: Tools don’t appear, connection errors
Solutions:
- Verify MCP server is running (
curl http://localhost:3000/health) - Check Cursor MCP settings for correct URL/command
- Review MCP server logs for errors
- Restart Cursor after configuration changes
Agent Not Using MCP Tools
Symptoms: Agent doesn’t call your custom tools
Solutions:
- Ensure tools have clear, descriptive docstrings
- Explicitly mention the tool in your prompt
- Check that server connection is active (green indicator)
- Try rephrasing your request to match tool use cases
Performance Issues
Symptoms: Slow responses, timeouts
Solutions:
- Use lighter AI models for simple tasks (GPT-3.5 vs GPT-4)
- Reduce context window size in settings
- Close unnecessary chat sessions
- Check MCP server performance
Next Steps
- Build your first MCP server: MCP Server Template
- Create an AI agent: Agent Template
- Join the community: GitHub Discussions
Tip Tip
Pro Tip: Create a .cursorrules file in your project root to give Cursor context about your MCP server patterns, coding standards, and best practices!