kpanuragh avatar

Xdebug

kpanuragh/xdebug-mcp

This server connects Claude directly to PHP's Xdebug via the DBGp protocol, giving you full debugging control through MCP tools. You get the standard step through, step over, step out commands alongside breakpoint management (including conditional and exception breakpoints), variable inspection, expression evaluation, and stack traces. It handles multiple simultaneous sessions, works with Docker containers through path mappings, and supports both TCP and Unix domain sockets. Beyond basic debugging, it adds watch expressions, logpoints, memory profiling, and code coverage tracking. You can set pending breakpoints before a session starts, export debug sessions as JSON or HTML, and even register with DBGp proxy servers for multi-agent setups. Useful when you need Claude to debug PHP without switching to a traditional IDE.

GitHub stars
23
tools
46
transport
STDIO
last updated
Mar 23, 2026

Tools

46 tools

Public tool metadata for what this MCP can expose to an agent.

list_sessionsList all active debug sessions

List all active debug sessions

No parameter schema in public metadata yet.

get_session_stateGet detailed state of a session

Get detailed state of a session

No parameter schema in public metadata yet.

set_active_sessionSet which session is active

Set which session is active

No parameter schema in public metadata yet.

close_sessionClose a debug session

Close a debug session

No parameter schema in public metadata yet.

set_breakpointSet a line or conditional breakpoint (supports pending breakpoints)

Set a line or conditional breakpoint (supports pending breakpoints)

No parameter schema in public metadata yet.

set_exception_breakpointBreak on exceptions (supports pending breakpoints)

Break on exceptions (supports pending breakpoints)

No parameter schema in public metadata yet.

set_call_breakpointBreak on function calls (supports pending breakpoints)

Break on function calls (supports pending breakpoints)

No parameter schema in public metadata yet.

remove_breakpointRemove a breakpoint (works with pending breakpoints)

Remove a breakpoint (works with pending breakpoints)

No parameter schema in public metadata yet.

update_breakpointEnable/disable or modify a breakpoint

Enable/disable or modify a breakpoint

No parameter schema in public metadata yet.

list_breakpointsList all breakpoints including pending

List all breakpoints including pending

No parameter schema in public metadata yet.

continueContinue to next breakpoint

Continue to next breakpoint

No parameter schema in public metadata yet.

step_intoStep into function calls

Step into function calls

No parameter schema in public metadata yet.

step_overStep over (skip function internals)

Step over (skip function internals)

No parameter schema in public metadata yet.

step_outStep out of current function

Step out of current function

No parameter schema in public metadata yet.

stopStop debugging

Stop debugging

No parameter schema in public metadata yet.

detachDetach and let script continue

Detach and let script continue

No parameter schema in public metadata yet.

get_stack_traceGet the call stack

Get the call stack

No parameter schema in public metadata yet.

get_contextsGet available variable contexts

Get available variable contexts

No parameter schema in public metadata yet.

get_variablesGet all variables in scope

Get all variables in scope

No parameter schema in public metadata yet.

get_variableGet a specific variable

Get a specific variable

No parameter schema in public metadata yet.

set_variableSet a variable's value

Set a variable's value

No parameter schema in public metadata yet.

evaluateEvaluate a PHP expression

Evaluate a PHP expression

No parameter schema in public metadata yet.

get_sourceGet source code

Get source code

No parameter schema in public metadata yet.

add_watchAdd a persistent watch expression

Add a persistent watch expression

No parameter schema in public metadata yet.

remove_watchRemove a watch expression

Remove a watch expression

No parameter schema in public metadata yet.

evaluate_watchesEvaluate all watches and detect changes

Evaluate all watches and detect changes

No parameter schema in public metadata yet.

list_watchesList all active watches

List all active watches

No parameter schema in public metadata yet.

add_logpointAdd a logpoint with message template

Add a logpoint with message template

No parameter schema in public metadata yet.

remove_logpointRemove a logpoint

Remove a logpoint

No parameter schema in public metadata yet.

get_logpoint_historyView log output and hit statistics

View log output and hit statistics

No parameter schema in public metadata yet.

start_profilingStart memory/time profiling

Start memory/time profiling

No parameter schema in public metadata yet.

stop_profilingStop profiling and get results

Stop profiling and get results

No parameter schema in public metadata yet.

get_profile_statsGet current profiling statistics

Get current profiling statistics

No parameter schema in public metadata yet.

get_memory_timelineView memory usage over time

View memory usage over time

No parameter schema in public metadata yet.

start_coverageStart tracking code coverage

Start tracking code coverage

No parameter schema in public metadata yet.

stop_coverageStop and get coverage report

Stop and get coverage report

No parameter schema in public metadata yet.

get_coverage_reportView coverage statistics

View coverage statistics

No parameter schema in public metadata yet.

save_debug_profileSave current configuration as a profile

Save current configuration as a profile

No parameter schema in public metadata yet.

load_debug_profileLoad a saved debug profile

Load a saved debug profile

No parameter schema in public metadata yet.

list_debug_profilesList all saved profiles

List all saved profiles

No parameter schema in public metadata yet.

capture_request_contextCapture HTTP request context

Capture HTTP request context

No parameter schema in public metadata yet.

add_step_filterAdd filter to skip files during stepping

Add filter to skip files during stepping

No parameter schema in public metadata yet.

list_step_filtersList step filter rules

List step filter rules

No parameter schema in public metadata yet.

get_function_historyView function call history

View function call history

No parameter schema in public metadata yet.

export_sessionExport session as JSON/HTML report

Export session as JSON/HTML report

No parameter schema in public metadata yet.

capture_snapshotCapture debug state snapshot

Capture debug state snapshot

No parameter schema in public metadata yet.

Sponsors

Readme

Xdebug MCP Server

npm version License: MIT

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.

Features

Core Debugging

  • Full Debug Control: Step into, step over, step out, continue, stop
  • Breakpoints: Line breakpoints, conditional breakpoints, exception breakpoints, function call breakpoints
  • Variable Inspection: View all variables, get specific variables, set variable values
  • Expression Evaluation: Evaluate PHP expressions in the current context
  • Stack Traces: View the full call stack
  • Multiple Sessions: Debug multiple PHP scripts simultaneously
  • Docker Support: Works with PHP running in Docker containers

View the full README on GitHub

Details

Repository
github.com/kpanuragh/xdebug-mcp
Package
xdebug-mcp
Transport
STDIO
Registry
MCP registry, active