Scripts2026年7月27日·1 分钟阅读

claude-context — Code Search MCP Server for Claude Code

An MCP server by Zilliz that gives Claude Code semantic code search over your entire codebase, using vector embeddings to find relevant functions and files without scanning everything each time.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Single
信任
信任等级:Established
入口
claude-context Guide
安全暂存命令
npx -y tokrepo@latest install 81703b2b-8999-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

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.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产