ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Xdebug

โดย kpanuraghรุ่น 1.2.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.kpanuragh/xdebug

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

MCP server for PHP Xdebug debugging with breakpoints, stepping, and variable inspection

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: เครื่องมือนักพัฒนา

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "xdebug": {
      "command": "npx",
      "args": [
        "-y",
        "xdebug-mcp"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add xdebug -- npx -y xdebug-mcp

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "xdebug": {
      "command": "npx",
      "args": [
        "-y",
        "xdebug-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "xdebug": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "xdebug-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub kpanuragh ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด เครื่องมือนักพัฒนาi

  • ดาวมากกว่า 0% ของอีก 1387 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 11% ของอีก 1387 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 1387 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Xdebug ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.2.1) เข้า registry 8 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี GitHub, Desktop Commander, Cloudflare MCP

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

GitHub

โดย github

server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้

บนเครื่องหรือคลาวด์★ 34,245MITอัปเดต 3 วันที่ผ่านมา
ติดตั้ง

Desktop Commander

โดย wonderwhy-er

MCP server for terminal commands, file operations, and process management

รันบนเครื่อง★ 10,225MITอัปเดต 15 วันที่ผ่านมา
ติดตั้ง

Cloudflare MCP

โดย cloudflare

Cloudflare MCP servers

รันบนคลาวด์★ 4,446Apache-2.0อัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ 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 (not XDEBUG_SOCKET_PATH)
  • a unique callback port such as 9006, 9007, or 9008 for XDEBUG_PORT
  • DBGP_PROXY_HOST, DBGP_PROXY_PORT, 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=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
ToolDescription
list_sessionsList all active debug sessions
get_session_stateGet detailed state of a session
set_active_sessionSet which session is active
close_sessionClose a debug session
Breakpoints
ToolDescription
set_breakpointSet a line or conditional breakpoint (supports pending breakpoints)
set_exception_breakpointBreak on exceptions (supports pending breakpoints)
set_call_breakpointBreak on function calls (supports pending breakpoints)
remove_breakpointRemove a breakpoint (works with pending breakpoints)
update_breakpointEnable/disable or modify a breakpoint
list_breakpointsList 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
ToolDescription
continueContinue to next breakpoint
step_intoStep into function calls
step_overStep over (skip function internals)
step_outStep out of current function
stopStop debugging
detachDetach and let script continue
Inspection
ToolDescription
get_stack_traceGet the call stack
get_contextsGet available variable contexts
get_variablesGet all variables in scope
get_variableGet a specific variable
set_variableSet a variable's value
evaluateEvaluate a PHP expression
get_sourceGet source code
Watch Expressions
ToolDescription
add_watchAdd a persistent watch expression
remove_watchRemove a watch expression
evaluate_watchesEvaluate all watches and detect changes
list_watchesList all active watches
Logpoints
ToolDescription
add_logpointAdd a logpoint with message template
remove_logpointRemove a logpoint
get_logpoint_historyView log output and hit statistics
Profiling
ToolDescription
start_profilingStart memory/time profiling
stop_profilingStop profiling and get results
get_profile_statsGet current profiling statistics
get_memory_timelineView memory usage over time
Code Coverage
ToolDescription
start_coverageStart tracking code coverage
stop_coverageStop and get coverage report
get_coverage_reportView coverage statistics
Debug Profiles
ToolDescription
save_debug_profileSave current configuration as a profile
load_debug_profileLoad a saved debug profile
list_debug_profilesList all saved profiles
Additional Tools
ToolDescription
capture_request_contextCapture HTTP request context
add_step_filterAdd filter to skip files during stepping
list_step_filtersList step filter rules
get_function_historyView function call history
export_sessionExport session as JSON/HTML report
capture_snapshotCapture 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

VariableDefaultDescription
XDEBUG_PORT9003Port to listen for Xdebug connections (TCP mode)
XDEBUG_HOST0.0.0.0Host 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_TIMEOUT30000Command timeout in milliseconds
PATH_MAPPINGS-JSON object mapping container to host paths
MAX_DEPTH3Max depth for variable inspection
MAX_CHILDREN128Max children to return for arrays/objects
MAX_DATA2048Max data size per variable
LOG_LEVELinfoLog level: debug, info, warn, error

Connection Modes: TCP vs Unix Socket

FeatureTCPUnix Socket
SetupEasy (default)Simple (one env var)
PerformanceGoodExcellent (lower latency)
SecurityPort accessible to networkFile-based permissions
Remote Debugging✅ Supported❌ Local only
Docker✅ Works with host.docker.internal❌ Requires volume mount
Stale SocketManual port cleanupAuto-cleanup
DefaultXDEBUG_PORT=9003Disabled (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

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx