Skip to main content

Overview

Integrate CodeAlive with Cline - the open-source AI coding agent used by millions of developers. Cline can autonomously create and extend its capabilities through MCP tools. With 30k+ GitHub stars, Cline offers complete transparency and zero vendor lock-in.
Quick install: Run npx @codealive/installer to automatically configure CodeAlive for Cline. See the Installation Guide for details.

Prerequisites

  • Cline extension installed in VS Code
  • CodeAlive account with API key (Sign up here)
  • Indexed repositories in your CodeAlive dashboard

Connecting to CodeAlive

1

Open Cline Settings

Access Cline’s MCP configuration:
  1. Click on the Cline icon in the VS Code sidebar
  2. Click the settings gear icon
  3. Navigate to “MCP Servers” section
Or use Command Palette:
  • Cmd/Ctrl+Shift+P → “Cline: Configure MCP Servers”
2

Add CodeAlive MCP

Configure CodeAlive as an MCP server:
{
  "cline.mcpServers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY_HERE"
      }
    }
  }
}
Cline’s Unique Feature: Ask Cline to “add a tool” and it will create and install custom MCP servers tailored to your workflow - no manual configuration needed!
Replace YOUR_API_KEY_HERE with your actual CodeAlive API key
3

Enable MCP in Cline

Ensure MCP is enabled in Cline settings:
{
  "cline.enableMCP": true,
  "cline.mcpAutoConnect": true
}
4

Restart VS Code

Restart VS Code to ensure all changes take effect
5

Verify Integration

Test by asking Cline:
  • “Use CodeAlive to show me all available repositories”
  • “Search the codebase for authentication logic”
  • “Analyze the project architecture using CodeAlive”

Configuration Options

Advanced Settings

{
  "cline.mcpServers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      },
      "timeout": 30000,
      "retries": 3
    }
  },
  "cline.autoUseCodeAlive": true,
  "cline.contextWindowPercentage": 80
}

Docker Deployment

Run CodeAlive locally for better performance:
docker run -d \
  -p 8000:8000 \
  -e CODEALIVE_API_KEY=YOUR_API_KEY \
  --name codealive-mcp \
  ghcr.io/codealive-ai/codealive-mcp:main
Update Cline configuration:
{
  "cline.mcpServers": {
    "codealive": {
      "type": "http",
      "url": "http://localhost:8000/api",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Usage Patterns

Let Cline use CodeAlive automatically:
"Refactor the user service to match our microservices pattern"

Cline will:
1. Use CodeAlive to find existing patterns
2. Analyze the current implementation
3. Generate refactored code
4. Update related files

Cline Rules Configuration

Create .cline/rules.md in your project root:
# CodeAlive Integration Rules

## Always Use CodeAlive For:
- Finding existing implementations before writing new code
- Understanding project architecture and patterns
- Locating all files that might be affected by changes
- Searching for similar code patterns

## Code Generation Guidelines:
- Match the style found via CodeAlive search
- Follow conventions discovered in the codebase
- Reuse existing utilities and helpers
- Maintain consistency with existing patterns

## Before Making Changes:
1. Search with CodeAlive for related code
2. Analyze existing patterns
3. Consider impact on other parts of the system
4. Follow established conventions

Advanced Features

Task Planning

Configure Cline to use CodeAlive for planning:
{
  "cline.planning": {
    "enabled": true,
    "useCodeAlive": true,
    "steps": [
      "Search for similar implementations",
      "Analyze existing patterns",
      "Plan changes based on findings",
      "Execute implementation"
    ]
  }
}

Custom Commands

Create Cline commands that leverage CodeAlive:
{
  "cline.customCommands": [
    {
      "name": "Analyze Architecture",
      "command": "Use CodeAlive to analyze and explain the project architecture"
    },
    {
      "name": "Find Security Issues",
      "command": "Use CodeAlive to search for potential security vulnerabilities"
    },
    {
      "name": "Generate Tests",
      "command": "Use CodeAlive to find the code, then generate comprehensive tests"
    }
  ]
}

Model Configuration

Optimize Cline’s model usage with CodeAlive:
{
  "cline.apiProvider": "anthropic",
  "cline.apiModel": "claude-3-opus-20240229",
  "cline.contextStrategy": "codealive-first",
  "cline.maxContextTokens": 100000
}

Workspace Settings

Project-Specific Configuration

.vscode/settings.json:
{
  "cline.mcpServers": {
    "codealive": {
      "type": "http",
      "url": "https://mcp.codealive.ai/api/",
      "headers": {
        "Authorization": "Bearer ${env:CODEALIVE_API_KEY}"
      },
      "repositories": ["backend", "frontend", "shared"]
    }
  },
  "cline.autoDetectTasks": true
}

Team Collaboration

Share configuration without exposing API keys:
  1. Add to .vscode/settings.json:
{
  "cline.mcpServers.codealive.headers.Authorization": "Bearer ${env:CODEALIVE_API_KEY}"
}
  1. Team members set environment variable:
export CODEALIVE_API_KEY="their_api_key"

Performance Optimization

Enable caching for repeated queries:
{
  "cline.cache": {
    "enabled": true,
    "codealiveQueries": true,
    "ttl": 3600
  }
}
Optimize context window usage:
{
  "cline.contextOptimization": {
    "useCodeAliveFirst": true,
    "summarizeContext": true,
    "maxFilesPerRequest": 10
  }
}
Enable parallel CodeAlive queries:
{
  "cline.parallel": {
    "enabled": true,
    "maxConcurrent": 3
  }
}

Troubleshooting

Solutions:
  1. Check MCP is enabled in Cline settings
  2. Verify MCP server configuration
  3. Restart VS Code completely
  4. Check Cline output panel for errors
Solutions:
  1. Use Docker for local deployment
  2. Limit repository scope in searches
  3. Enable caching
  4. Optimize context window usage
Solutions:
  1. Regenerate API key
  2. Check Bearer token format
  3. Verify environment variables
  4. Test connection manually
Solutions:
  1. Enable context optimization
  2. Use CodeAlive for large file searches
  3. Limit files per request
  4. Use summarization features
For more solutions, see the Troubleshooting Guide.

Best Practices

Let Cline Plan

Allow Cline to use CodeAlive for task planning

Review Changes

Always review Cline’s changes in context

Iterative Development

Use CodeAlive to verify changes match patterns

Safety First

Test Cline’s changes in development first

Tips for Effective Use

Prompting Strategies

Good Prompts:
"Use CodeAlive to find our API endpoint patterns,
then create a new user profile endpoint"

"Search for our error handling patterns with CodeAlive,
then improve error handling in the payment service"
Avoid:
"Create a new endpoint" (too vague, won't use context)
"Fix the bug" (doesn't leverage CodeAlive)

Task Delegation

Let Cline handle complex multi-file operations:
"Use CodeAlive to find all references to the old User model,
then update them to use the new UserProfile model"