Skip to main content
Glama

CodeGraphy Lite 🌐

PyPI License: MIT Python 3.9+ MCP Spec

πŸš€ 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-lite

Add it to Claude Code in one command:

claude mcp add codegraphy -- uvx codegraphy-lite

Or 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

  1. list_workspace_topics: Lists all architectural topics, status, lane, file counts, and descriptions.

  2. get_topic_context: Fetches topic details, 1-hop connected dependencies, and AST-extracted class/function signatures.

  3. 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: codegraphy

  • Type: command

  • Command: 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 (cl100k_base)

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 .cg.md

βœ… Human-readable .cg.md

Project File Limit

150 files (Ideal for packages & services)

Unlimited (Enterprise mono-repos)

Supported Languages

Python AST (ast.parse())

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.md Workspaces: 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 tools
get_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

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    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).

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A 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 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Local-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.
      8
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Local 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