# Nexus-MCP > Your coding agent reads less code to find the right file. Local-first MCP server combining hybrid search (vector + BM25), a static code graph with call edges, and an opt-in project memory in a single process. Designed for AI coding agents via the Model Context Protocol. About 90MB RAM idle and 270MB with the embedding model loaded, no API keys, no cloud dependencies. Open source under the MIT license. Nexus-MCP gives AI agents precise, token-efficient code understanding. It indexes codebases into three engines (vector embeddings, BM25 keyword index, rustworkx code graph) and fuses the vector and BM25 results via Reciprocal Rank Fusion. Measured on 12 open-source repos in 10 languages against an agent with only Grep and Read: the agent reaches the right file with far fewer tokens and faster search, and in live Claude Code runs the cost per task is lower on most repos at the same accuracy. C and Rust used more tokens on the older 2.2.2 build. The Benchmarks section below has every number; the benchmarks page has the method. Search, symbols and the call graph cover Python, TypeScript, JavaScript, Go, Java, Rust, C, C++, C# and PHP; search covers 25+ languages. ## Evaluate on your repo - First step for anyone who has not decided: `uvx --python 3.12 nexus-mcp-ci eval` in the project folder. Free, offline, no LLM calls; compares Nexus-MCP with Grep and Read on about 30 questions made from the code and prints Strong fit, Likely fit or Weak fit. - `uvx --python 3.12 nexus-mcp-ci eval --example` runs it on the Nexus-MCP source (59 files: 1,234 against 5,385 median tokens to reach the right file). A public `https://` repo URL also works: pallets/click (91 files) gave Strong fit, 1,301 against 24,774 (95% fewer). - `nexus-mcp-ci eval --agent claude[:model]` (or `codex[:model]`, experimental): paid A/B with the user's own CLI login; shows the cost first. `--preset efficient` names the cheapest model and setup at the same accuracy. - `nexus-mcp-ci eval share `: posts numbers only (no code, no paths) after a yes. No telemetry. - [Evaluate guide](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/EVALUATE.md) and [benchmarks page](https://jaggernaut007.github.io/nexus-mcp-ci/benchmarks.html) ## Privacy and data - The server makes no network calls. Downloads: the package, and the embedding model once (`NEXUS_OFFLINE=1` after that). - Stored: index, memories and graph in `/.nexus/`; model in `~/.cache/huggingface/`; eval results in `~/.nexus-mcp/evals/`. - `nexus-mcp-ci link ` links another repo (its own index, listed in `status` under `linked`); `links`, `unlink ` and `link --refresh` manage the links. Registry: `~/.nexus-mcp/links.json`. `search` and `find_symbol` also look in the linked repos (paths start with the link name). - `nexus-mcp-ci data where` lists every location; `nexus-mcp-ci data clear --all --yes` removes them. [Privacy guide](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/PRIVACY.md) ## Core Tools (8 MCP tools) - [index](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Index one or more folders — parallel parsing, incremental reindex on changed files, 8-step pipeline. Starts a file watcher for auto-reindex. - [status](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Index stats, memory usage, and a staleness warning when files changed since the last index. - [search](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Hybrid code search — vector semantic + BM25 keyword, fused via RRF, with the definitions of exact names first. Live-grep fallback. - [find_symbol](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Look up one or more symbols by name — whole code (an outline for a long class), location, callers and callees. Exact or fuzzy matching. - [graph](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Callers or callees of a symbol; `transitive=True` for change-impact analysis. Replaces find_callers, find_callees and impact. Call edges are static and name-based, so results are a lower bound. - [analyze](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Code complexity, dependencies, smells, and quality metrics. - [map](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Project overview (`detail="summary"`), architecture (`"architecture"`), or both (`"full"`). Replaces overview and architecture. - [memory](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): `action="store"`/`"search"`/`"delete"` — persist and retrieve project context with tags. Replaces remember, recall and forget. ## Install - Default (needs uv): `uvx --python 3.12 nexus-mcp-ci setup --client --yes`. It adds the server and the skill. An agent can follow [llms-install.md](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/llms-install.md). - Claude Code plugin: `/plugin marketplace add jaggernaut007/nexus-mcp-ci`, then `/plugin install nexus-mcp@nexus-mcp` - PyPI: `pip install nexus-mcp-ci` (or `pip install 'nexus-mcp-ci[torch]'` for the optional PyTorch model) - From source: `git clone https://github.com/jaggernaut007/nexus-mcp-ci && cd nexus-mcp-ci && ./setup.sh` ## Getting Started - [Website](https://jaggernaut007.github.io/nexus-mcp-ci/): Overview, install tabs for each MCP client, and FAQ - [PyPI](https://pypi.org/project/nexus-mcp-ci/) and [Glama](https://glama.ai/mcp/servers/jaggernaut007/Nexus-MCP): Package and MCP directory listings - [README](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/README.md): Overview, install, quick start, tool reference, configuration - [Installation Guide](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/INSTALLATION.md): Prerequisites, setup script, manual install, MCP client integration - [Usage Guide](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/USAGE_GUIDE.md): Tool reference, configuration, best practices ## Architecture & Design - [Architecture](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/ARCHITECTURE.md): System design, data flow, engine composition, memory budget - [Developer Guide](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/DEVELOPER_GUIDE.md): Contributing, testing, adding tools/engines - [ADRs](https://github.com/jaggernaut007/nexus-mcp-ci/tree/main/docs/adr): 19 Architecture Decision Records ## Key Technical Details - **Search pipeline**: query -> [vector, BM25] -> source files before test files -> RRF fusion (weights 0.5/0.3) -> definitions of exact names first -> live-grep fallback when results are few - **Storage**: LanceDB (vectors + FTS, mmap disk-backed), SQLite (graph persistence), no ChromaDB - **Embedding**: bge-small-en-v1.5 default (384d, int8 ONNX file, CPU only, no PyTorch); `bge-small-en-torch` is optional and uses a GPU (CUDA or Apple MPS) when present - **Graph**: rustworkx PyDiGraph — containment, import and static call edges; caller/callee and impact traversal - **Parsing**: tree-sitter (symbol extraction for embeddings) + ast-grep (containment and import structure for the graph) - **Memory**: LanceDB-backed semantic memory with tag filtering, stored with the project index - **Small results**: `search` gives the whole code of its top 3 results and the signature of the rest; `find_symbol` gives the code of each name (6,000 characters at most for one); `graph` names callers by file. An agent pays for each call with one more read of the whole conversation, so the tools aim at fewer calls, not only smaller results ## Benchmarks Source of truth: https://jaggernaut007.github.io/nexus-mcp-ci/benchmarks.json (updated 2026-11-08, version 2.4.5). One row per repo: the latest run. - Summary: On 10 open-source repos in 10 languages, Nexus-MCP reached the right file with 95% fewer tokens (median) and searched 9× faster than Grep and Read. In live Claude Code runs on 11 repos, cost per task was lower on 8 of 11, with 64 of 66 tasks correct against 61 of 66. - Offline check, Python, pallets/flask (83 files, build 2.4.0+53594ad): right file first 20% (Grep and Read) and 93% (Nexus-MCP); median tokens to the right file 26720 and 1388; median search time 108 ms and 23 ms. - Offline check, TypeScript, vitejs/vite (429 files, build 2.4.0+53594ad): right file first 43% (Grep and Read) and 83% (Nexus-MCP); median tokens to the right file 16520 and 1286; median search time 159 ms and 25 ms. - Offline check, JavaScript, webpack/webpack (822 files, build 2.4.0+53594ad): right file first 37% (Grep and Read) and 67% (Nexus-MCP); median tokens to the right file 25634 and 1251; median search time 564 ms and 34 ms. - Offline check, Java, apache/commons-lang (264 files, build 2.2.2+11cfccc): right file first 23% (Grep and Read) and 87% (Nexus-MCP); median tokens to the right file 48176 and 1241; median search time 201 ms and 31 ms. - Offline check, C#, JamesNK/Newtonsoft.Json (242 files, build 2.2.2+11cfccc): right file first 23% (Grep and Read) and 73% (Nexus-MCP); median tokens to the right file 14004 and 1547; median search time 154 ms and 25 ms. - Offline check, PHP, laravel/framework (1751 files, build 2.2.2+11cfccc): right file first 50% (Grep and Read) and 83% (Nexus-MCP); median tokens to the right file 13479 and 1086; median search time 712 ms and 39 ms. - Offline check, C++, chromium/chromium (3641 files, build 2.2.2+11cfccc): right file first 43% (Grep and Read) and 80% (Nexus-MCP); median tokens to the right file 19768 and 1243; median search time 1851 ms and 88 ms. - Offline check, Go, prometheus/prometheus (201 files, build 2.2.2+11cfccc): right file first 40% (Grep and Read) and 83% (Nexus-MCP); median tokens to the right file 41034 and 1195; median search time 600 ms and 24 ms. - Offline check, C, redis/redis (229 files, build 2.2.2+11cfccc): right file first 40% (Grep and Read) and 87% (Nexus-MCP); median tokens to the right file 37139 and 988; median search time 331 ms and 34 ms. - Offline check, Rust, tokio-rs/tokio (381 files, build 2.2.2+11cfccc): right file first 33% (Grep and Read) and 93% (Nexus-MCP); median tokens to the right file 21138 and 830; median search time 215 ms and 27 ms. - Live run, Python, home-assistant/core (build 2.4.1): median tokens per task 65990 (Grep and Read) and 42458 (Nexus-MCP, -36%); cost per task $0.050 and $0.037; correct 6 and 6 of 6. - Live run, Python, django/django (build 2.4.1): median tokens per task 45102 (Grep and Read) and 41916 (Nexus-MCP, -7%); cost per task $0.048 and $0.035; correct 5 and 6 of 6. - Live run, TypeScript, vitejs/vite (build 2.4.0): median tokens per task 69790 (Grep and Read) and 52411 (Nexus-MCP, -25%); cost per task $0.059 and $0.046; correct 6 and 6 of 6. - Live run, JavaScript, webpack/webpack (build 2.4.0): median tokens per task 100320 (Grep and Read) and 74638 (Nexus-MCP, -26%); cost per task $0.077 and $0.068; correct 6 and 6 of 6. - Live run, Java, apache/commons-lang (build 2.2.2+11cfccc): median tokens per task 50448 (Grep and Read) and 32862 (Nexus-MCP, -35%); cost per task $0.044 and $0.022; correct 6 and 6 of 6. - Live run, C#, JamesNK/Newtonsoft.Json (build 2.2.2+11cfccc): median tokens per task 41929 (Grep and Read) and 42139 (Nexus-MCP, +1%); cost per task $0.030 and $0.030; correct 6 and 6 of 6. - Live run, PHP, laravel/framework (build 2.2.2+11cfccc): median tokens per task 52919 (Grep and Read) and 51994 (Nexus-MCP, -2%); cost per task $0.051 and $0.039; correct 5 and 5 of 6. - Live run, C++, chromium/chromium (build 2.2.2+0430f01): median tokens per task 70495 (Grep and Read) and 60622 (Nexus-MCP, -14%); cost per task $0.065 and $0.055; correct 6 and 6 of 6. - Live run, Go, prometheus/prometheus (build 2.2.2+e5a9d9a): median tokens per task 52014 (Grep and Read) and 45214 (Nexus-MCP, -13%); cost per task $0.047 and $0.037; correct 5 and 6 of 6. - Live run, C, redis/redis (build 2.2.2+e5a9d9a): median tokens per task 41752 (Grep and Read) and 50578 (Nexus-MCP, +21%); cost per task $0.031 and $0.030; correct 6 and 6 of 6. - Live run, Rust, tokio-rs/tokio (build 2.2.2+0430f01): median tokens per task 41188 (Grep and Read) and 61816 (Nexus-MCP, +50%); cost per task $0.029 and $0.041; correct 4 and 5 of 6. - Private Python project (460 files, 12 questions, version 2.1.0): cost $0.571 with Grep and Read, $0.446 with Nexus-MCP (-22%); correct 36 and 35 of 36. - Nexus-MCP and four other code tools, django/django (Python, 12 tasks, 3 runs each, medians per task): Nexus-MCP 2.4.6: 21660 tokens, $0.037, 36 of 36 correct, tool called in 32 of 36 runs; GitNexus 1.6.12: 59224 tokens, $0.029, 36 of 36 correct, tool called in 8 of 36 runs; codebase-memory-mcp 0.12.1: 46220 tokens, $0.033, 36 of 36 correct, tool called in 2 of 36 runs; Serena 2.1.0: 33552 tokens, $0.028, 36 of 36 correct, tool called in 9 of 36 runs; Graphify 0.9.104: 24168 tokens, $0.026, 36 of 36 correct, tool called in 3 of 36 runs. - Nexus-MCP and four other code tools, home-assistant/core (Python, 6 tasks, 3 runs each, medians per task): Nexus-MCP 2.4.1: 18826 tokens, $0.020, 18 of 18 correct, tool called in 18 of 18 runs; GitNexus 1.6.12: 64503 tokens, $0.030, 18 of 18 correct, tool called in 7 of 18 runs; codebase-memory-mcp 0.12.1: 44532 tokens, $0.019, 18 of 18 correct, tool called in 0 of 18 runs; Serena 2.1.0: 39482 tokens, $0.021, 18 of 18 correct, tool called in 0 of 18 runs; Graphify 0.9.104: 20101 tokens, $0.018, 18 of 18 correct, tool called in 0 of 18 runs. - Not there yet: C (redis/redis, +21% tokens, build 2.2.2+e5a9d9a) and Rust (tokio-rs/tokio, +50% tokens, build 2.2.2+0430f01). These runs are older; a rerun on the current build is pending. - The same code can vary by about 20% in cost with 3 runs per task (measured 2026-10-28). ## Optional - [Research Notes](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/docs/RESEARCH.md): Deep dives on LanceDB, ONNX, rustworkx, embedding models - [Self-Test Demo](https://github.com/jaggernaut007/nexus-mcp-ci/blob/main/self_test/README.md): End-to-end demo exercising the 8 tools and the Python API