Labsco
MCP SERVER

polycodegraph

by smochan

Trace one parameter from a frontend fetch through every layer to the SQL query it ends up in.

Code Intelligence & Repository Indexing
Summary
The route-to-SQL trace is the thing a grep-based assistant cannot do.

dataflow_trace returns ordered hops — route to handler to service to repository to SQL — with the argument flow at each one, because the graph stitches URL shapes across the stack so a frontend fetch resolves to its handler. Everything else falls out of the same graph rather than needing its own index.

What it is

A code graph server. It parses a repository with tree-sitter into a queryable graph of symbols, calls, routes and frontend fetches, and answers structural questions over it.

What you get
  • Symbols and calls: find_symbol, callers and callees — with the argument text captured at each call site
  • Impact: blast_radius, subgraph, cycles, hotspots, metrics
  • Gaps: dead_code and untested, both decorator-aware so framework handlers are not mistaken for dead code
  • Search: semantic_search, and hybrid_search reranked by graph distance from a focal symbol
  • Dataflow: dataflow_routes, dataflow_fetches, dataflow_trace
  • Across repositories: workspace_state, workspace_diff_since, workspace_blast_radius
  • Python, TypeScript, JavaScript, TSX/JSX and Go, with FastAPI, Flask, aiohttp, Express and NestJS route detection
Requirements

Pip install polycodegraph, then codegraph init and codegraph build to parse the repository into .codegraph/graph.db. The CLI, the Python module and the MCP server are all codegraph. semantic_search needs codegraph embed to have been run first. Python 3.10+.

Setup effort

One command — pip install polycodegraph