debugmcp/mcp-debugger
If you are the rightful owner of mcp-debugger and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MCP Debugger is a Model Context Protocol server designed to enhance AI agents with debugging capabilities across multiple programming languages.
mcp-debugger

MCP server for multi-language debugging β give your AI agents debugging superpowers π
π― Overview
mcp-debugger is a Model Context Protocol (MCP) server that provides debugging tools as structured API calls. It enables AI agents to perform step-through debugging of multiple programming languages using the Debug Adapter Protocol (DAP).
π Version 0.15.0: Dynamic adapter loading with monorepo packaging. Install adapters as optional dependencies. Start with Python and Mock; extend to any language.
π¬ Demo Video: See the debugger in action!
Recording in progress - This will show an AI agent discovering and fixing the variable swap bug in real-time
β¨ Key Features
- π Multi-language support β Clean adapter pattern for any language
- π Python debugging via debugpy β Full DAP protocol support
- π§ͺ Mock adapter for testing β Test without external dependencies
- π STDIO and SSE transport modes β Works with any MCP client
- π 1019 tests passing β battle-tested end-to-end
- π³ Docker and npm packages β Deploy anywhere
- π€ Built for AI agents β Structured JSON responses for easy parsing
- π‘οΈ Path validation β Prevents crashes from non-existent files
- π AI-aware line context β Intelligent breakpoint placement with code context
π Quick Start
For MCP Clients (Claude Desktop, etc.)
Add to your MCP settings configuration:
{
"mcpServers": {
"mcp-debugger": {
"command": "node",
"args": ["C:/path/to/mcp-debugger/dist/index.js", "--log-level", "debug", "--log-file", "C:/path/to/logs/debug-mcp-server.log"],
"disabled": false,
"autoApprove": ["create_debug_session", "set_breakpoint", "get_variables"]
}
}
}
For Claude Code CLI
For Claude Code users, we provide an automated installation script:
# Clone the repository
git clone https://github.com/yourusername/mcp-debugger.git
cd mcp-debugger
# Run the installation script
./scripts/install-claude-mcp.sh
# Verify the connection
/home/ubuntu/.claude/local/claude mcp list
Important: The stdio
argument is required to prevent console output from corrupting the JSON-RPC protocol. See for detailed setup and for troubleshooting.
Using Docker
docker run -v $(pwd):/workspace debugmcp/mcp-debugger:latest
Using npm
npm install -g @debugmcp/mcp-debugger
mcp-debugger --help
Or use without installation via npx:
npx @debugmcp/mcp-debugger --help
πΈ Screenshot: MCP Integration in Action
This screenshot will show real-time MCP protocol communication with tool calls and JSON responses flowing between the AI agent and debugger.
π How It Works
mcp-debugger exposes debugging operations as MCP tools that can be called with structured JSON parameters:
// Tool: create_debug_session
// Request:
{
"language": "python", // or "mock" for testing
"name": "My Debug Session"
}
// Response:
{
"success": true,
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"message": "Created python debug session: My Debug Session"
}
πΈ Screenshot: Active Debugging Session
This screenshot will show the debugger paused at a breakpoint with the stack trace visible in the left panel, local variables in the right panel, and source code with line highlighting in the center.
π οΈ Available Tools
Tool | Description | Status |
---|---|---|
create_debug_session | Create a new debugging session | β Implemented |
list_debug_sessions | List all active sessions | β Implemented |
set_breakpoint | Set a breakpoint in a file | β Implemented |
start_debugging | Start debugging a script | β Implemented |
get_stack_trace | Get the current stack trace | β Implemented |
get_scopes | Get variable scopes for a frame | β Implemented |
get_variables | Get variables in a scope | β Implemented |
step_over | Step over the current line | β Implemented |
step_into | Step into a function | β Implemented |
step_out | Step out of a function | β Implemented |
continue_execution | Continue running | β Implemented |
close_debug_session | Close a session | β Implemented |
pause_execution | Pause running execution | β Not Implemented |
evaluate_expression | Evaluate expressions | β Not Implemented |
get_source_context | Get source code context | β Implemented |
πΈ Screenshot: Multi-Session Debugging
This screenshot will show the debugger managing multiple concurrent debug sessions, demonstrating how AI agents can debug different scripts simultaneously with isolated session management.
ποΈ Architecture: Dynamic Adapter Loading
Version 0.10.0 introduces a clean adapter pattern that separates language-agnostic core functionality from language-specific implementations:
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β MCP Client ββββββΆβ SessionManagerββββββΆβ AdapterRegistry β
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββ βββββββββββββββββββ
β ProxyManager ββββββββ Language Adapterβ
ββββββββββββββββ βββββββββββββββββββ
β
ββββββββββ΄βββββββββ
β β
βββββββΌβββββββ βββββββΌβββββββ
βPython β βMock β
βAdapter β βAdapter β
ββββββββββββββ ββββββββββββββ
Adding Language Support
Want to add debugging support for your favorite language? Check out the !
π‘ Example: Debugging Python Code
Here's a complete debugging session example:
# buggy_swap.py
def swap_variables(a, b):
a = b # Bug: loses original value of 'a'
b = a # Bug: 'b' gets the new value of 'a'
return a, b
Step 1: Create a Debug Session
// Tool: create_debug_session
// Request:
{
"language": "python",
"name": "Swap Bug Investigation"
}
// Response:
{
"success": true,
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"message": "Created python debug session: Swap Bug Investigation"
}
Step 2: Set Breakpoints
// Tool: set_breakpoint
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"file": "buggy_swap.py",
"line": 2
}
// Response:
{
"success": true,
"breakpointId": "28e06119-619e-43c0-b029-339cec2615df",
"file": "C:\\path\\to\\buggy_swap.py",
"line": 2,
"verified": false,
"message": "Breakpoint set at C:\\path\\to\\buggy_swap.py:2"
}
Step 3: Start Debugging
// Tool: start_debugging
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"scriptPath": "buggy_swap.py"
}
// Response:
{
"success": true,
"state": "paused",
"message": "Debugging started for buggy_swap.py. Current state: paused",
"data": {
"message": "Debugging started for buggy_swap.py. Current state: paused",
"reason": "breakpoint"
}
}
Step 4: Inspect Variables
First, get the scopes:
// Tool: get_scopes
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"frameId": 3
}
// Response:
{
"success": true,
"scopes": [
{
"name": "Locals",
"variablesReference": 5,
"expensive": false,
"presentationHint": "locals",
"source": {}
},
{
"name": "Globals",
"variablesReference": 6,
"expensive": false,
"source": {}
}
]
}
Then get the local variables:
// Tool: get_variables
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"scope": 5
}
// Response:
{
"success": true,
"variables": [
{"name": "a", "value": "10", "type": "int", "variablesReference": 0, "expandable": false},
{"name": "b", "value": "20", "type": "int", "variablesReference": 0, "expandable": false}
],
"count": 2,
"variablesReference": 5
}
πΈ Screenshot: Variable Inspection Reveals the Bug
This screenshot will show the TUI visualizer after stepping over line 4, where both variables incorrectly show value 20, clearly demonstrating the variable swap bug. The left panel shows the execution state, the center shows the highlighted code, and the right panel displays the incorrect variable values.
π Documentation
- π β Complete API documentation
- π¦ β First-time setup
- ποΈ β Multi-language design
- π§ β Add new languages
- π β Runtime discovery, lazy loading, caching
- π§© β Adapter, factory, loader, and registry contracts
- π β Upgrading to v0.15.0 (dynamic loading)
- π β Python-specific features
- π€ β Leverage AI-friendly features
- π§ β Common issues & solutions
π€ Contributing
We welcome contributions! See for guidelines.
# Development setup
git clone https://github.com/debugmcp/mcp-debugger.git
cd mcp-debugger
npm install
npm run build
npm test
Running Container Tests Locally
We use Act to run GitHub Actions workflows locally:
# Build the Docker image first
docker build -t mcp-debugger:local .
# Run tests with Act (use WSL2 on Windows)
act -j build-and-test --matrix os:ubuntu-latest
See for detailed testing instructions.
π Project Status
- β Production Ready: v0.15.0 with dynamic adapter loading
- β 1019 tests passing end-to-end
- β Clean architecture with adapter pattern
- π§ Coming Soon: Node.js, Go, and more language adapters
- π Active Development: Regular updates and improvements
See for planned features.
π License
MIT License - see for details.
π Acknowledgments
Built with:
- Model Context Protocol by Anthropic
- Debug Adapter Protocol by Microsoft
- debugpy for Python debugging
Give your AI the power to debug like a developer β in any language! π―