Xdebug
개요
제작자가 쓴 설명(영어 원문)
MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection
할 수 있는 일
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
- 연결 방식: 내 컴퓨터에서 실행
- 전송 방식: stdio
- 카테고리: 개발자 도구
설치
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
검사 2/2 통과 · 내 컴퓨터에서 실행돼요
먼저: 어떤 AI를 쓰시나요?
쓰는 앱을 고르면 아래에 단계가 나옵니다.
Claude에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요
컴퓨터용 Claude 앱 설정 파일 열기
SettingsDeveloperEdit Config
이 설정을 붙여 넣고 저장
{ "mcpServers": { "xdebug": { "command": "npx", "args": [ "-y", "xdebug-mcp" ] } } }Claude를 끄고 다시 열기
해 보기
Xdebug을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude가 Xdebug을 쓰고 있다고 하거나 답에 Xdebug 도구 이름이 나오면 연결된 거예요
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
ChatGPT는 아직 Xdebug에 연결할 수 없어요
Xdebug는 내 컴퓨터에 설치해서 쓰지만 ChatGPT는 웹에서 도는 서버만 연결할 수 있어요
대신 이렇게 할 수 있어요
A · Xdebug에 연결되는 앱 쓰기
- 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요
- 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
- 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
- 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
B · 개발자 도구에서 ChatGPT에 연결되는 다른 서버
같은 분류에서 많이 쓰는 것 중 키 없이 주소만으로 연결되는 것을 골랐어요
- Sentry✓ ChatGPT
- Front-End Checklist✓ ChatGPT
- Compiler Explorer✓ ChatGPT
Claude Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
터미널 열기
Mac: Command+스페이스를 누르고 Terminal 입력 · Windows: PowerShell 열기
이 명령을 붙여 넣고 Enter
claude mcp add xdebug -- npx -y xdebug-mcpClaude Code에서 /mcp 입력
Xdebug이 목록에 있고 연결됨으로 보이면 돼요
해 보기
Xdebug을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude Code가 Xdebug을 쓰고 있다고 하거나 답에 Xdebug 도구 이름이 나오면 연결된 거예요
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
Cursor에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
Cursor에서 AI 채팅을 Agent 모드로 열기
해 보기
Xdebug을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Cursor가 Xdebug을 쓰고 있다고 하거나 답에 Xdebug 도구 이름이 나오면 연결된 거예요
메뉴 이름은 2026년 11월 11일에 Cursor 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
VS Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
VS Code에서 AI 채팅을 Agent 모드로 열기
해 보기
Xdebug을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ VS Code가 Xdebug을 쓰고 있다고 하거나 답에 Xdebug 도구 이름이 나오면 연결된 거예요
메뉴 이름은 2026년 11월 11일에 VS Code 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
개발자용: 터미널 명령과 JSON 설정
컴퓨터에 설치
Claude Code
claude mcp add xdebug -- npx -y xdebug-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"xdebug": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xdebug-mcp"
]
}
}
}이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
한눈에 보기
어떤 앱에서 쓸 수 있나요
이 서버의 연결 방식과 각 앱의 공식 문서를 바탕으로 했어요. 2026년 11월 10일 확인.
내 컴퓨터에서 실행하는 앱
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
할 수 있는 일
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
기본 점검i
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 11일 점검
- ✓ 통과
제작자와 저장소 일치
레지스트리 이름이 GitHub 계정 kpanuragh 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
- ✓ 통과
계속 관리되고 있음
코드 마지막 변경: 26일 전
- … 아직 점검 안 함
라이선스 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- – 해당 없음
엔드포인트 응답
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
- – 해당 없음
OAuth로 로그인
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
- … 아직 점검 안 함
도구 설명에 숨겨진 지시 없음
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
토론
질문하고, 팁을 나누고, 안 되는 점을 알려 주세요. "도움이 됨"이 많은 순서예요.
사용자 리뷰
아직 리뷰가 없어요
개발자 도구 카테고리의 다른 서버와 비교i
- 이 카테고리의 다른 서버 5766개 중 94%보다 스타가 많아요
- 이 카테고리의 다른 서버 5766개 중 7%보다 최근에 레지스트리에 공개됐어요
- 기본 점검 결과가 이 카테고리의 다른 서버 5766개 중 100%와 같거나 더 좋아요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
자주 묻는 질문
Xdebug, 안전한가요?
해당하는 기본 점검 2개 중 2개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
어떤 키나 코드가 필요한가요?
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
아직 관리되고 있나요?
GitHub 저장소는 마지막으로 26일 전 변경됐고, 최신 버전(1.2.1)은 8개월 전 레지스트리에 올라왔어요.
어떤 앱에서 쓸 수 있나요?
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.
대신 쓸 수 있는 건 뭐가 있나요?
같은 카테고리에는: REA, Netdata, Front-End Checklist
대안
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
제작자의 README
README 열기
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
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-mcp
From Source
git clone https://github.com/kpanuragh/xdebug-mcp.git
cd xdebug-mcp npm install npm run build
MCP 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(notXDEBUG_SOCKET_PATH) - a unique callback port such as
9006,9007, or9008forXDEBUG_PORT DBGP_PROXY_HOST,DBGP_PROXY_PORT, andDBGP_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=mcp
Docker Compose
version: '3.8'
services: php: image: php:8.2-apache volumes:
- ./src:/var/www/html
- ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini extra_hosts:
- "host.docker.internal:host-gateway" # Required for Linux environment:
- XDEBUG_MODE=debug
- XDEBUG_CONFIG=client_host=host.docker.internal client_port=9003
Using Unix Domain Sockets
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:
- ⚡ Lower latency (no TCP/IP stack overhead)
- 🔒 Better security (file permissions instead of port binding)
- 📦 Simpler setup (no port management)
- 🚀 Faster communication for local debugging
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
Or use a secure directory
mkdir -p ~/.xdebug && chmod 700 ~/.xdebug
Then set XDEBUG_SOCKET_PATH=$HOME/.xdebug/xdebug.sock
Automatic Cleanup:
When XDEBUG_SOCKET_PATH is set, the server will:
- Listen on the specified Unix socket instead of TCP port
- Automatically clean up stale socket files on startup (prevents "address in use" errors)
- Automatically clean up socket files on shutdown
- Use the same debugging tools and features as TCP mode
When to Use Unix Sockets:
- ✅ Local PHP development (best performance)
- ✅ Same-machine debugging
- ✅ High-frequency breakpoint hits
- ❌ Remote debugging (use TCP instead)
*Unix socket support requested in Issue #1 by @dkd-kaehm*
Available MCP Tools (41 Total)
Session Management
| 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 |
Breakpoints
| 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.
Execution Control
| 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 |
Inspection
| 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 |
Watch Expressions
| 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 |
Logpoints
| Tool | Description |
|---|---|
add_logpoint | Add a logpoint with message template |
remove_logpoint | Remove a logpoint |
get_logpoint_history | View log output and hit statistics |
Profiling
| 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 |
Code Coverage
| Tool | Description |
|---|---|
start_coverage | Start tracking code coverage |
stop_coverage | Stop and get coverage report |
get_coverage_report | View coverage statistics |
Debug Profiles
| 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 |
Additional Tools
| 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 |
Usage Examples
Setting a Breakpoint
Use set_breakpoint with file="/var/www/html/index.php" and line=25
Conditional Breakpoint
Use set_breakpoint with file="/var/www/html/api.php", line=42, condition="$userId > 100"
Watch Expression
Use add_watch with expression="$user->email"
Use add_watch with expression="count($items)"
Logpoint
Use add_logpoint with file="/var/www/html/api.php", line=50, message="User {$userId} accessed {$endpoint}"
Inspecting Variables
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
Capture Request Context
Use capture_request_context to see $_GET, $_POST, $_SESSION, cookies, and headers
Environment Variables
| 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 |
Connection Modes: TCP vs Unix Socket
| 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:
- 🏠 Local development? → Use Unix socket for best performance
- 🐳 Docker on same machine? → Use Unix socket with volume mount
- 🌐 Remote server? → Use TCP
- 🚀 Maximum speed? → Use Unix socket
- 📝 Don't know? → Start with TCP (de