Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Multi-provider embedding MCP server with local Milvus for semantic code search. Works with Claude Code, Cursor, Windsurf, and other MCP-compatible IDEs.

README.md

Code Context MCP

A multi-provider embedding MCP server with local Milvus for semantic code search. Works with Claude Code, Cursor, Windsurf, and other MCP-compatible IDEs.

Features

  • Multi-provider embeddings: Local Qwen (free), OpenAI, or DeepSeek
  • Dimension mismatch detection: Warns before indexing if dimensions don't match
  • Zero cloud dependency: Use local Qwen for completely offline operation
  • Dual deployment: Docker or local with pnpm

Architecture

┌─────────────────┐     ┌────────────────────┐     ┌─────────────────┐
│  Your Codebase  │────▶│  Embedding Provider │────▶│  Local Milvus   │
│                 │     │  (Qwen/OpenAI/etc) │     │  (Vector Store) │
└─────────────────┘     └────────────────────┘     └─────────────────┘
         │                                                  │
         │         ┌────────────────────────────┐          │
         └────────▶│     code-context-mcp       │◀─────────┘
                   │       (MCP Server)         │
                   └────────────────────────────┘
                            │
              ┌─────────────┴─────────────┐
              ▼             ▼             ▼
        Claude Code      Cursor      Windsurf

Quick Start

Option A: Docker (Recommended)

# 1. Configure
cp .env.example .env
# Edit .env with your settings

# 2. Start all services
docker-compose up -d

# 3. Verify (~60 seconds to initialize)
curl http://localhost:9091/healthz   # Milvus
curl http://localhost:3100/health    # MCP Server

IDE Configuration (Docker): ``json { "mcpServers": { "code-context": { "url": "http://localhost:3100/sse" } } } ``

Option B: Local Development

# 1. Start only Milvus in Docker
docker-compose up -d milvus

# 2. Install and build
pnpm install
pnpm build

# 3. Configure IDE (see below)

IDE Configuration (Local): ``json { "mcpServers": { "code-context": { "command": "node", "args": ["/path/to/code-context-mcp/dist/index.js"], "env": { "EMBEDDING_PROVIDER": "qwen-local", "QWEN_LOCAL_BASE_URL": "http://172.18.35.123:8001/v1", "QWEN_LOCAL_MODEL": "Qwen3-Embedding-4B", "MILVUS_ADDRESS": "127.0.0.1:19530" } } } } ``

MCP Tools

| Tool | Description | |------|-------------| | index_codebase | Index a directory into Milvus | | search_code | Semantic search across indexed code | | check_dimensions | Check provider/collection dimension compatibility | | drop_collection | Delete a collection (for re-indexing) | | get_provider_info | Show current provider configuration |

Usage: `` index_codebase /path/to/your/project search_code "authentication logic" check_dimensions ``

Embedding Providers

| Provider | Model | Dimensions | Cost | |----------|-------|------------|------| | qwen-local | Qwen3-Embedding-4B | 2560 | Free | | openai | text-embedding-3-small | 1536 | $0.02/1M tokens | | openai | text-embedding-3-large | 3072 | $0.13/1M tokens | | deepseek | deepseek-embedding-v2 | 768 | Paid |

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | EMBEDDING_PROVIDER | openai, qwen-local, deepseek | openai | | MILVUS_ADDRESS | Milvus server address | 127.0.0.1:19530 | | DIMENSION_CHECK_ENABLED | Check dimensions before indexing | true | | MCP_TRANSPORT | stdio or http | stdio | | MCP_PORT | HTTP port (http mode) | 3100 |

Provider-specific:

| Provider | Variables | |----------|-----------| | Local Qwen | QWEN_LOCAL_BASE_URL, QWEN_LOCAL_MODEL | | OpenAI | OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_EMBEDDING_MODEL | | DeepSeek | DEEPSEEK_API_KEY, DEEPSEEK_BASE_URL, DEEPSEEK_EMBEDDING_MODEL |

Dimension Mismatch Handling

Different providers produce different dimensions. Switching providers requires re-indexing:

drop_collection code_context confirm=true
index_codebase /path/to/project

Docker Commands

docker-compose up -d              # Start all
docker-compose up -d milvus       # Start only Milvus
docker-compose logs -f            # View logs
docker-compose down               # Stop all
docker-compose down -v            # Reset (delete data)
docker-compose build --no-cache   # Rebuild

Local Development

pnpm install    # Install dependencies
pnpm build      # Build TypeScript
pnpm dev        # Run in dev mode
pnpm start      # Run production build

Project Structure

code-context-mcp/
├── docker-compose.yml      # Milvus + MCP server
├── Dockerfile
├── package.json
├── tsconfig.json
├── .env.example
└── src/
    ├── index.ts            # Entry point (stdio + HTTP)
    ├── config.ts           # Configuration
    ├── providers/          # Embedding providers
    │   ├── base.ts
    │   ├── openai.ts
    │   ├── qwen-local.ts
    │   └── deepseek.ts
    ├── milvus/             # Milvus integration
    │   ├── client.ts
    │   └── dimension-checker.ts
    └── tools/              # MCP tools
        ├── index-codebase.ts
        ├── search-code.ts
        └── check-dimensions.ts

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.