Skip to content

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

  1. Navigate to your project's API Keys section in Knowledge AI
  2. Generate a new Bearer token for Cursor integration
  3. Copy the token - you'll need it in step 4

Step 2: Locate Cursor MCP Configuration

macOS:

~/.cursor/mcp.json

Windows:

%USERPROFILE%\.cursor\mcp.json

Linux:

~/.cursor/mcp.json

Step 3: Create or Edit MCP Configuration

Create or edit the mcp.json file with the following configuration:

json
{
  "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_ID with your actual project ID
  • Replace YOUR_PROJECT_MCP_URL with your project's MCP URL
  • Replace YOUR_BEARER_TOKEN_HERE with 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

  1. Open Cursor IDE
  2. Check the Output panel (View → Output)
  3. Select "MCP Logs" from the dropdown
  4. Look for successful connection messages

✅ Verification Steps

Check MCP Status

  1. Output Panel: View → Output → "MCP Logs"
  2. Connection Messages: Look for successful server connection
  3. Error Messages: Check for any configuration issues

Test Integration

  1. AI Chat: Open Cursor's AI chat
  2. Knowledge Queries: Ask about content from your knowledge base
  3. 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

typescript
// Cursor AI can now reference your:
// - Architecture decisions
// - Code patterns and standards
// - API documentation
// - Deployment procedures
// - Best practices and lessons learned

Project-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

  1. Check Configuration: Verify mcp.json syntax is correct
  2. File Location: Ensure mcp.json is in the correct directory
  3. Restart Cursor: Completely close and reopen Cursor
  4. Check Logs: Review MCP logs for detailed error messages

Tools Not Appearing

  1. Wait Time: Initial connection may take 30-60 seconds
  2. Restart Required: Close and restart Cursor IDE
  3. Configuration Reload: Edit and save mcp.json to trigger reload
  4. Network Issues: Check internet connectivity and firewall

Authentication Issues

  1. Token Validation: Regenerate Bearer token if expired
  2. Format Check: Ensure token format is correct in configuration
  3. Permissions: Verify token has proper project access
  4. API Status: Check Knowledge AI service status

Performance Issues

  1. Large Projects: Be specific in AI queries to improve response time
  2. Memory Usage: Monitor Cursor's memory consumption
  3. Network Speed: Slow connections may affect AI responses
  4. Rate Limiting: Avoid rapid successive AI requests

🔍 Beta Debugging

MCP Logs Analysis

Common log messages and solutions:

"Server connection failed"

bash
# Check network connectivity
# Verify Bearer token is valid
# Confirm MCP URL is correct

"Tools not loaded"

bash
# Restart Cursor IDE
# Check mcp.json syntax
# Verify file permissions

"Authentication error"

bash
# Regenerate Bearer token
# Check token placement in config
# Verify project access

Configuration Validation

Validate your mcp.json:

bash
# Check JSON syntax
python -m json.tool ~/.cursor/mcp.json

# Or use online JSON validators

Network Debugging

Test API connectivity:

bash
# 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:

json
{
  "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:

json
{
  "mcp.servers": {
    "my-project-docs": {
      // ... configuration
    },
    "team-knowledge-base": {
      // ... configuration
    }
  }
}

Debugging Configuration

Add debug logging for troubleshooting:

json
{
  "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?

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.json file 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

Built with VitePress