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 整合