← All work

Personal project · open source

Cast Review

Built a pull-request review platform that indexes the repository as a Neo4j graph and exposes indexing, context and analysis through an MCP server.

Role
Product, architecture and development
Status
Under active development
Stack
  • NestJS
  • TypeScript
  • FastAPI
  • LangGraph
  • Neo4j
  • tree-sitter
  • Redis
  • BullMQ
  • MCP SDK
  • React
  • SSE
PullRequestthe diff hides whodepends on itrepositoryNestJS +BullMQ queuetree-sitter:symbols + relationsNeo4jcode graphcontext withina token budgetPRD+ approvalspec+ approvaltestreviewerarchitecturereviewerreportbuilderinline PRcommentscontextClaude Code,Cursor…MCP server5 toolsanalysisindex + contextopaque token → 2-min JWT · rate limitfrom index to PR comment

Problem

Reviewing only the diff misses the impact outside it: who calls the changed function, which tests cover it, which architectural boundary was crossed.

Available data

The repository itself: files, symbols and the relations between them. The diff says what changed; the graph says what that change touches.

Architecture decisions

Code as a graph

tree-sitter extracts symbols and relations (defines, references, imports, tests). Neo4j stores the graph per repository and commit, with a Redis lock and incremental re-indexing. Indexing runs outside the request, on a BullMQ queue.

Context on a budget

For the changed files, the AI service assembles related context from the graph within a token budget before calling the reviewers.

Human in the loop

The LangGraph review graph drafts a PRD and a change spec, each with human approval. Once approved, the test and architecture reviewers run in parallel and a report builder consolidates the findings.

MCP as a boundary

A separate MCP server (Streamable HTTP): the opaque token is exchanged for a two-minute acting JWT via introspection, with rate limiting. The tools are a thin proxy to the backend and the AI service.

Implementation

MCP server tools

  • index_repository — triggers incremental indexing of a repository.
  • get_index_status — reports whether the repository is indexed and its latest indexed commit.
  • get_related_context — returns the graph context linked to the changed files, within a token budget.
  • run_pr_analysis — starts an asynchronous PR analysis and returns its analysisId.
  • get_analysis — fetches the state of a running analysis.
  • Outside MCP: a repository chat with graph navigation tools (search_symbols, read_symbol, neighbors, list_endpoints, cross_repo_links) and findings published as inline PR comments, with progress over SSE.

Result

  • 5MCP tools
  • 2reviewers in parallel

An end-to-end flow, from index to PR comment, available through the web UI and any MCP client — Claude Code, Cursor and others.

Limits and lessons

  • Personal project under active development.
  • Current reviewers cover tests and architecture; other domains do not exist yet.
  • The MCP server does not edit code: it exposes indexing, context and analysis.
Next caseGroundtruth — an evaluation gate for RAG →