Cursor IDE Integration
Integrate your Knowledge AI project with Cursor IDE through MCP for AI-powered development with your knowledge context.
🚀 Overview
The Cursor IDE integration provides:
- AI-Enhanced Development: Cursor's AI gets context from your knowledge base
- Intelligent Code Suggestions: Suggestions based on your documentation and patterns
- Contextual Assistance: AI understands your project's specific context
- Seamless Workflow: Knowledge integration without leaving your IDE
⚡ Development Features
- ✅ AI-powered development with your knowledge context
- ✅ Smart code completions based on your documentation
- ✅ Project-specific AI assistance
- ✅ Context-aware debugging help
- ✅ Documentation-driven development
⚠️ Beta Status
This integration is currently in Beta. Some features may require troubleshooting:
- MCP integration works but may need configuration adjustments
- Check Cursor's Output panel → "MCP Logs" for debugging
- Tools might not appear initially - restart Cursor if needed
- Actively being improved based on user feedback
📋 Prerequisites
- Cursor IDE installed
- Active Knowledge AI project
- Project Bearer token
- Basic understanding of MCP configuration
⚙️ Setup Guide
Step 1: Get Your Bearer Token
- Navigate to your project's API Keys section in Knowledge AI
- Generate a new Bearer token for Cursor integration
- Copy the token - you'll need it in step 4
Step 2: Locate Cursor MCP Configuration
macOS:
~/.cursor/mcp.jsonWindows:
%USERPROFILE%\.cursor\mcp.jsonLinux:
~/.cursor/mcp.jsonStep 3: Create or Edit MCP Configuration
Create or edit the mcp.json file with the following configuration:
{
"mcp.servers": {
"knowledge-ai-YOUR_PROJECT_ID": {
"command": "npx",
"args": [
"supergateway@latest",
"-y",
"--streamableHttp",
"YOUR_PROJECT_MCP_URL",
"--header",
"Authorization: Bearer YOUR_BEARER_TOKEN_HERE"
]
}
}
}Step 4: Replace Placeholders
- Replace
YOUR_PROJECT_IDwith your actual project ID - Replace
YOUR_PROJECT_MCP_URLwith your project's MCP URL - Replace
YOUR_BEARER_TOKEN_HEREwith the Bearer token from Step 1
Step 5: Restart Cursor
Close and restart Cursor IDE for the configuration to take effect.
Step 6: Verify Connection
- Open Cursor IDE
- Check the Output panel (View → Output)
- Select "MCP Logs" from the dropdown
- Look for successful connection messages
✅ Verification Steps
Check MCP Status
- Output Panel: View → Output → "MCP Logs"
- Connection Messages: Look for successful server connection
- Error Messages: Check for any configuration issues
Test Integration
- AI Chat: Open Cursor's AI chat
- Knowledge Queries: Ask about content from your knowledge base
- Code Context: Request code suggestions using your documentation
🛠️ Usage Examples
AI-Enhanced Development
Ask Cursor's AI to help with development using your knowledge:
"Based on my authentication documentation, help me implement login"
"Use my API patterns to create a new endpoint"
"Reference my deployment notes to set up CI/CD"
"Follow my coding standards to refactor this function"Knowledge-Driven Coding
// Cursor AI can now reference your:
// - Architecture decisions
// - Code patterns and standards
// - API documentation
// - Deployment procedures
// - Best practices and lessons learnedProject-Specific Context
Cursor AI will understand:
- Your project's architecture
- Coding conventions from your docs
- API patterns and examples
- Business logic and requirements
- Technical decisions and rationale
🔧 Troubleshooting
MCP Server Not Connecting
- Check Configuration: Verify
mcp.jsonsyntax is correct - File Location: Ensure
mcp.jsonis in the correct directory - Restart Cursor: Completely close and reopen Cursor
- Check Logs: Review MCP logs for detailed error messages
Tools Not Appearing
- Wait Time: Initial connection may take 30-60 seconds
- Restart Required: Close and restart Cursor IDE
- Configuration Reload: Edit and save
mcp.jsonto trigger reload - Network Issues: Check internet connectivity and firewall
Authentication Issues
- Token Validation: Regenerate Bearer token if expired
- Format Check: Ensure token format is correct in configuration
- Permissions: Verify token has proper project access
- API Status: Check Knowledge AI service status
Performance Issues
- Large Projects: Be specific in AI queries to improve response time
- Memory Usage: Monitor Cursor's memory consumption
- Network Speed: Slow connections may affect AI responses
- Rate Limiting: Avoid rapid successive AI requests
🔍 Beta Debugging
MCP Logs Analysis
Common log messages and solutions:
"Server connection failed"
# Check network connectivity
# Verify Bearer token is valid
# Confirm MCP URL is correct"Tools not loaded"
# Restart Cursor IDE
# Check mcp.json syntax
# Verify file permissions"Authentication error"
# Regenerate Bearer token
# Check token placement in config
# Verify project accessConfiguration Validation
Validate your mcp.json:
# Check JSON syntax
python -m json.tool ~/.cursor/mcp.json
# Or use online JSON validatorsNetwork Debugging
Test API connectivity:
# Test API endpoint (replace with your URL and token)
curl -H "Authorization: Bearer YOUR_TOKEN" YOUR_MCP_URL/health🚀 Advanced Configuration
Multiple Projects
Connect multiple Knowledge AI projects:
{
"mcp.servers": {
"work-knowledge": {
"command": "npx",
"args": ["supergateway@latest", "-y", "--streamableHttp", "WORK_URL", "--header", "Authorization: Bearer WORK_TOKEN"]
},
"personal-knowledge": {
"command": "npx",
"args": ["supergateway@latest", "-y", "--streamableHttp", "PERSONAL_URL", "--header", "Authorization: Bearer PERSONAL_TOKEN"]
}
}
}Custom Server Names
Use descriptive names for your servers:
{
"mcp.servers": {
"my-project-docs": {
// ... configuration
},
"team-knowledge-base": {
// ... configuration
}
}
}Debugging Configuration
Add debug logging for troubleshooting:
{
"mcp.servers": {
"knowledge-ai-debug": {
"command": "npx",
"args": [
"supergateway@latest",
"-y",
"--streamableHttp",
"YOUR_URL",
"--header",
"Authorization: Bearer YOUR_TOKEN",
"--debug"
]
}
}
}💡 Best Practices
Beta Version Considerations
- Regular Updates: Keep Cursor IDE updated to latest version
- Configuration Backup: Keep a backup of working
mcp.json - Monitor Logs: Regularly check MCP logs for issues
- Feedback: Report issues to improve the integration
Effective Knowledge Organization
- Clear Documentation: Write clear, AI-friendly documentation
- Consistent Patterns: Document code patterns consistently
- Example-Rich: Include plenty of code examples
- Context Aware: Provide context for architectural decisions
AI Interaction Tips
- Specific Queries: Be specific about what you need
- Reference Context: Mention relevant documentation areas
- Iterative Development: Build on AI suggestions incrementally
- Validation: Always review AI-generated code
🔮 Future Enhancements
Expected improvements in upcoming releases:
- Improved Stability: More reliable MCP connections
- Better Error Messages: Clearer debugging information
- Enhanced AI Context: Deeper knowledge base integration
- Performance Optimizations: Faster response times
- Additional Features: More MCP tools and capabilities
📞 Support
Need help with Cursor integration?
- Email: feedback@knowledge-ai.app
- Documentation: docs.knowledge-ai.app
- Beta Feedback: docs.knowledge-ai.app/beta-feedback
Beta Support Guidelines
When reporting issues, include:
- Cursor Version: Help → About Cursor
- MCP Configuration: Your
mcp.json(remove sensitive tokens) - MCP Logs: Recent logs from Output panel
- Steps to Reproduce: Detailed reproduction steps
- Expected vs Actual: What you expected vs what happened
Quick Debug Checklist
- [ ] Cursor IDE is latest version
- [ ]
mcp.jsonfile exists in correct location - [ ] JSON syntax is valid
- [ ] Bearer token is fresh and valid
- [ ] MCP URL is correct for your project
- [ ] Cursor has been restarted after configuration
- [ ] MCP logs show connection attempts
- [ ] Network connectivity is working
Last updated: 2025-01-14Beta Status: Active development