FC

flupkede/codesearch

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

107 stars 21 forks 质量 86 趋势 55Apache-2.0

多Repo语义代码搜索 Rust的MCP服务器——混合向量+BM25检索,树保姆AST分解,全线下行. 对于OpenCode,克洛德代码,Cursor,以及任何MCP客户端.

概览

代码搜索通过5个统一的MCP工具给予AI代理(OpenCode,克洛德代码,Cursor,以及任何MCP客户端)深层代码库的理解. 指数一次,搜索 同步在多个寄存器。 - 不同存储器组的Fan-out查询,具有跨repo RRF排名 - : 矢量嵌入 + BM25 全文本搜索,与对等Rank Fusion 连接 - : 跳到定义,找到用法,痕量导入和依附者 – 在同一种工具中 - : 17种语言的树保姆解析 – 块与函数/类(和Markdown部分)一致,而不是任意行范围 - : 默认返回元数据 ; 代理仅在需要时通过 get chunk 获取完整代码 - : 磁盘上数百个MB,仅在CPU上运行 ;一次性模式下载后本地嵌入引出工作 – 代码搜索索引 → 代码搜索 mcp-完成 MCP代码搜索生态系统在2025后期/2026年初快速增长,许多项目共享相同的基线堆栈(Rust + tree-sitter + BM25 + 嵌入式+ MCP).

概述(AI 翻译)

** 多Repo语义代码搜索AI代理 – 一个Rust MCP服务器,有矢量+BM25混合检索,符号导航,并交叉存储器管弦. 默认为本地和离线,可选远程嵌入. 不需要 GPU 或 Docker 。 **

代码搜索通过5个统一的MCP工具给予AI代理(OpenCode,克洛德代码,Cursor,以及任何MCP客户端)深层代码库的理解. 指数一次,搜索 同步在多个寄存器。

□为什么代码搜索?

  • ** 多雷波服务模式**: 跨repo RRF排名的存储组的Fan-out查询
  • ** Hybrid检索**: 向量嵌入 + BM25 全文搜索与对等分级融合
  • ** 符号导航**: 跳到定义,找到用法,跟踪导入和依赖——在同一工具中
  • ** AST - 意识块**: 用于17种语言的树保姆解析 — 块与函数/ 类( 和 Markdown 区段) 一致, 不是任意行区域
  • ** 收件效率**:默认返回元数据;代理仅在需要时通过[[T0]获取完整代码]
  • 轻量级脚印**: 磁盘上数百个MB, 只运行在 CPU; 一次性模型下载后, 本地嵌入推想工作已下线

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

codesearch

Multi-repo semantic code search for AI agents — a Rust MCP server with vector + BM25 hybrid retrieval, symbol navigation, and cross-repository orchestration. Local and offline by default, with optional remote embeddings. No GPU or Docker required.

codesearch gives AI agents (OpenCode, Claude Code, Cursor, and any MCP client) deep codebase understanding through 5 unified MCP tools. Index once, search semantically across multiple repositories simultaneously.

Why codesearch?

  • Multi-repo serve mode: Fan-out queries across repository groups with cross-repo RRF ranking
  • Hybrid retrieval: Vector embeddings + BM25 full-text search fused with Reciprocal Rank Fusion
  • Symbol navigation: Jump to definitions, find usages, trace imports and dependents — in the same tool
  • AST-aware chunking: Tree-sitter parsing for 17 languages — chunks align to functions/classes (and Markdown sections), not arbitrary line ranges
  • Token-efficient: Returns metadata by default; agents fetch full code only when needed via get_chunk
  • Lightweight footprint: Hundreds of MB on disk, runs on CPU only; local embedding inference works offline after the one-time model download
  • Zero config for single repos: codesearch index && codesearch mcp — done

How does this compare?

The MCP code-search ecosystem grew rapidly in late 2025 / early 2026 and many projects share the same baseline stack (Rust + tree-sitter + BM25 + embeddings + MCP). codesearch’s deliberate focus is:

Focus area codesearch Typical alternative
Repository scope Multi-repo serve with cross-repo RRF Usually single repo at a time
Footprint ~hundreds of MB, CPU-only, no Docker GB-scale, GPU, Docker, or cloud
Enterprise / offline Offline by default after one-time model download; optional remote embeddings Often pulls models at first run
Symbol navigation find (def/usages/imports/dependents) co-located with semantic search Often a separate code-graph tool
Token cost per call compact=true by default; chunks fetched on demand Frequently dumps full snippets

codesearch is intentionally narrower than full code-graph or knowledge-graph tools — it focuses on lightweight, multi-repo, MCP-native search, offline by default.

Local vs. remote embeddings

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "codesearch": { "command": "codesearch", "args": ["mcp"] } } }