Introduction
claude-context is an MCP (Model Context Protocol) server built by Zilliz that indexes your codebase into vector embeddings and exposes semantic search as a tool for Claude Code. Instead of relying on grep or file-by-file scanning, Claude can query your entire codebase by meaning, finding relevant code even when exact keywords differ.
What claude-context Does
- Indexes source code files into vector embeddings for semantic search
- Exposes search capabilities to Claude Code via the MCP protocol
- Returns ranked code snippets with file paths and line numbers for each query
- Watches for file changes and incrementally updates the index
- Supports filtering by file type, directory, and language
Architecture Overview
claude-context runs as a local MCP server that connects to Claude Code. On startup, it walks the project directory, chunks source files into meaningful segments, and embeds them using a local or remote embedding model. The embeddings are stored in a Milvus Lite vector database. When Claude issues a search query, the server embeds the query, performs approximate nearest neighbor search, and returns the top-k most relevant code snippets with their locations.
Self-Hosting & Configuration
- Run via npx for zero-install setup or install globally with npm
- Point it at any local project directory to begin indexing
- Configure embedding model choice via environment variables
- Set chunk size and overlap parameters for different codebase scales
- Add to your Claude Code MCP configuration for automatic startup
Key Features
- Semantic code search that understands intent, not just keywords
- Built on Milvus Lite for efficient local vector storage and retrieval
- Incremental indexing that updates only changed files
- Language-aware chunking that respects function and class boundaries
- Low latency retrieval suitable for interactive coding sessions
Comparison with Similar Tools
- Codebase Memory MCP — Builds a knowledge graph of code relationships, while claude-context focuses on vector-based semantic search
- Sourcegraph — Full-featured code intelligence platform, while claude-context is a lightweight local-first MCP server
- grep/ripgrep — Exact string matching only, while claude-context finds semantically similar code regardless of naming
- GitHub Copilot — Integrated into editors with its own retrieval, while claude-context is an open MCP server for Claude Code
FAQ
Q: How large a codebase can it handle? A: claude-context handles repositories with hundreds of thousands of files efficiently using Milvus Lite's optimized indexing.
Q: Does it send my code to external servers? A: When using a local embedding model, all processing happens on your machine. Remote embedding APIs send code chunks to the provider.
Q: How do I add it to Claude Code? A: Add the server configuration to your Claude Code MCP settings file, and it starts automatically when you open a project.
Q: Does it support monorepos? A: Yes, you can configure it to index specific subdirectories or the entire monorepo, with filtering by path prefix.