Xdebug MCP server
io.github.kpanuragh/xdebug·v1.2.1·26 starsMCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection
26 stars
Reviews
Write oneNobody has reviewed Xdebug yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Xdebug tools
No tool declarations could be read from the package source. They show once the server is installed.
Public scan report
scanner v0.1.10 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan53 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 18 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Xdebug compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 92/100
- higher than 95% of 48,255 servers
- GitHub stars
- 26
- more than 91% of 28,688 servers
Install Xdebug in Claude Code, Cursor or VS Code
Runs npx -y xdebug-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add xdebug -- npx -y xdebug-mcp
What the publisher says
From the Xdebug repository's README, as published. We do not edit it. Read it on GitHub
Xdebug MCP Server
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
Advanced Features
- Watch Expressions: Persistent watches that auto-evaluate on each break with change detection
- Logpoints: Log messages without stopping execution using {$var} placeholders
- Memory Profiling: Track memory usage and execution time between breakpoints
- Code Coverage: Track which lines were executed during debugging
- Request Context: Capture $GET, $POST, $SESSION, $COOKIE, headers automatically
- Step Filters: Skip vendor/library code during stepping
- Debug Profiles: Save and restore breakpoint configurations
- Session Export: Export debug sessions as JSON or HTML reports
Installation
From npm (Recommended)
npm install -g xdebug-mcpFrom Source
git clone https://github.com/kpanuragh/xdebug-mcp.git
cd xdebug-mcp
npm install
npm run buildMCP Server Configuration
For Claude Code
Add the xdebug-mcp server to your MCP configuration (.mcp.json or Claude settings):
Using npm global install:
{
"mcpServers": {
"xdebug": {
"command": "xdebug-mcp",
"env": {
"XDEBUG_PORT": "9003",
"LOG_LEVEL": "info"
}
}
}
}Using npx:
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": ["-y", "xdebug-mcp"],
"env": {
"XDEBUG_PORT": "9003",
"LOG_LEVEL": "info"
}
}
}
}With Path Mappings (for Docker)
When debugging PHP in Docker containers, you need path mappings to translate container paths to host paths:
{
"mcpServers": {
"xdebug": {
"command": "xdebug-mcp",
"env": {
"XDEBUG_PORT": "9003",
"PATH_MAPPINGS": "{\"/var/www/html\": \"/home/user/projects/myapp\"}",
"LOG_LEVEL": "info"
}
}
}
}With DBGp Proxy Registration
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:
- TCP listener mode for xdebug-mcp (not XDEBUGSOCKETPATH)
- a unique callback port such as 9006, 9007, or 9008 for XDEBUG_PORT
- DBGPPROXYHOST, DBGPPROXYPORT, and DBGP_IDEKEY
See the DBGp Proxy Registration Guide for the full setup, multi-agent examples, and PHP/Xdebug proxy configuration.
PHP/Xdebug Configuration
php.ini (or xdebug.ini)
[xdebug]
zend_extension=xdebug
; Enable step debugging
xdebug.mode=debug
; Start debugging on every request
xdebug.start_with_request=yes
; Host where MCP server is running
; For Docker: use host.docker.internal
; For local PHP: use 127.0.0.1
xdebug.client_host=host.docker.internal
; Port where MCP server listens
xdebug.client_port=9003
; IDE key (optional, for filtering)
xdebug.idekey=mcpDocker Compose
version: '3.8'Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Xdebug: common questions
- Is Xdebug MCP server safe?
- Yes, by our scan: it is graded A (92/100). Read the Xdebug safety report
- How do I install Xdebug?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Xdebug need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Xdebug maintained?
- The last commit was 55 days ago (2026-09-10). The latest release is v1.2.1.
- How does Xdebug compare with other MCP servers?
- safety score 92/100 (higher than 95% of 48,255 servers); github stars 26 (more than 91% of 28,688 servers). Full comparison.