ASPNET Core Debugging MCP Server
This server lets an AI agent debug .NET/ASP.NET Core apps via MCP — launching or attaching, setting breakpoints, inspecting and mutating state, and running high-level diagnostics like exception autopsies, hang analysis, and request tracing.
Session management: launch, attach, disconnect, continue, pause, step, and check debugger health.
Breakpoints: set line, function, exception, and data breakpoints; list and remove them.
Inspection & mutation: list threads, get stack traces (with async flattening), read variables (recursive), evaluate C# expressions, and set variable values mid-run.
Composites:
exception_autopsy(exception chain + stack + locals + source),stack_explore(full stack with ASCII tree),hang_analyze(classify thread blocking patterns), andtrace_start/get/stop(auto-instrument method calls with timings).Process I/O: read debuggee stdout/stderr.
Cross-platform: runs on Linux, macOS, and Windows with a bundled netcoredbg — no extra debugger install.
Provides tools for debugging .NET and ASP.NET Core applications, including launching, breakpoints, stepping, inspection, expression evaluation, exception analysis, hang analysis, and request tracing.
ASP.NET Core Debugging MCP Server
The cross-platform .NET debugging MCP — runs on Linux, macOS, and Windows.
An MIT-licensed MCP server that lets an AI agent (Claude, etc.) debug your .NET / ASP.NET Core app — netcoredbg bundled for every platform, nothing extra to install.
Instead of "I think the bug is around line 42, try this", the agent runs your code, pauses it, reads the actual runtime values, mutates state to test a fix, and answers grounded in what it actually saw.
Contents
See it in action — 5 conversations showing the agent at work
How it works — architecture diagram
Use it in 3 steps — install + register with Claude
Platforms — supported OS / architecture matrix
Tools (27) — full tool surface grouped by purpose
How this compares — vs. other .NET / DAP MCPs
Docs — install, examples, tool reference, limits
Related MCP server: LSP-MCP
See it in action
Why is my EF Core query returning empty?
You
GET /users/activereturns[], but I know there are active users in the DB. What's the query actually doing?
Claude
I'll pause inside
UserRepository.GetActiveAsyncand read what EF Core actually sent.SELECT u.* FROM Users AS u WHERE u.IsActive = 1 AND u.TenantId = @__tenantId_0 @__tenantId_0 = 0The SQL is correct; the parameter is wrong.
TenantId = 0, but your tenants start at 1.ICurrentUser.TenantIdis being read in the repository constructor — before the request scope resolves it. Fix: read the tenant inside the query (or apply it viaHasQueryFilterwithIHttpContextAccessor) instead of capturing it at construction.
Why is my JWT auth returning 401?
You
/admin/usersis 401-ing for Anna, but her token looks valid to me. What does the auth handler actually see?
Claude
I'll break inside
JwtBearerHandler.HandleAuthenticateAsyncafter her request lands.Token signature: ✓ valid Claims built: name : anna role : User iss : https://auth.staging.example aud : app-api exp : 2026-05-26T14:12:00Z (not expired)The token validates fine — but the claim is
role=User. Your endpoint is[Authorize(Roles="Admin")]. So the 401 is correct: Anna isn't actually an admin yet upstream. Either her IdP record needs updating, or this policy is wrong.
Test a fix without restarting
You
I think capping
discountat 100 fixes the bug. Test that hypothesis without me touching the code.
Claude
I'll pause inside
ApplyDiscounton the next checkout and mutatediscountin place.Paused at PricingService.cs:47 discount = 250 ← bug: two promos stacked Set discount = 100, resumed. Result: subtotal = $400 final = $300 refund-service complaints: 0Capping at 100 unblocks the flow downstream. Hypothesis confirmed — time to make the edit for real and decide where the cap belongs (
ApplyDiscountitself, or upstream inPromoEngine).
My app is hung — what's actually blocking?
You
/reportshangs forever in staging. Attach and tell me why.
Claude
Attached. Ran
hang_analyze.Thread 12 (HTTP request) → blockedOnTask at ReportService.cs:38 Task.Wait() on T#14 Thread 14 (worker) → blockedOnMonitor at SqlConnectionPool.cs:91 waiting for SqlConnection (pool max=5, in-use=5)Classic sync-over-async deadlock. Thread 12 calls
.Wait()on a task that itself needs to open anotherSqlConnectionfrom a fully-held pool. The connection it's holding can't be released until the task completes; the task can't proceed until a connection frees up. Fix:awaitall the way down inReportService, or don't hold a connection across the awaited call.
Where is a slow request actually spending its time?
You
GET /order/42takes 800ms. I don't want to set breakpoints all over — just show me where the time is going.
Claude
I'll auto-instrument your order pipeline and fire the request. Each entry logs the timestamp + arguments, then resumes — the code runs near-normal speed.
[+ 4ms] → OrderController.GetOrder() id=42 [+ 6ms] --→ OrderService.LookupOrder() id=42 [+ 9ms] ----→ OrderRepository.FetchById() id=42 [+ 14ms] ------→ SqlClient.ExecuteQuery() sql="SELECT * FROM orders WHERE id=42" [+ 287ms] ----→ EnrichmentService.Enrich() raw="rows(...)" [+ 781ms] ------→ HttpClient.PostAsync() url="https://crm.internal/enrich"Time is in the CRM enrichment HTTP call — 500ms inside
HttpClient.PostAsync. DB itself was 5ms. Worth cachingEnrichmentService.Enrichor moving it off the request path.
How it works
Claude (MCP client)
│ MCP (stdio / JSON-RPC)
▼
aspnetcore-debugger-mcp ← this server
│ DAP (Debug Adapter Protocol)
▼
netcoredbg ← Samsung's MIT-licensed .NET debugger, child process
│ ICorDebug
▼
target .NET processA protocol bridge with agent-friendly composites on top — exception_autopsy, stack_explore,
hang_analyze, and the trace tools — that bundle multiple DAP requests into a single tool call.
Use it in 3 steps
Install the tool — needs the .NET 10 SDK.
dotnet tool install -g AspNetCoreDebuggerMcp --prereleaseThe package bundles prebuilt
netcoredbgforlinux-x64,linux-arm64,win-x64,osx-x64, andosx-arm64— no separate install needed.Register with Claude — either the quick CLI command:
claude mcp add aspnetcore-debugger -- aspnetcore-debugger-mcp…or edit
.mcp.json(project-scoped) /~/.claude.json(global) /claude_desktop_config.json(Claude Desktop) directly:{ "mcpServers": { "aspnetcore-debugger": { "command": "aspnetcore-debugger-mcp" } } }Just chat with Claude.
/mcpconfirms it's connected. From there, describe what you want — "why does this endpoint return null" — and the agent picks the right tools.
Full install + troubleshooting →
Platforms
Bundled netcoredbg binary is selected at runtime — no per-platform install dance.
OS | Architectures | Status |
Linux | x64, arm64 | ✅ Supported (Samsung prebuilt) |
macOS | Intel (x64), Apple Silicon (arm64) | ✅ Supported (arm64 built by us, since Samsung doesn't ship one) |
Windows | x64 | ✅ Supported (Samsung prebuilt) |
Requires the .NET 10 SDK on the host. The MCP server itself is a cross-platform .NET global tool — same install command everywhere.
Tools (27)
Category | Tools | What it's for |
Session |
| Start, attach to, or stop a debug session |
Execution |
| Drive the debuggee and wait for it to stop |
Breakpoints |
| Line, function, exception, and data breakpoints |
Inspection |
| Examine and mutate program state |
Exception Autopsy |
| One call: exception chain + top frames + locals + source snippet |
Hang / Deadlock |
| Auto-pause, classify each thread's blocking pattern (Monitor / Task / Semaphore / async / …) |
Request Tracing |
| Server-side request tracing — auto-instrument a call chain and capture arguments at every entry |
Process I/O |
| Drain the debuggee's stdout/stderr |
Health |
| Quick check that netcoredbg loaded and the bundled binary is reachable |
Full tool reference with parameters →
How this compares
Project | License | Platforms | Approach | .NET |
aspnetcore-debugger-mcp (this) | MIT | Linux + macOS + Windows | netcoredbg via DAP, ASP.NET-focused composites (request tracing, hang analysis) | Native, .NET 10 |
AGPL-3.0 | Linux only (Win/macOS planned) | ICorDebug direct, Roslyn code nav | Native, .NET 10 | |
— | Cross-platform | DAP | Via external debugger | |
— | Cross-platform | DAP | Via external debugger | |
NCSA | Cross-platform | Native LLDB | No |
Different sweet spots: this project is the MIT, cross-platform option, with ASP.NET-flavoured composites on top of a DAP. debug-mcp goes deeper into runtime internals via ICorDebug but is Linux-only and AGPL today.
Docs
Install & configure — 3 steps, both Claude Code & Desktop, troubleshooting
What you can do with it — 7 things you can ask Claude to do for you
Full tool reference — every parameter on every tool
Known limits — when not to use this tool, adapter & tracing limits
Contributing — repo layout, tests, dev loop
License
MIT — see LICENSE. Built on netcoredbg (MIT) and the ModelContextProtocol SDK (MIT).
Available Tools
27 toolsbreakpoint_listA
List all currently set breakpoints (line, function, and exception filters).
Inputs: no named parameters.
breakpoint_removeA
Remove a breakpoint by its id (line or function).
Inputs: id (required).
breakpoint_setA
Set a line breakpoint in a source file. Supports conditional, hit-count, and logpoint (logMessage) breakpoints.
Inputs: line (required), sourcePath (required), condition, logMessage, +1 more.
breakpoint_set_dataA
Set a data/watch breakpoint: break when a specific variable changes (or is read). Requires a variablesReference + name from variables_get. May not be supported by all adapters.
Inputs: name (required), variablesReference (required), accessType.
breakpoint_set_exceptionA
Set the active exception breakpoint filters. Pass [] to clear. Common netcoredbg filters: "all", "user-unhandled".
Inputs: filters (required).
breakpoint_set_functionA
Set a breakpoint on a function by symbol name (e.g. "Namespace.Class.Method").
Inputs: functionName (required), condition, hitCondition.
breakpoint_waitA
Block until the debuggee hits a breakpoint, completes a step, or otherwise stops. Returns the stop info plus a full one-shot snapshot: the topmost stack frame, a source snippet around the stop, top-frame locals, and a peek of recent debuggee stdout/stderr (non-destructive — process_read_output still drains the full buffer). Designed so an agent in a step-inspect loop doesn't need separate inspect / read-output round trips.
Inputs: timeoutSeconds, maxLocalsPerScope, maxRecentOutputLines.
debug_attachB
Attach the debugger to an already-running .NET process by PID.
Inputs: processId (required).
debug_continueC
Resume execution of the debuggee. Defaults to the last-stopped thread.
Inputs: threadId.
debug_disconnectA
Disconnect the debugger and terminate the debuggee.
Inputs: no named parameters.
debugger_healthA
Self-diagnostic. Reports the host platform, RID, resolved netcoredbg path (or that it's missing), where the binary came from (bundled / env var / PATH), and the netcoredbg version it reports. Call this first when something looks wrong, instead of starting a real debug session to find out.
Inputs: no named parameters.
debug_launchB
Launch a .NET program under the debugger. Returns the resulting session state.
Inputs: program (required), cwd, env, args, +1 more.
debug_pauseA
Pause the debuggee. Requires a thread id; defaults to the last-stopped thread if known.
Inputs: threadId.
debug_stateA
Return the current debug session state, including process id and last stop info.
Inputs: no named parameters.
debug_stepA
Single-step the debuggee. Kind: "in" (step into), "over" (step over), "out" (step out). Pass waitTimeoutSeconds > 0 to also block on the next stop and return the same one-shot snapshot as breakpoint_wait (top frame, snippet, top-frame locals, recent debuggee output). Without it the call returns immediately after issuing the step — today's behavior.
Inputs: kind (required), threadId, maxLocalsPerScope, waitTimeoutSeconds, +1 more.
evaluateA
Evaluate a C# expression in the context of a stack frame. Returns the result as a string plus a variablesReference if the result is a compound value.
Inputs: expression (required), frameId.
exception_autopsyA
Full exception context in one call: exception type + inner-exception chain + top stack frames + top frame's locals + source snippet around the throw + a peek of recent debuggee stdout/stderr (non-destructive — process_read_output still drains the full buffer). Call this when state.lastStop.reason == "exception".
Inputs: threadId, frameCount, maxRecentOutputLines.
hang_analyzeA
Diagnose why an application appears stuck. Auto-pauses if running, lists all threads, fetches the top frames of each, and classifies each thread's blocking pattern (Monitor / WaitHandle / Semaphore / Task / Thread.Join / Thread.Sleep / async await). Leaves the session paused so you can inspect further.
Inputs: topFramesPerThread.
process_read_outputA
Drain buffered output (stdout/stderr) from the debuggee since the previous call. Returns the lines collected and removes them from the buffer. Filtering by category drains only that category — lines in other categories, and matches beyond maxLines, stay buffered for a later call.
Inputs: category, maxLines.
stack_exploreA
In one call: full stack + locals at every frame + a pre-rendered ASCII tree showing caller → callee with arrows. Use this instead of stacktrace_get + variables_get per frame when you want to see the whole picture at once.
Inputs: threadId, maxFrames, maxLocalsPerFrame.
stacktrace_getA
Get the call stack of a thread. By default async state-machine frames are flattened back to their original method names (e.g. UserService.d__3.MoveNext → UserService.GetAsync) and BCL async infrastructure frames are hidden. Pass raw=true for the unmodified DAP frames.
Inputs: raw, levels, threadId, startFrame.
threads_listB
List all threads in the debuggee.
Inputs: no named parameters.
trace_getA
Read events captured since trace_start, plus a pre-rendered ASCII timeline with → for method entries and ⚠ for exceptions. Does NOT clear the buffer — call trace_stop when done.
Inputs: maxEvents.
trace_startA
Begin tracing a set of methods. Each named method gets a server-side trace breakpoint that captures the call (top stack + locals) and auto-continues — the request flows through at near-normal speed and your debug state is unaffected. If includeExceptions=true, unhandled exceptions are also captured. Use trace_get to read the captured events and trace_stop to remove the trace. One trace active at a time.
Inputs: methods (required), captureStack, captureLocals, includeExceptions, +2 more.
trace_stopA
Stop the active trace and remove its breakpoints. Captured events are discarded — call trace_get first if you want to keep them.
Inputs: no named parameters.
variables_getA
Get variables for a stack frame. Defaults to the topmost frame of the last-stopped thread. Recursively expands compound values up to depth levels and truncates each level at maxChildren.
Inputs: depth, frameId, maxChildren.
variables_setB
Set the value of a variable or any lvalue expression (e.g. "userId" or "user.Name"). The agent can use this to test fixes by mutating state mid-run.
Inputs: value (required), expression (required), frameId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Each tool has a distinct purpose: breakpoint management, execution control, stack inspection, tracing, and diagnostics are cleanly separated. The breakpoint_* and trace_* families are clearly differentiated by their suffixes (set, remove, list, wait, start, stop, get).
The tool names are largely predictable, with strong prefixes like debug_, breakpoint_, trace_, and stack*. Minor inconsistencies exist, such as 'threads_list' vs 'debug_state' and 'stack_explore' vs 'stacktrace_get', but the overall pattern remains comprehensible.
27 tools is on the upper end of what's reasonable for a debugger domain, covering session control, breakpoints, stepping, inspection, tracing, and diagnostics. Some redundancy exists (e.g., stack_explore bundles stacktrace_get + variables_get; debug_step can also wait like breakpoint_wait), which adds weight without adding much capability.
The domain coverage is strong: launch/attach, pause/continue/step, multiple breakpoint types, stack/variable inspection, expression evaluation, output reading, and diagnostic helpers. The main gap is a detach-without-terminate operation)Skip? Otherwise, no obvious missing capabilities for a debugger MCP server.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI agents to debug .NET applications using netcoredbg. It supports core debugging tasks like setting breakpoints, stepping through code, and inspecting variables or stack traces.1MIT
- FlicenseAqualityDmaintenanceMinimal MCP server bridging a Roslyn C# language server to AI agents, exposing tools for diagnostics, call hierarchy, and type hierarchy.1-
- AlicenseNot gradedqualityCmaintenanceMCP server that lets AI coding tools control and observe a running Node.js process through the chrome devtools protocol (CDP), via a lightweight Debug Adapter Protocol (DAP) bridge.70 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for AI-assisted Python debugging using debugpy and Debug Adapter Protocol, enabling AI agents to run tests, set breakpoints, and inspect variables via natural language.8MIT