SuperAPI AI Directory

Nexus-MCP

Local hybrid code search (vector, BM25 and code graph) with structural code graph analysis and persistent semantic memory.

Open website

About this tool

Nexus-MCP is a code intelligence server for the Model Context Protocol (MCP) that integrates hybrid search, code graph, and semantic memory into a single local service, with memory usage under 350MB. It enables AI agents to give precise, token-efficient answers about codebases without cloud dependencies: no API keys required, no data leakage, and no subscription.

[Purpose] AI coding agents are token-inefficient by default. For an agent to understand verify_credentials(), it typically needs: Glob returning about 120 files and reading the 8 most likely ones (about 12,000 tokens), Grep finding 3 matches and reading context (about 4,000 tokens), and Read of an entire 400-line file to understand the callers (about 3,000 tokens), totaling about 19,000 tokens, more than 3 tool calls, and no graph relationships. With Nexus-MCP, explain("verify_credentials") returns the symbol definition, related code, and quality metrics (including callers and callees after call edges are extracted), at about 1,500 tokens and 1 tool call; for discovery, search("credential verification flow") returns the top-10 semantically relevant snippets across the codebase, at about 2,000 tokens and 1 tool call. It is said to save 30–60% tokens per coding session, depending on codebase size and task type.

[Main capabilities]

  • Hybrid search: combines vector retrieval with BM25.
  • Code graph: structural parsing based on ast-grep and the rustworkx graph engine, supporting CONTAINS and IMPORTS edges.
  • Semantic memory: provides memory tools such as remember / recall / forget (merged into memory as of v2.0.0).
  • 10 tools, supporting three levels of verbosity, with other tools returning responses constrained by a token budget.
  • The indexing pipeline has 8 steps, with mtime-based incremental rebuilds that reprocess only changed files; when index corruption is detected, it automatically performs a full rebuild.
  • Supports tree-sitter symbol extraction for 25+ languages; ast-grep structure (functions, classes, imports) covers Python, JavaScript, TypeScript, Go, Java, Rust.
  • Multi-folder monorepo indexing; all settings are configured via NEXUS_ environment variables.

[Usage] Installing from PyPI is recommended, supporting Python 3.10-3.12 (Python 3.13+ is not currently supported by the dependency stack; the packaged Glama/Docker build uses Python 3.12 to maintain compatibility). Optionally install ripgrep (rg) to provide a 100% search coverage fallback for unindexed files. The optional jina-code model requires ONNX Runtime; the default bge-small-en model does not require ONNX or trust_remote_code. After placing CLAUDE.md in the project root, Claude will index the project on first use and automatically use Nexus-MCP tools. An example MCP client configuration path is ~/Library/Application Support/Claude/claude_desktop_config.json on macOS; Cursor, Windsurf, Cline, and any MCP client are also supported. Typical agent tool call sequences, CLAUDE.md boilerplate, and methods for multi-folder monorepo indexing are all provided in the documentation. After changing the embedding model, reindexing is required; embeddings from different models are mutually incompatible.

[Applicable Scenarios] Suitable for developers and teams who want AI coding agents to efficiently understand a codebase locally, without cloud dependencies and without API keys, especially for coding sessions that need to save tokens, reduce the number of tool calls, and obtain code structure relationships and semantic memory.

[Limitations]

  • Graph parsing is executed sequentially (not in parallel), which is the main bottleneck for indexing large codebases.
  • bge-small-en uses PyTorch rather than ONNX and does not have the roughly 50MB size advantage of jina-code.
  • No incremental graph updates: during incremental rebuilds, the graph is fully rebuilt, and only vectors/BM25 are incremental at the chunk level.
  • Only stdio transport is supported; SSE transport is not yet available.
  • Call edges are not yet populated: the graph currently contains only CONTAINS and IMPORTS edges, with no parser-generated CALLS edges, so graph(direction="callers"/"callees"), graph(transitive=True), and the callers/callees fields of explain currently return empty lists; before call edge extraction is implemented, use search to locate call sites. find_symbol returns definitions rather than callers. The function complexity and docstring fields on graph nodes are also empty, and the complexity scores from analyze are not yet meaningful.
  • Static call graph (once populated): call edges come from static parsing rather than runtime tracing, so dynamic dispatch, monkey patching, and calls initiated through callbacks/closures/reflection will not appear; in highly dynamic code, graph(transitive=True) should be treated as a lower bound on impact scope.
  • Automatic rebuild has detection latency: when the file watcher is enabled (default), edits are picked up after a short debounce, and status() / search() perform a throttled staleness check as a fallback, so freshness is not guaranteed immediately on every call.

[License] Uses the PolyForm Noncommercial License 1.0.0, free for any noncommercial use, copying, modification, and distribution; commercial use requires a separate license. Versions released before 2.0.1 (0.1.0, 0.1.1, 2.0.0) retain the original MIT terms for those who obtained them under the original MIT terms.

[Project Origin] Nexus-MCP integrates two earlier open source projects: CodeGrok MCP (contributing the symbol extraction pipeline, embedding service, parallel indexer, core data model, and memory retrieval system) and code-graph-mcp (contributing the ast-grep structural parser, rustworkx graph engine, complexity analysis, and relationship extraction). Source files retain the "Ported from" attribution in module docstrings.