MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection
MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection. Exposed over MCP by the xdebug mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.
An MCP (Model Context Protocol) server that provides PHP debugging capabilities through Xdebug's DBGp protocol. This allows AI assistants like Claude to directly debug PHP applications.
Everything the assistant can do here goes through one of these:
capture_request_context — Capture HTTP request contextadd_step_filter — Add filter to skip files during steppinglist_step_filters — List step filter rulesget_function_history — View function call historyexport_session — Export session as JSON/HTML reportcapture_snapshot — Capture debug state snapshotBreakpoints — The Breakpoints tool exposed by this serverInspection — The Inspection tool exposed by this serverLogpoints — The Logpoints tool exposed by this serverProfiling — The Profiling tool exposed by this serverLogpoint — The Logpoint tool exposed by this serverYou will need 6 environment variables: XDEBUG_PORT, LOG_LEVEL, PATH_MAPPINGS, XDEBUG_SOCKET_PATH, DBGP_PROXY_HOST, XDEBUG_HOST. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Installation goes through your MCP client rather than a global install: point it at xdebug-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Xdebug's toolset — capture_request_context, add_step_filter, list_step_filters and 8 more — is a fair guide to whether it matches your workflow. It is maintained by kpanuragh; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Xdebug's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| capture_request_context | Capture HTTP request context |
| add_step_filter | Add filter to skip files during stepping |
| list_step_filters | List step filter rules |
| get_function_history | View function call history |
| export_session | Export session as JSON/HTML report |
| capture_snapshot | Capture debug state snapshot |
| Breakpoints | The Breakpoints tool exposed by this server. |
| Inspection | The Inspection tool exposed by this server. |
| Logpoints | The Logpoints tool exposed by this server. |
| Profiling | The Profiling tool exposed by this server. |
| Logpoint | The Logpoint tool exposed by this server. |
{
"mcpServers": {
"xdebug": {
"command": "xdebug-mcp",
"env": {
"XDEBUG_PORT": "9003",
"LOG_LEVEL": "info"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| XDEBUG_PORT | Configuration value read at startup. | Optional |
| LOG_LEVEL | Configuration value read at startup. | Optional |
| PATH_MAPPINGS | Filesystem location the server is allowed to use. | Optional |
| XDEBUG_SOCKET_PATH | Filesystem location the server is allowed to use. | Optional |
| DBGP_PROXY_HOST | Endpoint or connection string the server talks to. | Optional |
| XDEBUG_HOST | Endpoint or connection string the server talks to. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.