# Claude Context — Semantic Code Search MCP > Claude Context is an MCP server for semantic code search, so agents can retrieve relevant code without stuffing whole folders into the prompt. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use 1. Install / set up: ```bash 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@latest ``` 2. Start / smoke test: ```bash # In Claude Code /mcp ``` 3. Verify: - Index one repo and run a natural-language search (e.g., auth handlers). Confirm results are returned and referenced in answers. ## Intro Claude Context is an MCP server for semantic code search, so agents can retrieve relevant code without stuffing whole folders into the prompt. - **Best for:** Teams with medium/large codebases who want retrieval-first context for agents - **Works with:** Claude Code MCP; runs via `npx @zilliz/claude-context-mcp@latest` with env vars - **Setup time:** 15 minutes ## Practical Notes - Setup time ~15 minutes (configure env + add MCP server + index once) - Measurable check: 1 indexed codebase + successful `search_code` results - GitHub stars + forks (verified): see Source & Thanks This is a good fit when you find yourself doing expensive “context stuffing”: - Instead of pasting directories, index once and retrieve by query. - Prefer a repeatable workflow: index → search → cite code locations. - Keep the search layer separate from generation so you can swap models without re-indexing. Operationally, start with one repo and one embedding provider, then expand once the team trusts retrieval quality. ### FAQ **Q: Do I need Node.js?** A: Yes — the README lists Node.js 20+ for the MCP server run via npx. **Q: What credentials are required?** A: You configure env vars for embeddings and your vector DB endpoint/token as documented. **Q: Where do I use it?** A: Add it as an MCP server to Claude Code (or another MCP-capable client). ## Source & Thanks > Source: https://github.com/zilliztech/claude-context > License: MIT > GitHub stars: 10,953 · forks: 822 --- ## 快速使用 1. 安装 / 设置: ```bash 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@latest ``` 2. 启动 / 冒烟测试: ```bash # In Claude Code /mcp ``` 3. 验证: - 对一个仓库完成索引,并用自然语言搜索(例如认证相关函数);确认能返回结果并被引用到回答里。 ## 简介 Claude Context 是一套 MCP 代码搜索服务:为 Claude Code 等 agent 提供语义检索,把相关代码按需取回进上下文,减少整目录喂给模型的成本,并提升大仓库命中率。 - **适合谁:** 中大型代码库团队,希望让 agent 先检索再回答,而不是盲读全仓 - **可搭配:** Claude Code 的 MCP;通过 `npx @zilliz/claude-context-mcp@latest` + 环境变量运行 - **准备时间:** 15 分钟 ## 实战建议 - 准备时间约 15 分钟(配 env + 添加 MCP + 首次索引) - 可量化检查:至少 1 个仓库索引完成,并能成功返回 `search_code` 结果 - GitHub stars / forks(已核验):见「来源与感谢」 当你经常被“塞上下文”拖慢/拖贵时,这类 MCP 检索层很合适: - 不再粘贴目录:先索引一次,再按查询取回。 - 固化流程:index → search → 引用代码位置。 - 把检索层与生成层解耦:换模型不必重建索引。 落地建议:先从 1 个仓库 + 1 种 embedding provider 开始,等团队认可检索质量再扩展。 ### FAQ **需要 Node.js 吗?** 答:需要。README 写明通过 npx 运行并要求 Node.js 20+。 **需要哪些凭据?** 答:按文档配置 embeddings 与向量库的 env(地址/令牌等)。 **在哪用?** 答:把它添加为 Claude Code(或其他 MCP 客户端)的 MCP server。 ## 来源与感谢 > Source: https://github.com/zilliztech/claude-context > License: MIT > GitHub stars: 10,953 · forks: 822 --- Source: https://tokrepo.com/en/workflows/claude-context-semantic-code-search-mcp Author: MCP Hub