MCP Server Indexes Codebases into Knowledge Graph for 10x Token Reduction

codebase-memory-mcp is an MCP server that replaces file-by-file code exploration with graph queries for AI coding assistants. It parses codebases with tree-sitter into a persistent knowledge graph stored in SQLite, containing functions, classes, call relationships, HTTP routes, and cross-service links as nodes and edges.
Key Features and Specifications
- Single Go binary with zero infrastructure requirements (no Docker, no databases, no API keys)
- Supports 35 programming languages
- Sub-millisecond query performance
- Auto-syncs on file changes via background polling
- Cypher-like query language for complex graph patterns
- MIT licensed
Performance Benchmarks
The server was benchmarked across 35 real-world repositories, showing at least 10x fewer tokens for structural questions compared to traditional file-by-file exploration. Example: A query like "what calls ProcessOrder?" returns a precise call chain in one graph query (~500 tokens) instead of reading dozens of files (~80K tokens).
Tested repositories ranged from 78 to 49,000 nodes. The Linux kernel stress test handled 20,000 nodes and 67,000 edges with zero timeouts.
Use Case for Local LLM Setups
This is particularly valuable for local LLM setups with smaller context windows (8K-32K), where every token counts. The graph returns exactly the structural information needed without dumping entire file contents into context.
The server works with any MCP-compatible client or via CLI mode for direct terminal use.
📖 Read the full source: r/LocalLLaMA
👀 See Also
OpenClaw AI Agent with 6 Roles, Memory, and ADHD-Aware Design: Daily Ops Breakdown
A solo founder with ADHD built an open-source AI agent with 6 roles (action planner, debriefer, writer, legal, investigator, CRM) sharing memory, auto-generating follow-ups and drafts from transcripts.

Reasoning Guard: Proxy-Level Loop Detection for Local LLM Inference
A proxy-layer guard that detects and recovers from LLM reasoning loops using deterministic stream checks — token caps, n-gram repetition, and sentence fingerprinting — without model modifications.

memv MCP Server: Persistent Structured Memory for AI Agents
memv, an open-source Python memory layer for agents, now ships with an MCP server. It provides five tools for persistent, structured memory with per-user isolation and LLM-optional extraction.

Context-Kit: Open Source Tool for AI Assistant Configuration
Context-kit is a free tool that generates configuration files and skill documentation for AI coding assistants. It supports Claude Code, Cursor, Windsurf, GitHub Copilot, and Gemini CLI.