smart-xdebug-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@smart-xdebug-mcpSet a breakpoint in PaymentService.php line 127 and inspect $user"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Smart XDebug MCP Server
Let AI debug your PHP code.
Smart XDebug MCP connects Claude to your PHP application's debugger, enabling AI-assisted debugging that actually understands your code at runtime.
The Problem
Debugging PHP applications traditionally requires:
Manually setting breakpoints in an IDE
Stepping through code line by line
Remembering to check the right variables at the right time
Context-switching between your AI assistant and your debugger
When you ask an AI to help debug, it can only see your code statically. It can't see what's actually happening when your code runs—what values variables hold, where execution flows, or why that exception was thrown.
Related MCP server: DebugMCP
The Solution
Smart XDebug MCP gives Claude direct access to your PHP debugger. Instead of guessing what might be wrong, Claude can:
Set breakpoints at suspicious locations
Run your code and pause at those breakpoints
Inspect variables to see actual runtime values
Step through execution to understand the flow
Track variable changes over time with built-in history
It's like pair programming with a debugger expert who never gets tired and can analyze complex state instantly.
Why This Matters
For Developers
Faster debugging — Describe the bug, let AI investigate
Better insights — AI can correlate patterns across variables you might miss
Learning tool — Watch how an experienced debugger approaches problems
For AI
Runtime context — See actual values, not just code structure
Surgical precision — Request only the data needed, preventing context overload
Time-travel — Query what variables were at previous breakpoints
How It Works
You: "My /api/orders endpoint returns empty for user 42, but they have orders in the database"
Claude: *Sets breakpoint in OrderController*
*Triggers the API request*
*Inspects $user, $query, $results at the breakpoint*
Claude: "Found it. The query filters by user_id but $user->id is null here
because the auth middleware isn't running on this route."No manual stepping. No guessing. Just answers.
Quick Start
1. Install
npm install -g smart-xdebug-mcp2. Configure Claude Code
Add to your MCP settings (~/.config/claude/settings.json or project .mcp.json):
{
"mcpServers": {
"xdebug": {
"command": "npx",
"args": ["smart-xdebug-mcp"]
}
}
}3. Configure XDebug
Ensure your PHP environment has XDebug configured:
xdebug.mode = debug
xdebug.start_with_request = trigger
xdebug.client_host = host.docker.internal ; For Docker
xdebug.client_port = 90034. Debug
Ask Claude to debug your PHP code:
"Set a breakpoint at app/Services/PaymentService.php line 127,
then run: curl 'http://localhost/api/checkout?XDEBUG_SESSION=mcp'"Features
Feature | What It Does |
Natural Language Debugging | Tell Claude what to debug in plain English |
Smart Variable Inspection | AI requests only relevant data, not full dumps |
Time-Travel Queries | See what variables were at previous steps |
Automatic Path Mapping | Works with Docker without manual configuration |
Exception Detection | Auto-pause when errors occur |
Session History | Review what happened in past debug sessions |
Use Cases
"Why is this returning null?" — Trace execution to find where values disappear
"This loop seems slow" — Set conditional breakpoints to inspect specific iterations
"The API works locally but fails in Docker" — Debug the containerized app directly
"I inherited this codebase" — Let AI explore and explain runtime behavior
Requirements
Node.js 18+
PHP with XDebug 3.x configured for remote debugging
Claude Code or another MCP-compatible AI assistant
Configuration
Environment variables for advanced configuration:
Variable | Default | Description |
|
| XDebug listener port |
|
| Connection timeout (ms) |
|
| Auto-terminate idle sessions (5 min) |
Path mappings are auto-detected from .vscode/launch.json or docker-compose.yml.
Architecture
Smart XDebug MCP acts as a bridge:
Claude ←→ MCP Protocol ←→ Smart XDebug MCP ←→ DBGp Protocol ←→ XDebug ←→ PHPThe server translates high-level debugging intent into DBGp commands, handles the complexity of the protocol, and returns clean, AI-friendly responses.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
License
Copyright 2026 Tyler Wall
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Keywords: PHP debugging, AI debugging, Claude MCP, XDebug integration, autonomous debugging, Model Context Protocol, PHP development tools, AI-assisted development, remote debugging, Docker PHP debugging
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI assistants to debug PHP applications through Xdebug's DBGp protocol, providing full debugging control including breakpoints, variable inspection, stack traces, and advanced features like watch expressions and code coverage.Last updated4636224MIT
- Alicense-qualityDmaintenanceEnables AI agents to debug code inside VS Code by setting breakpoints, stepping through execution, inspecting variables, and evaluating expressions across multiple languages.Last updated443MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to deeply interact with the PHP ecosystem, including runtime, static analysis, security scanning, testing, Composer, and frameworks like Laravel and Symfony. It exposes over 30 tools, 8 resources, and 7 prompts via MCP, allowing natural language commands to run PHP linting, static analysis, audits, tests, and project initialization.Last updated41MIT
- Alicense-qualityDmaintenanceBridges AI agents with VS Code's debugger, enabling breakpoint management, step execution, variable inspection, and stack tracing via CLI commands.Last updated25GPL 3.0
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wallter/smart-xdebug-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server