Code Graph
Constructs a lightweight code graph from TypeScript and Python source code, then exposes it via an MCP server for agentic client queries.
Code Graph provides a self-contained, lightweight code graph for TypeScript and Python projects, designed for integration with agentic clients like Claude Desktop, Cursor, and OpenAI Agents. It eliminates the need for heavyweight indexers by parsing code with standard tools, extracting symbols and their relationships, and storing them in a simple JSON format. The built-in MCP server exposes powerful query capabilities, allowing AI agents to resolve symbols, trace references, identify related code, analyze impact from diffs, and stream code snippets for context.
Key Features
01Ingests TypeScript (via compiler API) and Python (via `ast` module) without requiring a build step.
02Extracts symbols (functions, classes, methods, variables, modules) and edges (import, call, member_of, defines) to form a code graph.
03MCP server provides tools for fuzzy symbol lookup (`graph.resolve_symbol`), inbound references (`graph.references`), and k-neighbors (`graph.related`).
04Offers `graph.impact_from_diff` to calculate the impact of code changes from a patch file.
05Exposes a `code://file` resource to stream specific code snippets for AI agent context windows.
060 GitHub stars
Use Cases
01Empowering AI agents (e.g., Claude Desktop, Cursor, Copilot Studio) with structured, queryable access to project codebase information.
02Analyzing the potential impact of code changes by identifying affected files and their one-hop neighbors from a given patch.
03Providing context-aware code snippets to large language models for better understanding and generation capabilities.