GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add xdebug -- npx -y xdebug-mcp粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"xdebug": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 kpanuragh 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(1.2.1)于8个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
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 automaticallynpm install -g xdebug-mcp
git clone https://github.com/kpanuragh/xdebug-mcp.git
cd xdebug-mcp npm install npm run build
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" } } } }
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" } } } }
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.
[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=mcp
version: '3.8'
services: php: image: php:8.2-apache volumes:
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):
{
"mcpServers": { "xdebug": { "command": "xdebug-mcp", "env": { "XDEBUG_SOCKET_PATH": "/tmp/xdebug.sock", "LOG_LEVEL": "info" } } } }
PHP/Xdebug Configuration:
[xdebug]
zend_extension=xdebug xdebug.mode=debug xdebug.start_with_request=yes xdebug.client_host=unix:///tmp/xdebug.sock
Socket File Permissions:
The socket file is created with default permissions. To restrict access, you can:
# After MCP server starts
chmod 600 /tmp/xdebug.sock
mkdir -p ~/.xdebug && chmod 700 ~/.xdebug
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 |
Use set_breakpoint with file="/var/www/html/index.php" and line=25
Use set_breakpoint with file="/var/www/html/api.php", line=42, condition="$userId > 100"
Use add_watch with expression="$user->email"
Use add_watch with expression="count($items)"
Use add_logpoint with file="/var/www/html/api.php", line=50, message="User {$userId} accessed {$endpoint}"
Use get_variables to see all local variables
Use get_variable with name="$user" to inspect a specific variable Use evaluate with expression="count($items)" to evaluate an expression
Use capture_request_context to see $_GET, $_POST, $_SESSION, cookies, and headers
| Variable | Default | Description |
|---|---|---|
XDEBUG_PORT | 9003 | Port to listen for Xdebug connections (TCP mode) |
XDEBUG_HOST | 0.0.0.0 | Host to bind (TCP mode) |
XDEBUG_SOCKET_PATH | - | Unix domain socket path (e.g., /tmp/xdebug.sock). When set, uses Unix socket instead of TCP |
COMMAND_TIMEOUT | 30000 | Command timeout in milliseconds |
PATH_MAPPINGS | - | JSON object mapping container to host paths |
MAX_DEPTH | 3 | Max depth for variable inspection |
MAX_CHILDREN | 128 | Max children to return for arrays/objects |
MAX_DATA | 2048 | Max data size per variable |
LOG_LEVEL | info | Log level: debug, info, warn, error |
| Feature | TCP | Unix Socket |
|---|---|---|
| Setup | Easy (default) | Simple (one env var) |
| Performance | Good | Excellent (lower latency) |
| Security | Port accessible to network | File-based permissions |
| Remote Debugging | ✅ Supported | ❌ Local only |
| Docker | ✅ Works with host.docker.internal | ❌ Requires volume mount |
| Stale Socket | Manual port cleanup | Auto-cleanup |
| Default | XDEBUG_PORT=9003 | Disabled (use TCP) |
Quick Decision Guide:
只显示了开头部分;其余内容请在仓库中阅读