Locus

io.github.SylphxAI由 GitHub 帳號 SylphxAI 發布v0.6.4更新於 Oct 24, 2026

Locus — the exact code chunk for the job: local BM25 search for agents.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Locus 是一個本機程式碼搜尋 MCP 伺服器,為編碼助理索引程式碼倉庫,並依 BM25 關鍵字比對回傳排序後的程式碼片段。

可以做什麼
依關鍵字搜尋程式碼庫,回傳含路徑、行範圍、符號、分數與文字的排序片段,並可在限制數量前依副檔名、路徑與排除項目過濾。找出與指定檔案和行共用詞元的其他相關片段。每次呼叫會更新本機索引,未變更的檔案直接命中快取。關閉內容回傳時只提供定位資訊。
適用情境
適合編碼助理需要在本地倉庫中定位與任務對應的確切程式碼片段,且你能說出程式碼中出現的詞語時使用。排序採詞法比對,適合關鍵字式查找而非語意搜尋。
執行需求
透過 npm 套件以 stdio 在本機執行,通常經由 npx 啟動。需要絕對專案根路徑,可用 --root 傳入、設定 LOCUS_ROOT 或在工具呼叫中提供。不需 API 金鑰、向量資料庫或 Docker。已發布的原生建置涵蓋 macOS 與 Linux,Windows 不是發布目標。
安裝前請注意
此套件現為後繼專案的輕量別名,0.x 文件已封存。它會在專案的 .locus 目錄寫入索引檔案,不應提交到版本庫。它不搜尋工作目錄,根路徑錯誤會默默搜尋錯誤位置。索引只略過固定的一組路徑名稱,不遵循 gitignore 規則。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Locus,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Locus → now part of repomap

Locus has merged into repomap, a map of your codebase for AI agents. It combines code graph, hybrid search (Locus's BM25, now on tree-sitter AST chunks), call paths, change impact and an interactive graph UI in one Rust binary. It runs locally, needs no API key, and is MIT licensed.

bash
npx -y @sylphx/repomap setup

@sylphx/locus 1.x and @sylphx/coderag 1.x are thin aliases of @sylphx/repomap, so existing configs (npx -y @sylphx/locus --root=…, codebase_search) keep working. New development happens in SylphxAI/repomap. The rest of this README documents Locus 0.x.

Locus 0.x (archived)

The exact code chunk for the job

Locus is local code search for coding agents. It indexes the repository on the machine, ranks chunks with BM25, and returns the path, line range, symbol, score, and chunk text.

No API key. No vector database. No Docker. The default transport is stdio.

bash
npx -y @sylphx/locus --root=/absolute/path/to/project

Locus does not search the process working directory. Pass --root, set LOCUS_ROOT, or pass root on the tool call. A tool root wins, then the launch --root, then LOCUS_ROOT. CODERAG_ROOT still works when LOCUS_ROOT is unset.

Claude Code:

bash
claude mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/project

Codex:

bash
codex mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/project

Tools

ToolUse it whenYou get
codebase_searchYou can name words that appear in the codeRanked chunks. Filters apply before the limit.
find_relatedYou already have a file and a lineOther chunks that share its tokens
json
{  "query": "authenticate request",  "limit": 5,  "file_extensions": ["ts"],  "path_filter": "src/auth",  "exclude_paths": ["src/auth/legacy"]}

login does not match authenticate. Ranking is lexical. Search for the words the code uses.

What is indexed

.ts .tsx .js .jsx .mjs .cjs .rs .md .py .go

Skipped path segments, by exact name: node_modules, dist, target, .git. This is not gitignore. Files larger than 1,048,576 bytes are skipped. New indexes are written to .locus/rust-index.json and .locus/file-hashes.json. Locus still reads .coderag/ when .locus/rust-index.json is absent. Do not commit either directory.

A line that looks like a symbol starts a chunk. Other files stay one chunk. The patterns are regular expressions, not a syntax tree. Symbol chunks.

Defaults that stay boring

  • limit defaults to 10 and must be an integer from 1 to 100.
  • include_content defaults to true. false returns locators only.
  • There is no auto, fast, or quality search mode.
  • Each call refreshes the local index. Unchanged files are a cache hit. That refresh mode is not a search profile you select.
  • HTTP exists only when MCP_TRANSPORT=http. Agents should use stdio.

Install surfaces

SurfaceWhere
Claude Codeclaude mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/project
Codexcodex mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/project
CursormcpServers in .cursor/mcp.json or ~/.cursor/mcp.json
VS Codeservers in .vscode/mcp.json (${workspaceFolder} is expanded)
Other MCP clientsmcpServers in .mcp.json, with an absolute --root

Published natives: @sylphx/locus-darwin-arm64, @sylphx/locus-darwin-x64, @sylphx/locus-linux-arm64-gnu, @sylphx/locus-linux-x64-gnu. Windows is not a published target.

npx -y @sylphx/locus doctor prints the server version and whether locus-cli was found.

Companions

ProductJob
CitraPDF answers with page-level proof
IrisImage facts and pixel evidence
CueVideo timelines and timestamp evidence
SpineRepository architecture and impact
LookoutWeb research with source excerpts

Locus finds the chunk. Spine maps the architecture. Install only what the task needs.

Docs: https://sylphxai.github.io/locus/

Development

bash
bun installbun run build:rustcargo testbun run docs:build

License

MIT

來源:README.md,提交 23d5eab

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.6.4最新Sep 23, 2026
  2. v0.6.1Sep 23, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分