Skip to main content

Overview

Integrate CodeAlive with Claude Code to enhance your AI coding assistant with deep contextual understanding of your entire codebase. This integration uses the Model Context Protocol (MCP) to provide Claude Code with semantic search and code intelligence capabilities.
Quick install: Run npx @codealive/installer to automatically configure CodeAlive for Claude Code. See the Installation Guide for details.

Prerequisites

  • Claude Pro, Max, Team, or Enterprise subscription (required for MCP support)
  • Claude Code installed
  • CodeAlive account with API key (Sign up here)
  • Indexed repositories in your CodeAlive dashboard

Installation Steps

Claude Code supports both local and remote MCP servers with OAuth authentication.
1

Add via CLI (Recommended)

Run this command in your terminal:
claude mcp add --transport http codealive https://mcp.codealive.ai/api --header "Authorization: Bearer YOUR_API_KEY_HERE"
Replace YOUR_API_KEY_HERE with your actual CodeAlive API key.
2

Alternative: Docker (STDIO)

For local development or enhanced privacy:
claude mcp add codealive-docker /usr/bin/docker run --rm -i -e CODEALIVE_API_KEY=YOUR_API_KEY_HERE ghcr.io/codealive-ai/codealive-mcp:v0.3.0
3

Verify Integration

Test the integration by asking Claude Code:
  • “What CodeAlive repositories are available?”
  • “Search for authentication code in my codebase”
  • “Explain the architecture of my project”

Available Commands

Once integrated, Claude Code can use these CodeAlive capabilities:

Repository Management

"Show me all my indexed repositories"
"What codebases are connected to CodeAlive?"
"Update the repository index"
"Find all API endpoints in the user service"
"Show me error handling patterns across the codebase"
"Locate database connection implementations"
"Search for OAuth implementation"

Contextual Analysis

"Explain how the payment flow works"
"Analyze this code for security vulnerabilities"
"Generate comprehensive tests for the AuthService"
"Review the authentication implementation"

Usage Patterns

You: "Help me understand how the user authentication works"

Claude Code: [Searches your codebase for authentication logic]
            [Maps out the authentication flow]
            [Explains with actual code references]

Advanced Features

Multi-Repository Support

CodeAlive automatically provides access to all repositories indexed in your dashboard. Use the get_data_sources tool to discover available repositories and workspaces, then target specific ones in your searches:
"Search for authentication code in the backend repository"
"Find user models across backend, frontend, and mobile repos"
"Show me API patterns in workspace:platform-team"
See Multi-Repository & Workspaces for details on organizing repositories.

Custom Search Scopes

Focus searches on specific parts of your codebase:
"Search for user models only in the backend repository"
"Find React components in the frontend folder"
"Look for migrations in the database directory"

Intelligent Code Reviews

"Review this PR for consistency with our codebase"
"Check if this change follows our patterns"
"Find potential breaking changes"

Best Practices

Keep Repos Updated

Regularly sync repositories in CodeAlive dashboard for accurate context

Use Specific Queries

Be precise with technical terms for better search results

Leverage Context

Reference CodeAlive when working with large codebases

Iterate Quickly

Use CodeAlive to validate ideas before implementing

Productivity Tips

Use slash commands for common operations:
  • /search - Quick code search
  • /explain - Get explanations with context
  • /similar - Find similar implementations
  • /repos - List available repositories
  • Clear context between unrelated tasks
  • Use CodeAlive to establish context for new features
  • Reference specific files when needed
  • Always search for existing patterns first
  • Let Claude Code match your coding style
  • Verify generated code against your conventions

Troubleshooting

Solutions:
  1. Check MCP server status in Claude Code
  2. Verify API key is correct and active
  3. Ensure repositories are indexed
  4. Try reloading Claude Code
Solutions:
  1. Log into CodeAlive dashboard
  2. Verify repositories are indexed
  3. Wait for indexing to complete
  4. Check API key permissions
Solutions:
  1. Use more specific search queries
  2. Limit search to specific repositories
  3. Check CodeAlive service status
  4. Consider upgrading your plan
Solutions:
  1. Regenerate API key in dashboard
  2. Update MCP configuration
  3. Ensure Bearer token format is correct
  4. Test API key with curl
For more solutions, see the Troubleshooting Guide.

Integration with Claude Code Features

Projects

  • CodeAlive automatically understands your project structure
  • Provides context across multiple files and folders
  • Maintains awareness of dependencies and imports

Custom Instructions

Add to your Claude Code custom instructions:
Always use CodeAlive to:
1. Search for existing implementations before writing new code
2. Follow established patterns in the codebase
3. Verify imports and dependencies exist
4. Find related tests that need updates

Code Review Mode

When reviewing code:
"Use CodeAlive to check if this follows our patterns"
"Find similar code that might need the same fix"
"Identify all places affected by this change"