Graph Context
@yuqiaohan95
About Graph Context
MCP server for intelligent code context — 87%+ token savings, zero resource overhead.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"graph-context": {
"command": "python",
"args": [
"-m",
"tests.experiment"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Graph Context?
Graph Context is an MCP server that retrieves precise code context using AST call graphs and BM25 ranking, designed for AI coding assistants. It runs pure Python with no GPU or external services, delivering token savings of 87%+ for single-agent and multi-agent workflows.
How to use Graph Context?
Install with pip install graph-context (or graph-context[full] for Chinese tokenization and file watching). Run as an MCP server with the command graph-context, optionally setting environment variables like PROJECT_ROOT, MCP_MAX_TOKENS, and MCP_TOP_K. Integrate with Claude Desktop, Cursor, or Cline via a JSON configuration pointing to the command. Programmatic usage is also available via the VibeCodingEngine class.
Key features of Graph Context
- AST call graph for precise cross‑file dependency resolution
- BM25 ranking with self‑evolving rules engine
- Dynamic tool loading — only 2 tools at startup (~270 tokens)
- MVCC snapshots for read‑write isolation in multi‑agent setups
- Zero external dependencies: pure CPU, no GPU, no network calls
- Built‑in Chinese‑English synonym mapping for cross‑language queries
Use cases of Graph Context
- Single‑agent coding sessions: stable ~2,000 tokens per turn, no forgetting
- Multi‑agent collaboration: shared index with independent snapshot reads
- Reducing LLM API costs by cutting token consumption 76–90%
- On‑demand code retrieval for large projects without dumping the whole codebase
FAQ from Graph Context
How does Graph Context compare to vector‑database approaches?
Graph Context requires no vector DB deployment, no GPU for embeddings, no external API calls, and no large memory footprint. It uses lightweight BM25 inverted indices and AST‑level exact matching instead of semantic similarity.
What are the runtime requirements?
Pure Python — no GPU, no external services. The full install adds Chinese tokenization and file‑watching dependencies. Index persistence and rules are stored as local JSON files (configurable paths).
Where does my code and data live?
All data stays local on your machine. Index persistence is optional; by default the index is built in memory. Rules and scopes are saved to JSON files on disk (paths controlled by MCP_RULES_PATH and MCP_SCOPES_PATH).
What transport or authentication does Graph Context use?
It runs as a local MCP server over stdio transport, started via the graph-context command. No authentication is required because it operates entirely on the local machine.
Are there any known limits or accuracy trade‑offs?
Benchmarks show 100% recall on small projects and up to 97% recall on large projects when using the self‑evolving rules engine. Token savings range from 76% to 91% depending on project size and whether rules are applied.
Frequently asked questions
How does Graph Context compare to vector‑database approaches?
Graph Context requires no vector DB deployment, no GPU for embeddings, no external API calls, and no large memory footprint. It uses lightweight BM25 inverted indices and AST‑level exact matching instead of semantic similarity.
What are the runtime requirements?
Pure Python — no GPU, no external services. The `full` install adds Chinese tokenization and file‑watching dependencies. Index persistence and rules are stored as local JSON files (configurable paths).
Where does my code and data live?
All data stays local on your machine. Index persistence is optional; by default the index is built in memory. Rules and scopes are saved to JSON files on disk (paths controlled by `MCP_RULES_PATH` and `MCP_SCOPES_PATH`).
What transport or authentication does Graph Context use?
It runs as a local MCP server over stdio transport, started via the `graph-context` command. No authentication is required because it operates entirely on the local machine.
Are there any known limits or accuracy trade‑offs?
Benchmarks show 100% recall on small projects and up to 97% recall on large projects when using the self‑evolving rules engine. Token savings range from 76% to 91% depending on project size and whether rules are applied.
Basic information
More Other MCP servers
ACI: Open-Source Infra to Power Unified MCP Servers
aipotheosis-labsACI.dev is the open source tool-calling platform that hooks up 600+ tools into any agentic IDE or custom AI agent through direct function calling or a unified MCP server. The birthplace of VibeOps.
Codelf
unbugA search tool helps dev to solve the naming things problem.

EverArt
modelcontextprotocolModel Context Protocol Servers
Nginx UI
0xJackyYet another WebUI for Nginx
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
Comments