AI-controlled cooperative debugger via MCP (Model Context Protocol).
Add breakpoints to your C# code that pause execution until an AI (like Claude) resumes them. The AI can inspect the call stack, view source code context, and control program flow.
┌─────────────────┐ MCP (stdio) ┌─────────────────────────┐
│ AI (Claude) │ ◄──────────────────► │ mcpdebugger mcp │
└─────────────────┘ └───────────┬─────────────┘
│ HTTP
┌───────────▼─────────────┐
│ mcpdebugger serve │
└───────────┬─────────────┘
│ HTTP
┌───────────▼─────────────┐
│ Your Application │
│ with DebugBreak calls │
└─────────────────────────┘
dotnet tool install -g Asynkron.McpDebuggerdotnet add package Asynkron.McpDebugger.Clientusing Asynkron.McpDebugger.Client;
public class MyService
{
public async Task ProcessOrderAsync(Order order)
{
// Async breakpoint - doesn't block threadpool threads
await DebugBreak.HereAsync();
// Your code continues after AI resumes...
await ValidateOrder(order);
// Another breakpoint
await DebugBreak.HereAsync();
await ChargeCustomer(order);
}
}mcpdebugger serveAdd to ~/.claude/settings.json:
{
"mcpServers": {
"debugger": {
"command": "mcpdebugger",
"args": ["mcp"]
}
}
}Your app will pause at each DebugBreak call until the AI resumes it.
// Async breakpoint (recommended) - doesn't steal threadpool threads
await DebugBreak.HereAsync();
// Sync breakpoint - blocks the current thread
DebugBreak.Here();
// Configure server URL (default: http://localhost:5200)
DebugBreak.Configure("http://localhost:5200");
// Disable/enable breakpoints
DebugBreak.Disable();
DebugBreak.Enable();| Tool | Description |
|---|---|
get_breakpoints |
List all active breakpoints |
get_context |
Get call stack and source code for a breakpoint |
resume |
Resume a specific breakpoint |
resume_all |
Resume all active breakpoints |
# List active breakpoints
curl http://localhost:5200/status
# Resume a specific breakpoint
curl -X POST http://localhost:5200/resume/{breakpoint-id}
# Resume all breakpoints
curl -X POST http://localhost:5200/resume-allmcpdebugger serve [--port 5200] # Start the HTTP debug server
mcpdebugger mcp [--port 5200] # Start the MCP server (for AI integration)
mcpdebugger --help # Show helpThe async breakpoint (HereAsync) uses TaskCompletionSource internally:
- Your code awaits an HTTP POST to the debug server
- The server holds the request until the AI calls
resume - No threadpool threads are blocked
The sync breakpoint (Here) simply blocks on the HTTP call:
- The calling thread is blocked until resume
- Use sparingly to avoid thread starvation
git clone https://github.com/asynkron/Asynkron.McpDebugger.git
cd Asynkron.McpDebugger
dotnet buildMIT