OpenSource-Hub

claude-context

CLI Tool

zilliztech/claude-context

MCP plugin for semantic code search, giving AI agents full codebase context.

Overview

Claude Context is an MCP server that enables AI coding agents like Claude Code to semantically search entire codebases. It efficiently retrieves relevant code snippets using vector embeddings, reducing costs by avoiding full directory loading.

README Preview

\n\n> 🆕 **Looking for persistent memory for Claude Code?** Check out [memsearch Claude Code plugin](https://github.com/zilliztech/memsearch#for-claude-code-users) — a markdown-first memory system that gives your AI agent long-term memory across sessions.\n\n### Your entire codebase as Claude's context\n\n[](https://opensource.org/licenses/MIT)\n[](https://nodejs.org/)\n[](docs/)\n[](https://marketplace.visualstudio.com/items?itemName=zilliz.semanticcodesearch)\n[](https://www.npmjs.com/package/@zilliz/claude-context-core)\n[](https://www.npmjs.com/package/@zilliz/claude-context-mcp)\n[](https://twitter.com/zilliz_universe)\n[](https://deepwiki.com/zilliztech/claude-context)\n\n\n\n\n**Claude Context** is an MCP plugin that adds semantic code search to Claude Code and other AI coding agents, giving them deep context from your entire codebase.\n\n🧠 **Your Entire Codebase as Context**: Claude Context uses semantic search to find all relevant code from millions of lines. No multi-round discovery needed. It brings results straight into the Claude's context.\n\n💰 **Cost-Effective for Large Codebases**: Instead of loading entire directories into Claude for every request, which can be very expensive, Claude Context efficiently stores your codebase in a vector database and only uses related code in context to keep your costs manageable.\n\n---\n\n## 🚀 Demo\n\n\n\nModel Context Protocol (MCP) allows you to integrate Claude Context with your favorite AI coding assistants, e.g. Claude Code.\n\n## Quick Start\n\n### Prerequisites\n\n\nGet a free vector database on Zilliz Cloud 👈\n\nClaude Context needs a vector database. You can [sign up](https://cloud.zilliz.com/signup?utm_source=github&utm_medium=referral&utm_campaign=2507-codecontext-readme) on Zilliz Cloud to get an API key.\n\n\n\nCopy your Personal Key to replace `your-zilliz-cloud-api-key` in the configuration examples.\n\n\n\nGet OpenAI API Key for embedding model\n\nYou need an OpenAI API key for the embedding mode

FAQ (3)

Troubleshooting
Why does Claude Code MCP server crash with 'Address is required and could not be resolved from token' on startup?

Your Claude Code MCP configuration is missing the MILVUS_ADDRESS environment variable. Ensure you provide the Zilliz Cloud endpoint when adding the MCP server. Example:

claude mcp add claude-context \\
  -e OPENAI_API_KEY=sk-your-openai-api-key \\
  -e MILVUS_TOKEN=your-zilliz-cloud-api-key \\
  -e MILVUS_ADDRESS=your-zilliz-cloud-api-endpoint \\
  -- npx @zilliz/claude-context-mcp@latest

This prevents the 'Address is required and could not be resolved from token' error. The fix has been integrated into the latest README.

GitHub Issue #311
Troubleshooting
Why does my codebase keep force-reindexing every session after a crash?

This is a known bug in v0.1.6: the snapshot file gets stuck at 0/0 after an indexed interruption, causing an infinite reindex loop. Workaround: Edit ~/.context/mcp-codebase-snapshot.json and update ‘indexedFiles’ and ‘totalChunks’ for the affected codebase to match the actual row count in Milvus (get it via Milvus stats). A permanent fix is planned (track #295).

GitHub Issue #295
Troubleshooting
Why does claude-context still index files inside a root-level directory like /Library/ even though it's in ignore file?

claude-context does not fully interpret leading slashes (root-only matching) and trailing slashes (directory and contents) in ignore patterns. Standard tools like Git treat /Library/ as 'ignore the Library folder at the root and all its contents.' As a workaround, remove the leading slash and replace the trailing slash with /** (e.g., Library/**) or simply use Library (without slashes) to recursively ignore the directory and its files. This issue is tracked as #200.

GitHub Issue #200