phpgraph
What it does
PHP code graph for AI agents: impact of a change, feature outlines, handlers, routes, layer rules
- Connects パソコンで動く
- Account or key No key needed
- Category 検索・AIの記憶
インストール
使っているAIアプリを選んで、設定をコピーしてください。
チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月14日
まず:どの AI を使っていますか?
使っているアプリを選ぶと、下に手順が表示されます。
Claude につなげますが、先に準備が必要です
先にパソコンへ Docker を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
Docker を入れる(まだなければ)
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
docker --version- バージョン番号(例 Docker version …)が出る = 入っています。この手順は飛ばせます
- "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
ターミナルの開き方
Mac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: Docker Desktop を入れます:Mac は Docker.dmg を開いてアイコンを「アプリケーション」へドラッグ(Mac に合わせて Apple silicon か Intel を選ぶ)· Windows は Docker Desktop Installer.exe をダブルクリック · 入れたら Docker Desktop アプリを開いたままにします。curl コマンドは不要です
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です:
docker --version一度入れれば、Docker を使うすべてのツールで使えます
パソコン版 Claude アプリの設定ファイルを開く
SettingsDeveloperEdit Config
この設定を貼り付けて保存
{ "mcpServers": { "phpgraph": { "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/hbenabdallah/phpgraph:2.1.0" ] } } }Claude を終了してもう一度開く
試してみる
phpgraph を使って、私に何ができるか教えて、1 つやってみせて✓ Claude が phpgraph を使っていると言うか、回答に phpgraph のツール名が出れば接続成功です
メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
ChatGPT はまだ phpgraph につなげません
phpgraph はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません
代わりにできること
A · phpgraph につなげるアプリを使う
- 先にパソコンへ Docker を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
- 先にパソコンへ Docker を入れてください(1 回だけ)
- 先にパソコンへ Docker を入れてください(1 回だけ)
- 先にパソコンへ Docker を入れてください(1 回だけ)
Claude Code につなげますが、先に準備が必要です
先にパソコンへ Docker を入れてください(1 回だけ)
Docker を入れる(まだなければ)
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
docker --version- バージョン番号(例 Docker version …)が出る = 入っています。この手順は飛ばせます
- "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
ターミナルの開き方
Mac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: Docker Desktop を入れます:Mac は Docker.dmg を開いてアイコンを「アプリケーション」へドラッグ(Mac に合わせて Apple silicon か Intel を選ぶ)· Windows は Docker Desktop Installer.exe をダブルクリック · 入れたら Docker Desktop アプリを開いたままにします。curl コマンドは不要です
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です:
docker --version一度入れれば、Docker を使うすべてのツールで使えます
ターミナルを開く
Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く
このコマンドを貼り付けて Enter
claude mcp add --scope user phpgraph -- docker run -i --rm ghcr.io/hbenabdallah/phpgraph:2.1.0Claude Code で /mcp と入力
phpgraph が一覧にあり、接続済みと表示されれば OK です
試してみる
phpgraph を使って、私に何ができるか教えて、1 つやってみせて✓ Claude Code が phpgraph を使っていると言うか、回答に phpgraph のツール名が出れば接続成功です
メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
Cursor につなげますが、先に準備が必要です
先にパソコンへ Docker を入れてください(1 回だけ)
Docker を入れる(まだなければ)
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
docker --version- バージョン番号(例 Docker version …)が出る = 入っています。この手順は飛ばせます
- "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
ターミナルの開き方
Mac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: Docker Desktop を入れます:Mac は Docker.dmg を開いてアイコンを「アプリケーション」へドラッグ(Mac に合わせて Apple silicon か Intel を選ぶ)· Windows は Docker Desktop Installer.exe をダブルクリック · 入れたら Docker Desktop アプリを開いたままにします。curl コマンドは不要です
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です:
docker --version一度入れれば、Docker を使うすべてのツールで使えます
Cursor の AI チャットを Agent モードで開く
試してみる
phpgraph を使って、私に何ができるか教えて、1 つやってみせて✓ Cursor が phpgraph を使っていると言うか、回答に phpgraph のツール名が出れば接続成功です
メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
VS Code につなげますが、先に準備が必要です
先にパソコンへ Docker を入れてください(1 回だけ)
Docker を入れる(まだなければ)
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
docker --version- バージョン番号(例 Docker version …)が出る = 入っています。この手順は飛ばせます
- "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
ターミナルの開き方
Mac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: Docker Desktop を入れます:Mac は Docker.dmg を開いてアイコンを「アプリケーション」へドラッグ(Mac に合わせて Apple silicon か Intel を選ぶ)· Windows は Docker Desktop Installer.exe をダブルクリック · 入れたら Docker Desktop アプリを開いたままにします。curl コマンドは不要です
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です:
docker --version一度入れれば、Docker を使うすべてのツールで使えます
VS Code の AI チャットを Agent モードで開く
試してみる
phpgraph を使って、私に何ができるか教えて、1 つやってみせて✓ VS Code が phpgraph を使っていると言うか、回答に phpgraph のツール名が出れば接続成功です
メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
開発者向け:ターミナルのコマンドと JSON 設定
パソコンにインストール
Claude Code
claude mcp add --scope user phpgraph -- docker run -i --rm ghcr.io/hbenabdallah/phpgraph:2.1.0Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"phpgraph": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/hbenabdallah/phpgraph:2.1.0"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"phpgraph": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/hbenabdallah/phpgraph:2.1.0"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"phpgraph": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/hbenabdallah/phpgraph:2.1.0"
]
}
}
}この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
ひと目でわかる
使えるアプリ
このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。
パソコン上で動かせるアプリ
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
できること
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
基本チェックi
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月15日にチェック
- ✓ 合格
作者とリポジトリが一致
レジストリ名は、リポジトリを所有するGitHubアカウント hbenabdallah で確認済みです
- ✓ 合格
今もメンテナンスされている
コードの最終更新:昨日
- ✓ 合格
ライセンスがある
MITを使用
- – 対象外
エンドポイントが応答する
これはパソコンで動くため、インターネット上のエンドポイントはありません
- – 対象外
OAuthでサインイン
パソコンで動き、代わりにローカルの設定を使います
- … 未チェック
ツールの説明に隠れた指示がない
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
話し合い
質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。
ユーザーレビュー
まだレビューはありません
検索・AIの記憶のほかのサーバーとの比較i
- このカテゴリのほかの6135件のうち85%よりスターが多い
- このカテゴリのほかの6135件のうち96%より最近レジストリに公開
- 基本チェックの結果が、このカテゴリのほかの6135件のうち100%と同じかそれ以上
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
よくある質問
phpgraphは安全ですか?
当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
どんなキーやコードが必要ですか?
レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。
パソコンで動きますか、それともクラウドですか?
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
今もメンテナンスされていますか?
GitHubリポジトリの最終更新は昨日、最新バージョン(2.1.0)がレジストリに届いたのは昨日です。
どのアプリで使えますか?
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにDockerも必要です。
代わりに使えるものは?
同じカテゴリには:Context7, Codebase Memory, OpenSEO
同じカテゴリのほかの候補
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Codebase Memory
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
OpenSEO
Keyword research, site audits, rank tracking and AI visibility for your AI agent.
作者のREADME
READMEを開く
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
A knowledge graph of your PHP codebase, for AI coding agents.
Static analysis served over MCP to Sherpa , Claude Code, Codex, Cursor and any MCP client.
No LLM, no network, no embeddings: deterministic facts, each with a confidence level.
English · Français
What it answers
An agent in a PHP project it does not know greps names and reads files. That works until the answer goes through something a search of names does not show: an interface, the container configuration, a bus, a route, another service. phpgraph parses the whole project once (with nikic/php-parser, docblocks with phpstan/phpdoc-parser) and answers from a graph, in one call:
- What breaks if I change this method?
impact_oflists every dependent, nearest first, callers through the interface it implements included, the routes reaching it and the tests to run. Sylius, the 17 callers ofOrderItemQuantityModifierInterface::modify(): phpgraph finds 17, codebase-memory-mcp 11 (2 false), graphify 0. - How does this feature work?
outlinegives the classes, the routes running into them, the behaviour read in their bodies, the wiring and the tests in one answer, so the agent reads only the files with non-obvious logic. Claude Code on 6 explain tasks: −12 % tokens, −26 % time, −42 % tool calls. - Which handler receives this message, which controller serves this route? Senders, messages and handlers are linked for Symfony Messenger, Laravel, Ecotone, PrestaShop CQRS, WordPress hooks and your own buses; routes to their controllers, HTTP calls to the routes they reach. Sylius: 206 Messenger handlers linked to their message; Kimai: 266 routes and 26 events with their subscribers; graphify links none. Claude Code wrote the exact class name in 18 of 18 runs with phpgraph, 15 of 18 without (the 3 misses: namespaces guessed from the path).
- Does the code respect its layers?
phpgraph checkfails the CI on a new dependency that breaks the layer rules (domain, application, infrastructure) or the project's own rules inphpgraph.yaml, with a baseline for today's violations. - What crosses the service boundaries? Shared message classes, routing keys, HTTP routes, OpenAPI and protobuf schemas link services together: all 45 operations of StayHub's OpenAPI document and all 14 rpcs of ticket-booking are linked to their implementation; in art-gallery, phpgraph found a
POSTsent to aGET-only route. - Who calls this, in a large or old codebase? Receivers are typed from return types, docblocks, generics, branches and the signatures of
vendor/, and PHP 4 and 5 syntax is parsed: 92.9 to 99.1 % of method calls typed on the 7 main projects of the corpus. On Kimai, phpgraph finds the callers in 2,407 of the 2,408 files a grep finds for methods whose name is declared once, graphify in 902.
How it answers:
- Deterministic facts, not guesses. Every relation is
EXTRACTED(read in the code),INFERRED(resolved from declared types) orAMBIGUOUS(a guess, labelled as such). - It says what it does not know. Unresolved calls, missing
vendor/, messages without handlers: the gaps are reported, so the agent knows when to read the code itself. - Built for DDD and hexagonal architecture, then microservices, then PHP in general: Symfony, Laravel, Ecotone, PrestaShop, WordPress, or plain PHP.
- Private by design. Your code never leaves your machine, and phpgraph never executes it: it only parses it.
What it costs
The same agent with and without phpgraph, scored against answers derived from the code (method and every run):
| Question | Agent and projects | With phpgraph |
|---|---|---|
| Impact of a change | Sherpa, a private 4,800-file Symfony/DDD project, 3 runs | −42 % tokens, −50 % time, −59 % tool calls |
| Impact of a change | Claude Code, 6 tasks on 5 public projects, 3 runs | −1.9 % tokens in total (+18 % with 2.0); Akeneo −51 % |
| Explain a feature | Sherpa, the same private project, 3 runs | −25 % tokens, −34 % time, −49 % tool calls |
| Explain a feature | Claude Code, 6 tasks on 5 public projects, 3 runs | −12 % tokens, −26 % time, −42 % tool calls |
| Find a handler, a controller | Claude Code, 6 tasks on 5 public projects, 3 runs | −7 % tokens, −14 % time, −27 % tool calls |
| Fix a seeded bug | Claude Code, 6 tasks on 4 public projects, 3 runs | not called; +10 % tokens for carrying the server with 2.0, whose tool list is now 4.8 KB instead of 11.2 KB (not measured again) |
On the Sherpa project, the ranges of the runs with and without phpgraph do not overlap; on the public tasks, the run-to-run variance is about 11 %, so a few percent on one task is noise.
Questions whose answer goes through an indirection (a custom command bus, the container configuration, an HTTP path in another service), 4 tasks run once per arm: Claude Code reached the full answer without phpgraph too, every time. The difference showed on the largest project, in the way there: the controllers of Akeneo reaching GetCategoryInterface::byCode() through its command bus cost 182 k tokens and 19 s with phpgraph, 382 k and 33 s without. One run each is a direction, not a measure; on the other three tasks, phpgraph cost more tokens.
Quick start
1. Install. A single executable, no PHP needed (Linux and macOS on x86_64 and ARM, Windows on x86_64):
curl -fsSL https://raw.githubusercontent.com/hbenabdallah/phpgraph/main/install.sh | sh # latest release
curl -fsSL https://raw.githubusercontent.com/hbenabdallah/phpgraph/main/install.sh | sh -s -- 0.2.0 # a given release curl -fsSL https://raw.githubusercontent.com/hbenabdallah/phpgraph/main/install.sh | sh -s -- dev-main # the main branch
irm https://raw.githubusercontent.com/hbenabdallah/phpgraph/main/install.ps1 | iex # Windows
$env:PHPGRAPH_VERSION = "dev-main"; irm https://raw.githubusercontent.com/hbenabdallah/phpgraph/main/install.ps1 | iex
The script downloads the binary, checks its SHA-256 and puts it in ~/.local/bin (Windows: %LOCALAPPDATA%\Programs\phpgraph, added to the PATH); PHPGRAPH_INSTALL_DIR changes the directory. Run it again to update. dev-main is rebuilt on every push to main (the edge pre-release). The binary is a static PHP runtime with phpgraph inside, built with static-php-cli.
With PHP 8.5+ installed, or with Docker:
composer require --dev hbenabdallah/phpgraph # or: composer global require hbenabdallah/phpgraph
curl -LO https://github.com/hbenabdallah/phpgraph/releases/latest/download/phpgraph.phar docker pull ghcr.io/hbenabdallah/phpgraph # nothing else to install
2. Connect your agent. mcp-config prints a ready-to-paste configuration with the paths filled in (vendor/bin/phpgraph when installed with Composer):
phpgraph mcp-config sherpa # Sherpa: a `sherpa mcp add` command, one declaration for every project
phpgraph mcp-config claude # Claude Code: a claude mcp add command, or .mcp.json phpgraph mcp-config codex # Codex: ~/.codex/config.toml phpgraph mcp-config cursor # Cursor: .cursor/mcp.json, shareable with the team phpgraph mcp-config json # any other MCP client over stdio
Agents reach for grep first, even with phpgraph connected. mcp-config also prints a line for the instructions file of the project (CLAUDE.md, AGENTS.md) telling the agent to call phpgraph before grep or reading files; the MCP instructions of the server say it too.
With Sherpa, a terminal coding agent, one declaration serves every project: Sherpa starts its MCP servers from the project it runs in.
sherpa mcp add phpgraph -- ~/.local/bin/phpgraph serve
In a Sherpa session, /mcp add does the same, and the tools are there at once. Both write ~/.config/sherpa/mcp.json.
With Claude Code (absolute paths, as mcp-config prints them):
claude mcp add phpgraph -- /home/you/.local/bin/phpgraph serve /path/to/project
3. Ask your agent something like *"Give me an overview of this project"*, *"How does an order get placed?"* or *"What breaks if I change OrderRepository::save?"*. The graph is built on the first call, then kept up to date.
MCP tools
| Tool | Use it to |
|---|---|
overview | Start 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_graph | Find 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 controllers. The families of classes around the answer are counted by folder (*ContextRuleInterface: 34 in …*), injected lists once (*ContextValidator receives 34 ContextRuleInterface*). |
outline | Before 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 with their implementations by module (0 stated); the routes running into it, chain by chain, through the closures it runs; behaviour read in the bodies (guarded throws, early returns, branches on constants, loop caps, state compared before and after); the container wiring with service ids; its users, tests counted by module, what no test touches and what nothing uses. About 15 KB; a list cut short names the section that has it all (section behaviour, 1 to 9 KB), and a core full at 45 classes names those it left out. A class used by many (the User model) brings nothing in with it: it shows the methods the feature calls and its attributes naming the feature's classes ($log: Log). A method (OrderService::place) gives what it runs instead: the methods it calls, 3 calls deep, each class with those methods only; hubs (called by 20 classes or more, a singleton's getInstance()) counted, not followed; its behaviour nearest first. |
| get_node | Read one class, method, route or chann