
Nexus-MCP
io.github.jaggernaut007由 GitHub 帳號 jaggernaut007 發布v2.3.0更新於 Nov 7, 2026
Local code-intelligence server: hybrid code search, call graph and project memory.
概覽
本機程式碼智慧 MCP 伺服器,讓助理進行混合式程式碼搜尋、檢視靜態呼叫圖並保存專案記憶,全程不需雲端呼叫。
- 可以做什麼
- 建立索引與檢視專案:建立或增量更新索引、檢查索引健康與過期狀態、梳理檔案、語言、分層與進入點
- 以向量、關鍵字與圖形加權融合的方式搜尋程式碼,結果稀少時回退到即時 grep
- 依名稱查找符號,並透過靜態呼叫圖追蹤呼叫者、被呼叫者與遞移性變更影響
- 以複雜度、程式碼異味與相依性指標評估程式碼品質
- 儲存、語意檢索與刪除跨工作階段保留的專案筆記與決策
- 適用情境
- 適合助理在中大型程式碼庫中工作、希望減少整檔讀取並快速找到相關檔案,或在重構前評估影響範圍時使用。README 指出效果因專案而異:在不熟悉的私有專案上效益明顯,在模型已熟悉的公開專案上成本略高。
- 執行需求
- 以 Python 套件形式透過 stdio 在本機執行,需 Python 3.10 至 3.12,以 pip 安裝並在 MCP 用戶端註冊。嵌入模型首次執行需從 Hugging Face 下載,設定 NEXUS_OFFLINE=1 可阻止後續下載。索引預設存放在專案的 .nexus 目錄,可用 NEXUS_STORAGE_DIR 變更。可選安裝 ripgrep 以強化回退搜尋。不需 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Nexus-MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Nexus-MCP
[PyPI version] [PyPI downloads] [PyPI downloads (pypistats)] [Python 3.10–3.12] [License: MIT] [CI] [Glama MCP server]
Hybrid search + code graph + semantic memory in a single local MCP server. About 90 MB idle and 460 MB with the embedding model loaded (measurements).
Nexus-MCP is a local code-intelligence MCP server for Claude Code, Codex, Cursor and any Model Context Protocol client. It gives AI agents precise, token-efficient answers about your codebase without cloud dependencies: no API keys, no data egress, no subscriptions.
Not sure yet? Measure it on your own code first. It is free, runs offline, calls no LLM and takes a few minutes:
You get a verdict ("Strong fit", "Likely fit" or "Weak fit") and the tokens an agent needs to reach the right file, with and without Nexus-MCP. Nothing leaves your machine. See Evaluate on your project.
Ready?
Results at a glance
Live runs: Claude Code, Claude Sonnet, headless (claude -p), 12 questions per project, 3 runs each, version 2.1.0 (2026-10-28). The same code can vary by about 20% in cost with 3 runs per question (measured 2026-10-28). Search hit@1 on the four retrieval suites: jobscout 0.81, nexus_mcp 0.80, shop_repo 0.50, flask 0.64.
nexus-mcp-ci eval (the free offline check, no LLM) on 3 projects:
Nexus-MCP and GitNexus on Chromium base/ (C++, 4,243 files): 8 tasks, 3 runs each, 2026-11-04.
Nexus-MCP used fewer tokens than GitNexus on 8 of 8 tasks and cost less on 6; GitNexus cost $0.002 less on one task, and one task was a tie. Grep and Read cost less than both on this C++ code. Nexus-MCP cost less than Grep and Read on 3 of 8 tasks (the two needle tasks and WeakPtr). Each condition had the same agent, model, prompt and built-in tools, and each tool had its MCP server and its always-loaded instructions (method).
All numbers: benchmarks page · JSON · CSV.
The Problem It Solves
An agent that explores a codebase with Grep and Read pays for every call: each call is one more
turn, and each turn reads the whole conversation again. Nexus-MCP answers a question about code
in fewer calls. search returns the whole code of its top results, find_symbol returns the
code of several names in one call, and graph returns every text reference beside the call
edges.
The north star of the project is lower token use with the same accuracy. It is measured, not
estimated: see Token efficiency and benchmarks/.
Evaluate on your project
Decide with your own numbers. The quick check is free, offline and calls no LLM:
It asks about 30 questions made from your own code and compares Grep and Read with one
Nexus-MCP search. The right answer is the file that defines the symbol, from the parser, never
from the Nexus-MCP ranking. On this repo's source (59 files) it gave "Likely fit": 1,234 median tokens to reach the right file against 5,385, and the right file first in 93% of
questions against 70%. On Chromium's base/ (3,638 files of C++, Java and Python) it gave
"Strong fit": 950 median tokens against 17,998 (95% fewer), and the right file first in 70% of questions against 40%. On pallets/click (91 files, from its
URL) it gave "Strong fit": 1,301 median tokens against 24,774 (95% fewer), and the right file first in 97% of questions against 27%. On a tiny project Grep and Read win, and the report says
so.
Want the real agent cost? The agent tier runs your own Claude Code or Codex login on tasks from your code, with and without Nexus-MCP. It shows the cost first and asks:
Results are saved in ~/.nexus-mcp/evals/ (eval list, eval show <id>). eval share <id>
posts the numbers (no code, no paths) to the community table, only after you say yes. Full
guide: docs/EVALUATE.md. In Claude Code, the plugin adds
/nexus-mcp:evaluate.
Privacy and Data
Your code stays on your machine. The server makes no network calls and has no telemetry.
- In: the package from PyPI, and the embedding model from Hugging Face once (set
NEXUS_OFFLINE=1after that).eval <url>also runs agit clone. - Out: nothing, unless you run
eval --agent(prompts and code go to Anthropic or OpenAI through your own CLI) oreval share(numbers only). Both ask first. - Stored: the index, memories and graph in
<project>/.nexus/(it holds code: add it to.gitignore), the model in~/.cache/huggingface/, eval results in~/.nexus-mcp/evals/.
Every location, the shell commands that do the same, and the uninstall steps: docs/PRIVACY.md.
Quickstart (60 seconds)
You need uv. Nothing else.
Ask your agent. Open your agent (Claude Code, Codex, Cursor, Gemini CLI) in your project and say:
Install Nexus-MCP from https://github.com/jaggernaut007/Nexus-MCP
The agent reads llms-install.md and runs one command. You can run the
same command yourself:
setup finds the MCP clients on your machine, shows each change, and asks before it writes
anything. It adds the server and a short skill that tells the agent when to use each tool.
Add --dry-run to see the changes only, --client codex to pick one client, and
--uninstall to remove what it wrote. Then reload your client (or start a new session) and
ask something like "where do we retry failed payments?". The agent calls search, and
index once, the first time in a project.
The server sends its own usage instructions when it connects, so the agent knows which tool answers which question even without the skill.
Other ways in, each with the same server:
- VS Code: Install in VS Code
- Cursor: the "Add to Cursor" button on the website
- Claude Desktop: download
nexus-mcp.mcpbfrom the latest release and open it - Gemini CLI:
gemini extensions install https://github.com/jaggernaut007/Nexus-MCP - Docker:
docker run -i --rm -v "$PWD:/workspace" -v nexus-data:/data ghcr.io/jaggernaut007/nexus-mcp - GitHub Actions:
uses: jaggernaut007/Nexus-MCP@v2
All channels, and what each needs: docs/DISTRIBUTION.md.
Claude Code plugin
The plugin registers the server and the same routing skill. It runs the server through
uvx, so it needs only uv, no pip install:
Use setup or the plugin for Claude Code, not both, or the server is registered twice.
Tool names differ by route: mcp__nexus-mcp__search after setup,
mcp__plugin_nexus-mcp_nexus-mcp__search through the plugin. The rest of this README
writes bare names (search) and you do not need the prefix in prompts.
Optional: project instructions
If you want the rules in your own project file, a short block is enough:
The full routing guide is in docs/AGENT_ROUTING.md.
How It Works
Indexing Pipeline (8 steps)
Incremental reindex: mtime-based — only changed files are re-processed. Corrupt index detection triggers automatic full rebuild.
Search Pipeline
Technology Stack
Token Efficiency
Two live runs, 12 questions each, with Claude Sonnet, 3 runs for each question and condition (72 runs each) and the prompt cache warm for both conditions. The result depends on the project.
Latest (commit a67e5b4, find_symbol shows an outline of a long class): the numbers are
in Results at a glance, generated from
benchmarks/published/results.json.
Only the nexus condition ran again for this commit; the Grep and Read numbers are the stored
runs below. On django nexus is cheaper in total but still dearer on 8 of 12 questions (the short
lookups). The one wrong answer on the private project came from a run that did not call
find_symbol. With 3 runs for each question the same code can vary by about 20% in cost
(measured 2026-10-28), so the change against the runs before the outline is inside the noise;
all three recent nexus runs on the private project cost less than Grep and Read ($0.446 to
$0.531 against $0.571), and on django nexus is about equal ($0.863 to $0.973 against $0.894). Details:
docs/EVALS.md. The sections below are the runs before the outline.
Private 460-file Python project (2026-10-08, commit 91a338e):
Nexus is cheaper on 7 questions, equal on 3 and dearer on 2 (the two impact questions, by
$0.005 and $0.004). The saving comes from fewer turns and from smaller tool results than the
whole-file reads of Grep and Read (see the cost split below). Per question numbers are in
docs/EVALS.md. The same questions on 2026-10-07 (before exact names, code in find_symbol,
the smaller tool list and the warm-up call) gave nexus 6% more cost than Grep and Read.
Django, a public repository (3,000 files; 2026-10-27, commit 3fa8810):
On django nexus uses fewer turns but costs more. It is cheaper on the questions where Grep and
Read need 18 to 24 turns (SQLCompiler.as_sql -21%, URLResolver.resolve -10%) and dearer on
short lookups that take 2 or 3 turns. Django is a repository that the model knows from
training, so part of this measures the model. One ground truth was corrected after the run (a
question asked for a value, and the scorer also required a file name); details in
docs/EVALS.md.
Why: the cost split of the traces. The parts below add up to the reported cost of each run.
- The 3,600 extra prompt tokens on each turn cost little: a cache read is $0.20 per million.
- Tool results are written to the cache at $4 per million, 20 times the read price. So the size of a result matters more than the size of the prompt.
- On jobscout the agent does not know the code and reads whole files (10,000 characters for each
Read). A
find_symbolresult of 9,700 characters replaces a Read and saves a turn. - On django the agent knows the code and reads short line ranges (3,400 characters for each
Read). A
find_symbolresult of 9,200 characters is larger than the read that it replaces. A class lookup sends up to 6,000 characters of the class body:CharFieldcost $0.023 with nexus and $0.013 with Grep.
This led to the outline for a class in find_symbol (methods and lines, not the body). With it,
nexus on django went from $0.973 to $0.863 (see "Latest" above). Details and the other
candidates are in docs/EVALS.md.
The saving is large on a project that the model does not know and small on one that it knows.
Run benchmarks/ on your own project before you rely on it.
The 8 Tools
New in v2.3.0 (no breaking change): uvx nexus-mcp-ci setup installs the server and the
skill into your MCP clients, new install routes cover Claude Desktop, Gemini CLI, VS Code,
Cursor, Docker and GitHub Actions, and the license is now MIT. The MCP tools do not change.
New in v2.2.0 (no breaking change): nexus-mcp-ci eval measures Nexus-MCP on your own
code (Evaluate), and
nexus-mcp-ci data shows and clears every stored file (Privacy).
The MCP tools do not change.
v2.1.0 breaking change: explain and health are removed from the MCP tool list, and
several rarely used parameters are removed from the schemas (see CHANGELOG).
find_symbol now returns the code with callers and callees.
v2.0.0 breaking change: find_callers/find_callees/impact merged into
graph, overview/architecture merged into map, and remember/recall/forget
merged into memory — see CHANGELOG for the old→new mapping and
ADR-017 for why. Fewer, richer tools route
better under MCP Tool Search than many thin ones.
Discovery & Indexing
Search
Graph Analysis
Memory
Install
From PyPI (recommended)
From Source
Python 3.10–3.12 supported. Python 3.13+ is not yet supported by the current dependency stack, and the packaged Glama/Docker build uses Python 3.12 for compatibility. Optional: rg (ripgrep) for 100% search coverage fallback on unindexed files.
The deprecated
jina-codemodel requires ONNX Runtime. If you see ONNX/Optimum errors:The default
bge-small-enmodel needs neither ONNX nortrust_remote_code.
MCP Client Setup
Claude Code
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Cursor / Windsurf / Cline / Any MCP Client
Agent Integration Patterns
CLAUDE.md boilerplate (drop into project root)
Typical agent tool-call sequence
Multi-folder monorepo indexing
Configuration
All settings via NEXUS_ environment variables:
The Python package defaults to bge-small-en. The Dockerfile, docker/Dockerfile.stdio and glama.json use the same default. jina-code still loads, with a warning, so an existing index keeps working. It is deprecated and will be removed in a future major release.
Embedding Models
After changing model, re-index. Embeddings from different models are incompatible.
Comparison
vs. other code-intelligence MCP servers
Features only, from each project's own documentation. We make no performance claims about
other tools: run nexus-mcp-ci eval on your code instead.
Other servers in this space include codebase-memory-mcp, code-graph-rag, code-index-mcp and ast-grep-mcp. Check each project's docs. Corrections to this table are welcome.
vs. Other MCP Servers
vs. AI Code Tools
Development
Project Structure
Adding a New Tool
- Add the logic as a plain function in
core_api.py - Validate input there with the
validate_*helpers (validate_path,validate_symbol_name,validate_query) - Add a thin wrapper in
server.pydecorated with@mcp.tool()and@_audited, and call_guard("<tool>")first - Add the permission category to
security/permissions.py - Write tests in
tests/ - Update
self_test/demo_mcp.pyto exercise the tool
Adding a New Language
- Add entry to
parsing/language_registry.pywith the tree-sitter grammar - Add structural patterns to
parsing/astgrep_parser.pyfor call/import extraction - Add test fixtures in
tests/fixtures/
Self-Test
Verify your installation exercises the 8 tools and the Python API end-to-end:
Expected output: the 8 tools and the Python API exercised with pass/fail per tool and a summary.
Known Limitations
- Sequential graph parsing: ast-grep runs sequentially (not parallel) to keep the call graph consistent. This is the main indexing bottleneck on large codebases.
- bge-small-en uses PyTorch: The default model runs on PyTorch, not ONNX.
- No incremental graph updates: Graph is rebuilt in full on incremental reindex (only vector/BM25 are incremental at the chunk level).
- No SSE transport: Only stdio transport is currently supported.
- Language coverage: 25+ languages get tree-sitter symbol extraction. ast-grep structure (functions, classes, imports) covers Python, JavaScript, TypeScript, Go, Java, and Rust; other languages have no graph structure.
- Call edges are static and name-based.
graph()and thecallers/calleesfields offind_symbol()come from parsing, not runtime tracing. Edges exist for Python, JavaScript, TypeScript, Go, Java and Rust. A call resolves only when the callee is in the same file, in an imported file, or has a unique name in the index. A name shared by several definitions gets no edge, so results are a lower bound. Dynamic dispatch, monkey-patching, callbacks and reflection do not show up, so treatgraph(transitive=True)as a lower bound on blast radius. - Complexity is approximate: cyclomatic complexity counts branch points per function. Only Python counts
and/or, and only Python functions get docstrings on graph nodes. - Auto-reindex has a detection lag: with the file watcher enabled (default), edits are picked up after a short debounce, and
status()/search()run a throttled staleness check as a backstop — not an instant, per-call guarantee of freshness.
Architecture Decision Records
Key decisions are documented in docs/adr/:
Documentation
Start at the docs index.
- Evaluate on your project — The free offline check, the agent tier, saving and sharing results
- Privacy and data — What goes in and out, where data is stored, how to remove it
- Benchmarks — Every published number, with JSON and CSV
- Installation Guide — Prerequisites, client-specific setup, troubleshooting
- Architecture — Data flow, component design, memory budget analysis
- Usage Guide — Full tool reference with examples
- Developer Guide — Contributing, adding tools/engines/languages
- Research Notes — Library evaluations and technology deep-dives
Acknowledgments
Nexus-MCP consolidates two earlier open-source projects:
- CodeGrok MCP by rdondeti (Ravitez Dondeti, MIT) — Contributed the symbol extraction pipeline, embedding service, parallel indexer, core data models, and memory retrieval system.
- code-graph-mcp by entrepeneur4lyf — Contributed the ast-grep structural parser, rustworkx graph engine, complexity analysis, and relationship extraction.
Source files retain "Ported from" attribution in their module docstrings. See ADR-001 for the consolidation rationale.
License
MIT. Free to use, copy, modify and distribute, for any purpose, including at work.
Versions 2.0.1 to 2.2.3 were released under the PolyForm Noncommercial License 1.0.0. Anyone who obtained one of those versions keeps the terms they got. Versions 0.1.0, 0.1.1 and 2.0.0 were MIT. Every new release is MIT.
If Nexus-MCP saves you tokens at work, a star or a sponsorship is welcome. Neither is required.
來源:README.md,提交 8986398
工具
0版本歷史
2- v2.3.0最新Nov 7, 2026
- v2.2.0Nov 3, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
