codegraphy-lite
CodeGraphy Lite π
π Try the Live Interactive Playground in your browser: codegraphy.software/#playground (No install required β runs 100% locally in web assembly)
CodeGraphy Lite is the standalone open-source distribution of CodeGraphy. It provides an interactive visual architecture canvas, living dependency graphs, and Model Context Protocol (MCP) server for Python and modern software codebases.
Built for developers and AI agents (Claude Code, Cursor, Windsurf, Cline), CodeGraphy Lite turns messy codebases into an intuitive, navigable 2D architectural map while slashing LLM context input tokens by -75.5%.
π Quickstart
Run the MCP server with no manual installation (requires uv and Python 3.9+):
uvx codegraphy-liteAdd it to Claude Code in one command:
claude mcp add codegraphy -- uvx codegraphy-liteOr add it to Cursor (.cursor/mcp.json or the global Cursor MCP config):
{
"mcpServers": {
"codegraphy": {
"command": "uvx",
"args": ["codegraphy-lite"],
"env": {
"CODEGRAPHY_ROOT": "/absolute/path/to/your/project"
}
}
}
}To use the local web UI instead, run uvx codegraphy-lite serve /path/to/project --scan.
Lite is MIT-licensed, scans up to 150 files, and exposes exactly 3 MCP tools. Pro-only features are not included.
Related MCP server: Knossos MCP
π€ Model Context Protocol (MCP) Setup
CodeGraphy Lite includes a built-in MCP server that communicates over STDIO (JSON-RPC 2.0 / MCP 2024-11-05 standard). Use uvx codegraphy-lite for a zero-install start; codegraphy-mcp remains available as an installed alias.
Available MCP Tools
list_workspace_topics: Lists all architectural topics, status, lane, file counts, and descriptions.get_topic_context: Fetches topic details, 1-hop connected dependencies, and AST-extracted class/function signatures.get_architecture_summary: Returns project architecture metrics, dependency statistics, and status distribution.
Configuration for Cursor
In Cursor settings (Cursor Settings -> Features -> MCP -> Add new MCP server):
Name:
codegraphyType:
commandCommand:
codegraphy-mcp
Or add directly to your project's .cursor/mcp.json or global configuration:
{
"mcpServers": {
"codegraphy": {
"command": "codegraphy-mcp"
}
}
}Configuration for Claude Code
Add the following to your Claude Code configuration (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"codegraphy": {
"command": "codegraphy-mcp",
"env": {
"CODEGRAPHY_ROOT": "/absolute/path/to/your/project"
}
}
}
}π Empirical Token Benchmark (-75.5% Context Savings)
In an isolated comparative benchmark across 6 real-world closed bugfixes in major Python repositories (encode/httpx, tiangolo/typer, Textualize/rich), CodeGraphy Lite reduced agent context input tokens by 75.5% (4.08x savings) compared to standard keyword grep and whole-file reading:
Mode | Input Tokens ( | Context Reduction | Acceptance Pass Rate | Tokens / Solved Task |
Baseline (Grep + Whole Files) | 144,686 | 0.0% (ref) | 100.0% (6/6) | 24,114 |
CodeGraphy Lite MCP | 35,457 | -75.5% (4.1x savings) | 100.0% (6/6) | 5,909 |
CodeGraphy Pro (Desktop Ref)* | 64,348 | -55.5% (2.25x savings) | 100.0% (6/6) | 10,724 |
*CodeGraphy Pro numbers reflect deep symbol graph index lookups and blast-radius impact analysis.
π Read the full benchmark methodology, task breakdowns, and honest limitations analysis in benchmarks/BENCHMARK.md.
βοΈ Lite vs Pro Comparison
CodeGraphy Lite is free and open-source (MIT). For larger codebases, polyglot repositories, and architectural drift protection, check out CodeGraphy Pro:
Capability | CodeGraphy Lite (Free / OSS) | CodeGraphy Pro ($19 Lifetime) |
Pricing & License | Free (MIT License) | $19 Lifetime License |
Visual Architecture Canvas | β Interactive 2D Canvas | β Interactive 2D Canvas |
Workspace Export / Import | β
Human-readable | β
Human-readable |
Project File Limit | 150 files (Ideal for packages & services) | Unlimited (Enterprise mono-repos) |
Supported Languages | Python AST ( | Polyglot (Python, TS, JS, Go, Rust, C#, Java) |
MCP Server Tools | 3 Core Tools | 11 Industrial Intelligence Tools |
Blast Radius & Impact Analysis | β None | β Direct & Transitive Blast Radius Scoring |
Symbol Indexer | Top-level signatures | β Project-wide FQN symbol & reference index |
Architecture Linter & Drift | β None | β Tarjan cycle detection & layer boundary checks |
Git Architecture Diff | β None | β Visual PR & Branch architecture diff overlay |
π Compare all features or get a license at codegraphy.software/#compare.
β¨ Features
πΊοΈ Unified Architecture Graph: Interactive React Flow graph displaying modules, services, and dependency edges with real-time drag-and-drop layout.
ποΈ Split Layers & Lanes: Group architectural topics by workflow stage (
Planning,Development,Testing,Done).π Semantic Zoom: Multi-level zoom with automatic Level-of-Detail (LOD)βzoom in to inspect function signatures and attached files, zoom out for high-level module topology.
π Portable
.cg.mdWorkspaces: Human-readable Markdown workspace specification format with two-way import/export.β‘ Lightweight AST Scanner: Fast project scanner using Python's standard library
ast.parse()and regex import matching (scans up to 150 files).π€ STDIO MCP Server (
codegraphy-mcp): Exposes 3 essential architectural intelligence tools to AI assistants via JSON-RPC 2.0.π 100% Local-First & Private: No cloud telemetry, no code uploads. Your codebase never leaves your machine.
π οΈ CLI Reference
Usage:
codegraphy-lite Start the MCP STDIO server (default)
codegraphy-lite mcp Start the MCP STDIO server
codegraphy-lite serve [path] Start the local web UI (default path: .)
codegraphy-lite --version Show the installed version
serve options:
-h, --help Show this help message and exit
path Target project directory to visualize (default: current directory)
--port PORT HTTP server port (default: 8000)
--host HOST HTTP server bind host (default: 127.0.0.1)
--no-browser Do not automatically launch the browser
--scan Force automatic project directory scan on startup (up to 150 files)
-v, --version Show program's version number and exitπ Repository Structure
codegraphy-lite/
βββ LICENSE # MIT License
βββ README.md # Documentation
βββ pyproject.toml # PEP 517/621 package metadata & entrypoints
βββ MANIFEST.in # Manifest for sdist packaging
βββ .gitignore # Git ignore rules
βββ benchmarks/ # Reproducible architecture benchmarks
β βββ BENCHMARK.md # Comprehensive 6-bug benchmark report
β βββ run_benchmark.py # Standalone benchmark runner (no machine-specific paths)
β βββ benchmark_results.json
βββ codegraphy_lite/ # Core Python package
β βββ __init__.py # Version definition (1.0.1)
β βββ cli.py # `codegraphy-lite` CLI entrypoint
β βββ mcp.py # `codegraphy-mcp` STDIO JSON-RPC 2.0 server
β βββ models.py # Pydantic models for graph & workspace
β βββ scanner.py # Safe stdlib AST scanner (max 150 files)
β βββ server.py # FastAPI REST & WebSocket server
β βββ storage.py # Local persistence & .cg.md codec
β βββ web/ # Bundled visual UI assets
βββ tests/ # Unit test suite
βββ test_scanner.py
βββ test_mcp.py
βββ test_server.pyπ§ͺ Running Tests
pip install -e ".[test]"
pytest tests/ -vπ License
CodeGraphy Lite is licensed under the MIT License.
Available Tools
3 toolsget_architecture_summaryB
Summarize project architecture: module and dependency counts, lifecycle distribution, lanes, and the most connected modules.
Inputs: no named parameters.
get_topic_contextB
Get one module's description, 1-hop dependencies, and AST signatures from its attached files.
Inputs: topic (required), include_ast.
list_workspace_topicsB
List workspace modules with lifecycle state, files, and dependency counts; includes truncation metadata for the 150-file cap.
Inputs: status.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 3 tools
Each tool occupies a distinct level of the same hierarchy: enumerate modules, inspect one module in detail, and roll everything up into a project-wide summary. There is no realistic way to confuse list_workspace_topics with get_topic_context or get_architecture_summary, since each targets a different granularity (collection, single item, aggregate).
All three names follow a strict snake_case verb_noun pattern (list_/get_/get_ + domain noun). The vocabulary is also coherent: 'topic' is used consistently alongside 'workspace' and 'architecture' in a way that maps to the same domain model.
Three tools is on the thin side but fits a deliberately 'lite', read-only code graph explorer where each tool earns its place. There is no filler or redundancy, though a fourth tool (e.g. search/lookup) would round the surface out.
The read-only lifecycle (enumerate, inspect, aggregate) is fully covered and there are no dead ends for the stated analysis purpose. Minor gaps remain: no way to search or filter modules by name, no traversal beyond 1-hop dependencies, and no file-content access beyond AST signatures.
Maintenance
Related MCP Connectors
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Repository knowledge graph MCP server for codebase understanding and debugging.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA local MCP server that gives AI coding agents symbol definitions, dependency graphs, and a live architecture vocabulary for TypeScript/JavaScript repos, with no network or embeddings.16 npmMIT
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP server that scans a repository once and answers architecture questions from an evidence-backed graph, enabling dependency analysis, impact analysis, and codebase exploration without re-reading the source tree.8MIT
- AlicenseNot gradedqualityBmaintenancePrivate, local-first code intelligence MCP server that builds a static graph of repositories and exposes search, architecture, impact analysis, and review tools via MCP.MIT
- AlicenseNot gradedqualityCmaintenanceLocal repository intelligence MCP server that builds a reusable graph of code structure for AI coding agents, providing 34 network-free tools for understanding, searching, and analyzing repositories without data leaving the machine.MIT