MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
{$var} placeholders$_GET, $_POST, $_SESSION, $_COOKIE, headers automaticallyAdd the xdebug-mcp server to your MCP configuration (.mcp.json or Claude settings):
Using npm global install:
Using npx:
When debugging PHP in Docker containers, you need path mappings to translate container paths to host paths:
If you already use a DBGp proxy, keep mcp-config.example.json as the default direct-listener example and start from mcp-config.proxy.example.json for proxy registration.
Proxy mode requires:
xdebug-mcp (not XDEBUG_SOCKET_PATH)9006, 9007, or 9008 for XDEBUG_PORTDBGP_PROXY_HOST, DBGP_PROXY_PORT, and DBGP_IDEKEYSee the DBGp Proxy Registration Guide for the full setup, multi-agent examples, and PHP/Xdebug proxy configuration.
For improved performance and simplified setup on local systems, you can use Unix domain sockets instead of TCP. Unix sockets eliminate network stack overhead and are ideal for debugging on the same machine.
Benefits:
MCP Configuration (Unix Socket):
PHP/Xdebug Configuration:
Socket File Permissions:
The socket file is created with default permissions. To restrict access, you can:
Automatic Cleanup:
When XDEBUG_SOCKET_PATH is set, the server will:
When to Use Unix Sockets:
Unix socket support requested in Issue #1 by @dkd-kaehm
| Tool | Description |
|---|---|
list_sessions | List all active debug sessions |
get_session_state | Get detailed state of a session |
set_active_session | Set which session is active |
close_session | Close a debug session |
| Tool | Description |
|---|---|
set_breakpoint | Set a line or conditional breakpoint (supports pending breakpoints) |
set_exception_breakpoint | Break on exceptions (supports pending breakpoints) |
set_call_breakpoint | Break on function calls (supports pending breakpoints) |
remove_breakpoint | Remove a breakpoint (works with pending breakpoints) |
update_breakpoint | Enable/disable or modify a breakpoint |
list_breakpoints | List all breakpoints including pending |
Pending Breakpoints: You can set breakpoints before a debug session starts. These are stored as "pending breakpoints" and automatically applied when a PHP script connects with Xdebug. This is useful for setting up breakpoints before triggering a page load or script execution.
| Tool | Description |
|---|---|
continue | Continue to next breakpoint |
step_into | Step into function calls |
step_over | Step over (skip function internals) |
step_out | Step out of current function |
stop | Stop debugging |
detach | Detach and let script continue |
| Tool | Description |
|---|---|
get_stack_trace | Get the call stack |
get_contexts | Get available variable contexts |
get_variables | Get all variables in scope |
get_variable | Get a specific variable |
set_variable | Set a variable's value |
evaluate | Evaluate a PHP expression |
get_source | Get source code |
| Tool | Description |
|---|---|
add_watch | Add a persistent watch expression |
remove_watch | Remove a watch expression |
evaluate_watches | Evaluate all watches and detect changes |
list_watches | List all active watches |
| Tool | Description |
|---|---|
add_logpoint | Add a logpoint with message template |
remove_logpoint | Remove a logpoint |
get_logpoint_history | View log output and hit statistics |
| Tool | Description |
|---|---|
start_profiling | Start memory/time profiling |
stop_profiling | Stop profiling and get results |
get_profile_stats | Get current profiling statistics |
get_memory_timeline | View memory usage over time |
| Tool | Description |
|---|---|
start_coverage | Start tracking code coverage |
stop_coverage | Stop and get coverage report |
get_coverage_report | View coverage statistics |
| Tool | Description |
|---|---|
save_debug_profile | Save current configuration as a profile |
load_debug_profile | Load a saved debug profile |
list_debug_profiles | List all saved profiles |
| Tool | Description |
|---|---|
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 |
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/xdebug)<a href="https://allmcps.com/mcp/xdebug"><img src="https://allmcps.com/api/badge/xdebug?style=directory" alt="Xdebug on AllMCPs" /></a>