Skip to main content

Overview

Connect CodeAlive with Cursor IDE to enhance your AI-powered development experience. CodeAlive provides Cursor with deep contextual understanding of your entire codebase through the Model Context Protocol (MCP).
Quick install: Run npx @codealive/installer to automatically configure CodeAlive for Cursor. See the Installation Guide for details.

Prerequisites

  • Cursor installed
  • CodeAlive account with API key (Sign up here)
  • Indexed repositories in your CodeAlive dashboard

Connecting to CodeAlive

1

Open Cursor Settings

Navigate to Cursor’s MCP settings:
  • macOS: Cmd+Shift+P → “MCP: Configure Servers”
  • Windows/Linux: Ctrl+Shift+P → “MCP: Configure Servers”
  • Or navigate through: Settings → Features → MCP
2

Add CodeAlive Server

Cursor supports MCP with elicitation and resources:Option 1: Project-specific (.cursor/mcp.json):
{
  "servers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer ${CODEALIVE_API_KEY}"
      }
    }
  }
}
Option 2: Global (~/.cursor/mcp.json):
{
  "servers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY_HERE"
      }
    }
  }
}
Cursor’s Composer Agent automatically uses MCP tools when relevant
Replace YOUR_API_KEY_HERE with your actual CodeAlive API key
3

Reload Cursor

Reload the Cursor window for changes to take effect:
  • All platforms: Cmd/Ctrl+R or “Developer: Reload Window”
4

Verify Integration

Test in Cursor’s AI chat:
  • “What repositories are available in CodeAlive?”
  • “Search for authentication logic in my codebase”
  • “Explain the architecture of my project”

Cursor Rules Configuration

Create a .cursorrules file in your project root to optimize Cursor’s AI with CodeAlive:
# CodeAlive-Enhanced Cursor Rules

## Context Awareness
- Always use CodeAlive to search for existing implementations before writing new code
- Reference actual code from the repository when explaining concepts
- Check for existing patterns and conventions in the codebase

## Code Generation
- Match the style and patterns found in the existing codebase
- Use CodeAlive to find similar code and follow those conventions
- Verify imports and dependencies exist in the project

## Code Review
- Search for related code that might be affected by changes
- Check for existing tests that need updates
- Look for similar implementations to ensure consistency

## Debugging
- Use CodeAlive to trace function calls and data flow
- Search for error handling patterns in the codebase
- Find related logs and debugging statements

Usage Patterns

Cursor AI: "Complete this function based on our codebase patterns"

// Cursor analyzes existing patterns via CodeAlive
// and suggests completions matching your style

Advanced Features

Multi-File Operations

Cursor can use CodeAlive to work across multiple files:
"Show me all files that import UserService"
"Find all API endpoints that call this function"
"List database migrations related to users"
"What will break if I change this interface?"
"Find all tests affected by this change"
"Show usage of this deprecated method"
"Find similar error handling patterns"
"Show all authentication middleware"
"Locate all database transactions"

Workspace Configuration

Project-Specific Settings

Create .cursor/settings.json in your project:
{
  "mcp.servers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer ${env:CODEALIVE_API_KEY}"
      },
      "repositories": ["repo-1", "repo-2"]
    }
  }
}

Team Collaboration

Share configuration with your team:
  1. Add to version control (without API keys)
  2. Team members set environment variable:
export CODEALIVE_API_KEY="their_api_key"

Docker Alternative

Run CodeAlive locally with Docker:
docker run -d \
  -p 8000:8000 \
  -e CODEALIVE_API_KEY=YOUR_API_KEY \
  --name codealive-mcp \
  ghcr.io/codealive-ai/codealive-mcp:main
Then update Cursor configuration:
{
  "servers": {
    "codealive": {
      "type": "http",
      "url": "http://localhost:8000/api",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Productivity Tips

Quick Commands

Create custom Cursor commands for CodeAlive operations

Context Windows

Use CodeAlive for codebases exceeding context limits

Model Selection

Use GPT-4 for complex analysis, GPT-3.5 for quick searches

Team Standards

Document conventions in .cursorrules

Troubleshooting

Solutions:
  1. Check MCP server status in Cursor console
  2. Verify API key is correct and active
  3. Reload Cursor window (Cmd/Ctrl+R)
  4. Check network connectivity
Solutions:
  1. Ensure repositories are fully indexed
  2. Wait for indexing to complete
  3. Verify API key has repository access
  4. Check specific repository filters
Solutions:
  1. Use more specific queries
  2. Limit search to specific repositories
  3. Check indexing status in dashboard
  4. Consider Docker deployment
For more solutions, see the Troubleshooting Guide.