Claude Context — Semantic Code Search MCP for AI Coding Agents
Make your entire codebase the context for any coding agent with semantic code search.
- Source repo
- zilliztech/claude-context
- Stars
- ★ 13k
- Last updated
- 3mo ago
- License
- MIT
- Primary language
- TypeScript
- FA score
- 49/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changesCodex · Claude Code · OpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- A developer working on a large or unfamiliar codebase wants to quickly locate functions implementing specific behavior without manual grep.
- Not a fit if
- Users wanting zero-config setup without managing a vector database and API keys
- Projects outside Node.js 20+ or unwilling to depend on an external vector database
- Source review
- 49/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
Claude Context is an MCP plugin that adds semantic code search to Claude Code and other AI coding assistants, providing deep context from your entire codebase. It indexes code into a vector database and retrieves only relevant snippets, reducing token usage and cost while maintaining retrieval quality. The repository is a monorepo containing the core indexing engine (@zilliz/claude-context-core), the MCP server (@zilliz/claude-context-mcp), and a VS Code extension. It supports hybrid search (BM25 + dense vectors), incremental indexing via Merkle trees, and AST-based code chunking. Deployment requires an OpenAI embedding API key and a Milvus or Zilliz Cloud vector database. The MCP server follows the standard MCP protocol with stdio transport, integrating with multiple clients such as Claude Code, Codex CLI, Cursor, and more.
Claude Context takes a codebase directory as input, splits files into chunks, generates embeddings using OpenAI models, and stores them in a Milvus/Zilliz Cloud vector database. It exposes MCP tools: index_codebase, search_code, clear_index, and get_indexing_status. On search, it performs hybrid retrieval (BM25 + dense vectors) to return relevant code snippets with file paths, line numbers, and content. Core classes include Context, MilvusVectorDatabase, and OpenAIEmbedding. The MCP server runs via npx @zilliz/claude-context-mcp, and configuration uses environment variables OPENAI_API_KEY, MILVUS_ADDRESS, and MILVUS_TOKEN.
- A developer working on a large or unfamiliar codebase wants to quickly locate functions implementing specific behavior without manual grep.
- An engineering team wants to reduce token costs when using Claude Code on big repos by loading only relevant code into context.
- A team using multiple AI coding assistants (e.g., Cursor, Gemini CLI) needs a standardized MCP-based semantic search across tools.
- A developer maintaining a fast-moving codebase needs incremental indexing to keep the semantic index up to date efficiently.
- A VS Code user wants to search code using natural language within the IDE and see results with line numbers directly.
How do you install or deploy this agent?
Prerequisites: Node.js >= 20; obtain an OpenAI API key; set up a Zilliz Cloud instance (or Milvus) and get the public endpoint and API token.
For Claude Code, run:
claude mcp add claude-context \
-e OPENAI_API_KEY=sk-your-openai-api-key \
-e MILVUS_ADDRESS=your-zilliz-cloud-public-endpoint \
-e MILVUS_TOKEN=your-zilliz-cloud-api-key \
-- npx @zilliz/claude-context-mcp@latestFor other clients (Codex CLI, Gemini CLI, Cursor, etc.), see the README sections with configuration snippets.
How do you use this agent?
- Start Claude Code in your project directory (
cd your-project && claude). - Type
Index this codebaseto index. - Check status with
Check the indexing status. - Ask questions like
Find functions that handle user authentication.
You can also use the core package programmatically in TypeScript:
import { Context, MilvusVectorDatabase, OpenAIEmbedding } from '@zilliz/claude-context-core';
const embedding = new OpenAIEmbedding({ apiKey: 'your-openai-api-key', model: 'text-embedding-3-small' });
const vectorDatabase = new MilvusVectorDatabase({ address: 'your-zilliz-cloud-public-endpoint', token: 'your-zilliz-cloud-api-key' });
const context = new Context({ embedding, vectorDatabase });
const stats = await context.indexCodebase('./your-project', (progress) => {});
const results = await context.semanticSearch('./your-project', 'vector database operations', 5);What are this agent's strengths and limitations?
- Hybrid search (BM25 + dense vectors) yields relevant and context-rich results.
- Incremental indexing with Merkle trees reduces re-indexing overhead.
- AST-based code chunking improves understanding and supports many languages.
- MCP protocol allows integration with many AI coding tools, including Claude Code, Codex, Cursor.
- Evaluation shows ~40% token reduction with equivalent retrieval quality, saving costs.
- Requires external vector database (Zilliz Cloud or Milvus) and OpenAI API key, not fully local.
- Setup involves multiple configuration steps and API key management.
- Potential vendor lock-in with Zilliz Cloud, though Milvus offers an open-source alternative.
- Node.js-only runtime may limit adoption in non-Node.js environments.
How does this agent compare with similar options?
Claude Context is compared with other coding tools like Serena, Context7, or DeepWiki in the FAQ; unlike these, it emphasizes hybrid search and incremental indexing for codebase context.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Claude Context — Semantic Code Search MCP for AI Coding Agents This agent | 49 · Major gaps | MCP serverFree + model costs | ★ 13k | 3mo ago | TypeScript | Codex · Claude Code · OpenAI API |
| CocoIndex Code | 52 · Major gaps | CLIFree + model costs | ★ 2.9k | 12d ago | Python | Codex · Claude Code · OpenAI API |
| Compartment | 76 · Good | CLIFree | ★ 583 | 1d ago | Python | Codex · Claude Code |
| myc Local Agent Memory | 87 · Good | CLIFree | ★ 14 | today | TypeScript | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows: MCP server receives API keys via environment variables, no hardcoded credentials found; but no user confirmation mechanism, limited data flow transparency (only states sending to vector DB and embedding service), sensitive data handling not detailed, dependency security not audited, external effects (e.g., indexing entire codebase) not explicitly warned, rollback mechanism absent, source attribution partially via README and package.json author field. Deductions: lack of user confirmation, data flow details, sensitive data protection, dependency audit, external effect warnings, rollback.
Evidence shows: README and package.json descriptions consistent, build scripts and CI config present, dependencies declared clearly, but failure messages not detailed in docs. Deduction: insufficient failure message documentation.
Evidence shows: README provides config examples for multiple MCP clients, supports multiple embedding providers and vector DBs, file inclusion/exclusion rules customizable, environment requirements clear. Deductions: capability boundaries (e.g., supported languages) listed but not deeply explained, trigger precision (e.g., indexing commands) not detailed.
Evidence shows: README well-structured, install notes detailed, naming consistent, examples and FAQ provided, MIT license clear, but version changelog absent, maintenance responsibility only partially via GitHub repo and author info. Deductions: missing changelog, unclear maintenance responsibility.
Evidence shows: README claims ~40% token reduction, provides usage examples, but no detailed cost-benefit analysis. Deduction: insufficient cost-benefit analysis.
Evidence shows: Claims (e.g., token reduction) lack detailed data or methodology, evaluation directory exists but not shown in provided files, facts and inferences not clearly separated. Deductions: claims lack traceability, insufficient cross-validation.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- This tool sends codebase content to external vector database and embedding services, posing potential sensitive code leakage risks; ensure trusted providers and proper access controls.
- No user confirmation mechanism; tool may automatically index entire codebase; use with caution in sensitive environments.
- Dependency security not audited; recommend regular vulnerability checks.