Codebase Context Mcp

io.github.Jhackman2019由 GitHub 账号 Jhackman2019 发布v1.0.1更新于 Oct 24, 2026

Codebase indexing and search via WASM tree-sitter. Works on ARM64 and x86_64.

发布方自己的服务:Codebase

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,用 WASM tree-sitter 索引代码库,让助手搜索符号、做全文代码检索并查看文件结构。

可以做什么
把目录解析为符号和代码块并缓存为 JSON,按内容哈希增量更新,并应用默认忽略规则和文件上限。按名称或模式查找函数、类与类型。在已索引文件中进行 BM25 全文检索。显示文件结构,包括函数、类、导入和导出及其行号。汇总项目技术栈、按语言统计的文件数量和目录结构。
适用场景
适合助手需要浏览和检索本地代码库的场景,尤其是在 Raspberry Pi、Apple Silicon 或 Graviton 等 ARM64 主机上,原生绑定类索引工具无法安装时。适用于 TypeScript、TSX、JavaScript、Python、C#、VB.NET、XML、CSS 或 JSON 项目。
运行要求
作为本地 stdio 进程运行,通常通过 npx 从 npm 包 codebase-context-mcp 启动,因此需要 Node.js 和 npm。未声明认证、环境变量或请求头。索引会写入用户主目录下的 JSON 文件。
安装前请注意
索引会读取所选目录中的源文件,并把解析内容存入主目录下的 JSON 索引,敏感代码可能被持久化保存。默认忽略 node_modules、.git、dist、build、.venv、二进制文件和锁文件,并遵循根目录的 .gitignore,但目录中的其他机密不会被过滤。上限为 20,000 个文件、单文件 512KB。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Codebase Context Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

codebase-context-mcp

MCP server for codebase indexing and search that works on every platform — including ARM64 devices like Raspberry Pi and Apple Silicon where most alternatives fail.

The Problem

Popular codebase-indexing MCP servers like @zilliz/claude-context-mcp depend on native C++ bindings (tree-sitter, faiss-node) that ship pre-built binaries only for x86_64. If you're on ARM64 — a Raspberry Pi, Apple Silicon Mac, AWS Graviton, or any other arm64 host — npm install fails with missing prebuilts and no fallback. There's no workaround short of cross-compiling the native modules yourself.

The Solution

This package replaces every native dependency with a WASM equivalent. The tree-sitter parser runs as WebAssembly, search uses a pure-JS BM25 implementation, and the index is stored as plain JSON. Zero native bindings means npm install succeeds on the first try on any architecture: ARM64, x86_64, macOS, Linux, Windows.

Drop-in compatible — provides the same core tools (index, search, outline, summary) via the standard MCP stdio transport.

Tools

ToolDescription
index_codebaseParse a directory into symbols/chunks, cache as JSON
search_symbolsFind functions, classes, types by name or pattern
search_codeBM25 full-text search across indexed files
get_file_outlineFile structure: functions, classes, imports, exports with line numbers
get_project_summaryTech stack, file counts by language, directory structure

Supported Languages

TypeScript, TSX, JavaScript, Python, C#, VB.NET, XML, CSS, JSON

Install

Claude Code (recommended)

bash
claude mcp add codebase-context -s user -- npx codebase-context-mcp

Or from a local clone:

bash
git clone https://github.com/Jhackman2019/codebase-context-mcp.gitcd codebase-context-mcpnpm install && npm run buildclaude mcp add codebase-context -s user -- node /path/to/codebase-context-mcp/dist/index.js

MCP Settings (JSON)

json
{  "mcpServers": {    "codebase-context": {      "command": "npx",      "args": ["codebase-context-mcp"]    }  }}

How It Works

  • Parsing: web-tree-sitter (WASM) — same AST quality as native tree-sitter, runs on any architecture
  • Search: BM25 text ranking (pure JS) + symbol name matching
  • Storage: JSON file index at ~/.codebase-context-mcp/<project-hash>.json
  • Transport: MCP stdio via @modelcontextprotocol/sdk
  • Incremental: Files with unchanged content hash are skipped on re-index

Safety Limits

LimitValue
Max files20,000
Max file size512KB
Default ignoresnode_modules, .git, dist, build, .venv, binaries, lock files
.gitignoreRespected (root level)

Development

bash
npm installnpm run build    # Build with tsupnpm run dev      # Watch modenpm start        # Run the server

License

MIT

来源:README.md,提交 6da2e54

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Codebase 集成