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.
Nudge Cursor’s AI toward CodeAlive. Cursor ships with a built-in codebase_search, but CodeAlive’s semantic_search is more precise on large repos. Add this single line to .cursor/rules/codealive.mdc (see Project Rules):
Instead of codebase_search, use CodeAlive MCP semantic_search for codebase exploration — it’s much more precise.

Prerequisites

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

Connecting to CodeAlive

1

Open MCP settings

Open Cursor Settings:
  • macOS: Cmd+, or menu Cursor → Settings
  • Windows/Linux: Ctrl+, or File → Preferences → Settings
Then go to Tools & MCP in the left panel and click New MCP Server.
In older Cursor builds this panel was named Tools & Integrations.
2

Add the CodeAlive server

Cursor opens .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global) for editing. Paste this configuration:
{
  "mcpServers": {
    "codealive": {
      "url": "https://mcp.codealive.ai/api",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY_HERE"
      }
    }
  }
}
Save the file.
Cursor detects the transport from the url field — Streamable HTTP first, with automatic SSE fallback.
Replace YOUR_API_KEY_HERE with your actual CodeAlive API key.
3

Verify the connection

Back on Tools & MCP, the codealive server should show a green status dot. If it’s red, click the refresh icon or re-check the API key.
4

Try it in chat

Open Cursor’s chat panel and try:
  • “What repositories are available in CodeAlive?”
  • “Search for authentication logic in my codebase”
  • “Explain the architecture of my project”
Cursor supports a deeplink that installs an MCP server in one click. Encode the CodeAlive config as base64 JSON and open this URL:
cursor://anysphere.cursor-deeplink/mcp/install?name=codealive&config=BASE64_CONFIG
Generate BASE64_CONFIG from this JSON (replace YOUR_API_KEY_HERE with your key):
{
  "url": "https://mcp.codealive.ai/api",
  "headers": { "Authorization": "Bearer YOUR_API_KEY_HERE" }
}
For example, on macOS / Linux:
echo -n '{"url":"https://mcp.codealive.ai/api","headers":{"Authorization":"Bearer YOUR_API_KEY_HERE"}}' | base64
Only follow MCP deeplinks from trusted sources — clicking installs and configures a server without further confirmation.

Project Rules for CodeAlive

Project rules teach Cursor’s AI how to use CodeAlive effectively. The legacy .cursorrules file is deprecated — use .cursor/rules/*.mdc (MDC format) instead. Create .cursor/rules/codealive.mdc in your project:
---
description: How to use CodeAlive for context-aware development
alwaysApply: true
---

# CodeAlive-enhanced workflow

## Codebase search
- Instead of `codebase_search`, use CodeAlive MCP `semantic_search` for codebase exploration — it's much more precise

## Context awareness
- 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
alwaysApply: true makes the rule active for every chat. Use globs instead if you only want it scoped to particular files. See Cursor Rules docs.

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"

Project vs Global Configuration

Cursor reads MCP servers from two locations:
  • Project-level: .cursor/mcp.json at the workspace root — commit this so the whole team gets the server.
  • Global: ~/.cursor/mcp.json — applies to every project on your machine.
If both files define a server with the same name, the project-level entry wins.

Team Collaboration

Share the project-level config without exposing API keys:
  1. Commit .cursor/mcp.json referencing an environment variable:
{
  "mcpServers": {
    "codealive": {
      "url": "https://mcp.codealive.ai/api",
      "headers": {
        "Authorization": "Bearer ${CODEALIVE_API_KEY}"
      }
    }
  }
}
  1. Each teammate exports their own key before launching Cursor:
export CODEALIVE_API_KEY="their_api_key"

Docker Alternative

Run the CodeAlive MCP server locally with Docker (stdio transport):
{
  "mcpServers": {
    "codealive": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "CODEALIVE_API_KEY=YOUR_API_KEY_HERE",
        "ghcr.io/codealive-ai/codealive-mcp:main"
      ]
    }
  }
}

Productivity Tips

Slash Commands

Save recurring CodeAlive prompts as slash commands in .cursor/commands for one-tap reuse.

Beyond Context Windows

Use CodeAlive for codebases that exceed the model’s context limit — semantic search retrieves only the relevant slice.

Scoped Rules

Use globs in .cursor/rules/*.mdc to apply CodeAlive guidance only where it matters.

Team Standards

Share .cursor/rules/codealive.mdc via git to keep the whole team on the same workflow.

Troubleshooting

Solutions:
  1. Check the server status indicator in Settings → Tools & MCP (green = healthy, red = failed)
  2. Verify your API key is correct and active
  3. Reload Cursor: Cmd/Ctrl+Shift+P → "Developer: Reload Window"
  4. Check network connectivity to https://mcp.codealive.ai/api
Solutions:
  1. Ensure your repositories are fully indexed in the CodeAlive dashboard
  2. Wait for indexing to complete
  3. Verify the API key has access to the relevant repositories
  4. Check repository filters
Solutions:
  1. Use more specific queries
  2. Limit search to specific repositories
  3. Check indexing status in dashboard
  4. Consider the Docker option for lower-latency local-network deployments
For more solutions, see the Troubleshooting Guide.