Offline codebase knowledge graph: 91% token reduction vs naive RAG, plus cross-session agent memory.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
NervaPack is a privacy-first, offline knowledge graph for your codebase. It solves two fundamental problems with standard Vector RAG:
NervaPack runs 100% on your machine. It uses tree-sitter to parse your codebase into a deterministic Abstract Syntax Tree graph, then uses a local Ollama model to draw hard semantic edges between your documentation and your code. Queries traverse this graph with a K-Hop BFS, returning a hyper-targeted, token-efficient context window โ no cloud required.
91.2% Average Token Reduction โ independently verified on real-world codebases.
| Test Type | Tokens (Naive) | Tokens (NervaPack) | Reduction |
|---|---|---|---|
| Simple Query | 10,926 | 101 | 99.1% |
| Medium Query | 13,092 | 164 | 98.7% |
| Complex Query | 3,290 | 1,102 | 66.5% |
| Average | 52,037 | 2,459 | 91.2% |
Cost Savings: $181โ$724 per developer per year (GPT-4o to Claude Sonnet)
๐ View Full Benchmarks ยท ๐งช Messy Code Performance
Code quality impact: 90โ99% reduction on clean code, 50โ75% on legacy/messy code. Even poorly structured codebases benefit significantly.
| Standard Vector RAG | NervaPack | |
|---|---|---|
| Parsing | Arbitrary text chunks | Deterministic AST nodes (class, function, import) |
| Retrieval | Nearest-neighbour blob | K-Hop BFS on a structural graph |
| Doc โ Code links | None | Hard EXPLAINS edges drawn by local LLM |
| Privacy | Cloud embeddings | 100% local (ChromaDB + ONNX + optional Ollama) |
| Incremental sync | Re-index everything | Surgical per-file update via GitPython diff |
| Token savings | No measurement | Built-in dashboard shows exact reduction per query |
| Graph visibility | Black box | Interactive HTML visualization of every node and edge |
| Duplicate-safe | Repeated ingest = duplicate data | upsert โ re-ingest is idempotent |
| Agent memory | None | 17-tool MCP server for cross-session memory |
git init if not)(Optional for semantic code-doc binding) โ an LLM provider. Structural graph indexing and basic queries work out-of-the-box with zero configuration and no cloud connection.
| Provider | Setup | Cost | Privacy |
|---|---|---|---|
| Ollama (default) | brew install ollama && ollama pull llama3 | Free | 100% local |
| Claude API | pip install "nervapack[claude]" + ANTHROPIC_API_KEY | ~$0.25/1k calls | Cloud |
| OpenAI API | pip install "nervapack[openai]" + OPENAI_API_KEY | ~$0.15/1k calls | Cloud |
| MCP (Claude Code) | Zero config | Included in subscription | Cloud |
On first run, ChromaDB downloads an ONNX embedding model (~30 MB) to
~/.cache/chroma/. This is a one-time download.
nervapack ingest [PATH] โ Build the graphScans PATH (default: .) and builds the full knowledge graph.
What happens:
dist/, build/, node_modules/, venv/, site/, .tox/, and dozens of other build directories automatically..md files by header hierarchy.EXPLAINS edges..nervapack/graph.graphml.Re-ingesting is safe โ upsert is used throughout, so running ingest twice does not duplicate data.
Supported languages (bundled): Python, JavaScript, JSX, TypeScript, TSX
Additional languages:
Exclude directories โ create .nervapackignore in your project root (gitignore syntax):
nervapack query PROMPT โ Query the graphRetrieves focused context for a natural-language prompt and prints a token savings dashboard.
What happens:
EXPLAINS edges and memory notes via TOUCHES edges โ are collected.Example output:
nervapack sync [PATH] โ Incremental updateUpdates only the files that changed since the last ingest. Uses GitPython to diff the working tree.
A full ingest on a large project can take minutes. sync turns that into a 2โ5 second surgical update per file. Re-parses changed files, batch-upserts new vectors, and saves the graph once at the end.
nervapack clean [OPTIONS] โ Remove ingested dataWipe graph data and start fresh. Use this when you have duplicate vectors, ingested the wrong directory, or need to reduce disk usage.
Never deleted by clean: memory.db โ your agent memory is always safe.
Typical workflow after a bad ingest:
nervapack enrich [PATH] โ Add semantic edgesNo reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/nervapack)<a href="https://allmcps.com/mcp/nervapack"><img src="https://allmcps.com/api/badge/nervapack?style=directory" alt="NervaPack on AllMCPs" /></a>