Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"cgraphy": {
"args": [
"cgraphy",
"serve",
"/path/to/repo"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Paper (DOI): https://doi.org/10.5281/zenodo.21422935 PyPI: https://pypi.org/project/cgraphy/ GitHub: https://github.com/pmgarg/cgraphy
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
uvx 'cgraphy' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked cgraphy against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in other
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 60-95% fewer tokens, same answers. Library, proxy, MCP server.
Pi Coding Agent extension (CLI-first) — routes bash/read/grep/find/ls through lean-ctx CLI for strong token savings. Optional MCP bridge can register advanced tools.
97% token reduction for AI coding sessions — zero deps, 21 languages, MCP server
One local source for the MCP servers, tools, and memory your AI coding agents share, synced into each tool's native config with a review gate and a receipt for every change. No daemon, no lock-in.
MCP Security Weekly
Get CVE alerts and security updates for io.github.pmgarg/cgraphy and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Paper (DOI): https://doi.org/10.5281/zenodo.21422935
PyPI: https://pypi.org/project/cgraphy/
GitHub: https://github.com/pmgarg/cgraphy
cgraphy is a Python code knowledge graph and Model Context Protocol (MCP) server for AI coding agents such as Claude Code, Codex CLI, Cursor, and Gemini CLI.
cgraphy indexes any codebase into a knowledge graph — functions, classes and files as nodes; calls, imports, inheritance and git co-change history as edges — and serves compact, token-budgeted slices of it to AI assistants through the Model Context Protocol. Instead of re-reading dozens of files to orient itself on every prompt, an agent asks the graph and gets the relevant subgraph in a couple of thousand tokens.
cgraphy_context expands the graph greedily around a
symbol and stops exactly at your token budget — cost scales with the
question, not the repo.--git-history mines commit history for files that change
together (logical coupling), an edge type static analysis can't see..cgraphy/. No services, no
daemons, no vector database.pip install cgraphy # or: uv tool install cgraphy
cd your-repo
cgraphy init # one command: MCP config + agent steering + index
cgraphy init does three things:
.mcp.json — picked up automatically by Claude
Code in all its forms: CLI, VSCode extension, and the desktop app.CLAUDE.md and AGENTS.md telling agents to
consult the graph (cgraphy_overview → cgraphy_search →
cgraphy_context) before reading files — this is what makes the graph
actually replace bulk file reading. (Agents can't be forced, only steered:
instruction files + persuasive tool descriptions + the tools being
genuinely faster is the mechanism, and it works.)Or register the MCP server manually with your assistant:
Claude Code
claude mcp add cgraphy -- uvx cgraphy serve /path/to/repo
Codex CLI (~/.codex/config.toml)
[mcp_servers.cgraphy]
command = "uvx"
args = ["cgraphy", "serve", "/path/to/repo"]
Gemini CLI (~/.gemini/settings.json) / Cursor (.cursor/mcp.json)
{"mcpServers": {"cgraphy": {"command": "uvx",
... [View full README on GitHub](https://github.com/pmgarg/cgraphy#readme)