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 分