Skip to content
All posts

What you can do with a scan

Follow who calls who through the graph instead of grepping, see what a pull request affects, and give your coding agent the same view through Graphnous's MCP server.

The Graphnous team

5 min read

In What a scan does we followed a scan from a Git URL to a graph in Neo4j. This post is about what comes after: what you, your pull requests and your coding agent can do with that graph.

Follow calls, not text

Say you want to change OrderService.findById. Who calls it?

The usual answer is to grep for findById. You get every method of that name in the codebase, the mocks in the tests, a comment and a log line. Then you open each hit to work out which ones actually call this method, and grep again for the callers of those.

Instead of grepping over the code and finding the callers by hand, you can traverse the graph to see who calls who. The scanner already resolved every call to the method it reaches, so the callers are a relationship away, and their callers one more:

On the left, grep for findById: matches across files, of which only some call OrderService.findById. On the right, the graph: OrderService.findById, the methods that call it, and the methods that call those, up to an endpoint.

MATCH (:Class {name: "OrderService"})-[:HAS_METHOD]->(target:Method {name: "findById"})
WHERE target.scanId = $scanId
MATCH path = (caller:Method)-[:CALLS*1..3]->(target)
RETURN [method IN nodes(path) | method.name] AS chain

Only the real callers, three levels out. The same goes for what instantiates a class, extends or implements it, and reads or writes a field.

Across projects, over HTTP

Callers don't stop at the edge of a repository. A React app calls GET /orders/{id} with fetch; a Spring controller serves it. The enhancers recognise both sides, and Graphnous matches the call to the endpoint by its URL and HTTP method, across the projects of a system.

That answers questions a single repository can't:

  • What calls this endpoint? Every call in the system, with its project, file and line.
  • Which endpoints does nothing call? Candidates for removal.
  • Which calls reach no endpoint? A call to a service outside the system, or to an endpoint that was renamed or removed.

Coming soon: system enhancers

Enhancers run on one project at a time: the Spring enhancer finds the endpoints of a backend, the React enhancer the components of a frontend. Matching HTTP calls to endpoints across projects is built into Graphnous itself.

Soon, system enhancers will run over every project of a system at once, so any enhancer can add the relationships between projects:

  • Which frontend calls which backend. The fetch call in a React component linked to the Spring endpoint that serves it, and the other way around: every frontend that breaks when you change that endpoint.
  • Which backend emits an event, and which listens to it. A service that publishes an OrderPlaced event, linked to every service that consumes it, so you can follow a change through a system that talks over events, not only over HTTP.

The graph of a system then shows how its projects fit together, not just what's inside each one.

What a pull request affects

Every scan is a snapshot of a revision, so two scans can be compared: a branch with main, node by node. Graphnous lists what the branch adds, removes and changes, then follows the usages of everything removed or changed:

  • the classes, methods and fields it removes or changes, most used first, with where they're used, in this project and the others of the system;
  • the endpoints it removes and adds;
  • the HTTP calls that reached an endpoint on main and reach none on the branch.

The Graphnous GitHub App, or the impact report GitHub Action, posts that as a comment on the pull request and updates it on every push. Reviewers see what a change affects before they read the diff.

Ask the assistant

The web app has an assistant you can ask in plain language: "Which endpoints use OrderService?", "What does this branch break?". It doesn't answer from the text of your code. It looks things up in the graph, and it can hand a change to a dedicated impact agent that works out what that change risks breaking.

Give your coding agent the graph

Graphnous is also an MCP server, at /mcp on the Graphnous server. Coding agents such as Claude Code can use it to look things up before they change your code. Add it with one command:

claude mcp add --transport http graphnous http://localhost:1337/mcp

An agent normally does what you'd do: grep, open files, guess which hits matter, and spend its context on reading code. With the MCP server, it asks the graph instead:

ToolWhat it answers
findFileThe file I'm working on, by the repository's URL and its path: what it declares, with ids to follow
findUsagesWhat calls, instantiates, extends, overrides, reads or writes this, up to three levels out, and the HTTP calls to the endpoint it serves
listEndpointsA system's endpoints, the method serving each and every call to it; or only the ones nothing calls
listUnmatchedCallsThe HTTP calls that reach no endpoint
compareScansWhat one scan adds, removes and changes from another
analyzeImpactWhat a branch affects: the same report as on a pull request

A typical session: the agent calls findFile for the file it's about to edit, then findUsages on the method it wants to change, and knows every caller before it writes a line. Before you merge, analyzeImpact tells it what the branch breaks, so it can fix those places too.

The tools are read-only, and with security on, the agent uses an API key and only sees what you're allowed to see.

Try it

Graphnous is open source. Run it with Docker Compose from graphnous-oss, scan a repository, and point your coding agent at http://localhost:1337/mcp.