Maps PHP codebases into a static-analysis graph for architecture, dependency, route, message, and change-impact questions.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Phpgraph.
overviewStart here: Composer stack, namespace tree with layers, bounded contexts, layer-rule violations, messages, HTTP routes (each with method, path, controller and file up to 30, else grouped by path prefix), services, and what the graph cannot see.
query_graphFind the code about a topic when you do not know the class names, by the words of their names (validated finds `Validator`), with the classes of the feature around the ones it names. A question about routes (*"mooc courses routes"*, *"GET /courses"*) returns the matching routes and their controller…
outlineBefore explaining a feature: its structural outline, enough to read only the few files with non-obvious logic. The classes it is made of, by namespace and layer, with the first sentence of their docblock, their public signatures, constants and enum cases; the interfaces and base classes around it w…
get_nodeRead one class, method, route or channel with all its relations; tests using it are counted by module.
get_neighborsSee what uses a node (`in`) or what it depends on (`out`).
impact_ofBefore a change: every class that depends on a class or method, nearest first, with the lines of the calls; callers through the interface it implements; code depending on the state it writes; the routes reaching it, with each chain; and the tests to run, found through test helpers. It flags the cla…
The phpgraph MCP server parses a PHP project and represents its structural relationships as a graph. It can describe the Composer stack, namespace hierarchy, architectural layers, bounded contexts, layer-rule violations, services, messages, HTTP routes, and known blind spots. The analysis is deterministic: relationships are marked as extracted from code, inferred from declared types, or ambiguous when resolution is uncertain.
The graph covers common PHP patterns and frameworks, including Symfony, Laravel, Ecotone, PrestaShop, WordPress, and plain PHP. It can connect calls, message senders and handlers, routes and controllers, dependency-injection configuration, API schemas, protobuf implementations, and links between microservices. The project remains local; phpgraph parses code but does not run it.
phpgraph uses nikic/php-parser to analyze the project. Its call analysis uses signatures, return types, local variables, docblocks, and dependency signatures to resolve direct and chained calls. It also reads relevant PHP, YAML, and XML configuration for services, routes, tags, and message wiring.
The phpgraph MCP server creates its graph when an agent first requests information, then rebuilds incrementally when files change. The README reports roughly three seconds per edit for an 8,400-file project. Unresolved calls, missing vendor files, messages without handlers, and other gaps are reported so an agent can distinguish known relationships from areas requiring source inspection.
Installation is available as a standalone executable for Linux, macOS, and Windows, with architecture support described by the project. The install scripts verify the downloaded binary with SHA-256 and place it in a user directory; PHPGRAPH_INSTALL_DIR can change that location. Alternatives include Composer, a downloaded PHAR, or the published Docker image. Composer and Docker usage require the corresponding local tooling.
Run phpgraph mcp-config with a supported output target to generate connection configuration. The README documents formats for Sherpa, Claude Code, Codex, Cursor, and generic MCP clients over stdio. A direct server command uses phpgraph serve and can include the project path.
The phpgraph MCP server provides these tools:
overview summarizes the project stack, namespaces, layers, contexts, violations, messages, routes, services, and analysis limits.query_graph searches by words in names and can return related classes or matching routes.outline presents a feature’s classes, layers, docblock opening sentences, public signatures, constants, enum cases, interfaces, and base classes.get_node reads a class, method, route, or channel with its relationships and module-level test counts.get_neighbors lists incoming users or outgoing dependencies.impact_of traces dependent classes and methods, interface callers, affected state consumers, route chains, relevant contracts, and tests.shortest_path finds a connection between two code elements.god_nodes identifies highly connected dependency hubs.Results depend on what static analysis can resolve. Dynamic or unresolved behavior may be absent or labelled as ambiguous, and the tool explicitly reports gaps rather than filling them with generated guesses. It is therefore suited to structural exploration and impact analysis, but agents may still need to read source files for logic the graph cannot establish.
The project requires PHP 8.2 or newer when using the PHP-based installation paths, while the standalone binary is supplied with a static PHP runtime. Its license is PolyForm Shield 1.0.0.
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/phpgraph)<a href="https://allmcps.com/mcp/phpgraph"><img src="https://allmcps.com/api/badge/phpgraph?style=directory" alt="Phpgraph on AllMCPs" /></a>