Enables debugging of .NET applications, allowing users to launch or attach to processes, set and manage breakpoints, step through code, and inspect variables, scopes, and call stacks.
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., "@mcp-netcoredbgset a breakpoint on line 15 of Program.cs and launch the debugger"
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.
mcp-netcoredbg
MCP server for .NET debugging via netcoredbg.
Enables AI agents (Claude, etc.) to set breakpoints, step through code, and inspect variables in .NET applications.
Architecture
Tools
Session Management (NEW in v2.0)
Tool | Description |
| List all active debug sessions |
| Set the default session for commands |
| Terminate a specific session |
Launch & Attach
Tool | Description |
| Start debugging a .NET application (DLL path) |
| Start debugging with hot reload via |
| Stop hot reload debugging mode |
| Attach to a running .NET process |
| Invoke a specific method in an assembly (with optional debugging) |
| Restart the debugged program (for |
| Stop debugging session |
Breakpoints
Tool | Description |
| Set breakpoint at file:line (supports conditions) |
| Remove a breakpoint |
| List all active breakpoints |
Execution Control
Tool | Description |
| Continue execution |
| Pause execution |
| Step over current line |
| Step into function call |
| Step out of current function |
Inspection
Tool | Description |
| Get current call stack |
| Get variable scopes for a stack frame |
| Get variables from a scope |
| Evaluate expression in debug context |
| List all threads |
| Get recent program output |
| Get debugger status |
Note: All tools accept an optional sessionId parameter to target a specific session. If omitted, the default session is used.
Multi-Session Debugging (v2.0)
Version 2.0 introduces support for multiple simultaneous debug sessions. This allows you to debug multiple .NET applications concurrently - for example, an API and a background worker.
Auto-Generated Session IDs
When you launch a debug session without specifying a sessionId, one is automatically derived from the project/program name:
TopServer.Service.Api→ session ID:apiTopServer.Service.Worker→ session ID:workerMyApp.Web→ session ID:webCustom: specify
sessionIdparameter explicitly
Example: Debugging API + Worker Simultaneously
Session Management Commands
Command | Description |
| Show all active sessions with status |
| Change which session receives commands by default |
| Stop a specific session |
Backward Compatibility
If you only use one session, the behavior is unchanged from v1.x - no sessionId parameter needed.
Method Invocation (invoke)
The invoke tool lets you run a specific method from a .NET assembly without launching the full application. This is useful for:
Testing individual methods in isolation
Running utility functions
Debugging specific code paths without going through the whole app
Parameters
Parameter | Type | Required | Description |
| string | Yes | Path to the .NET DLL |
| string | Yes | Fully qualified type name (e.g., |
| string | Yes | Method name to invoke |
| array | No | Method arguments as JSON array |
| array | No | Constructor arguments (for instance methods) |
| boolean | No | Launch under debugger for breakpoint support (default: false) |
| string | No | Working directory |
Examples
Static method:
Instance method with constructor arguments:
With debugging (breakpoints supported):
Features
Static methods: Just provide type, method, and args
Instance methods: Automatically constructs the type (provide
ctorArgsif needed)Auto ILogger injection:
ILogger<T>parameters are automatically resolvedAsync support: Automatically awaits Task-returning methods
Console capture: Captures
Console.WriteLineoutputLog capture: Captures
ILoggercalls made during executionRich errors: On failure, shows available constructors/methods to help you fix the call
Output Format
The tool returns a structured JSON result:
On error, it provides helpful diagnostics:
Hot Reload Debugging (launch_watch)
The launch_watch tool enables debugging with hot reload support via dotnet watch. When you make code changes, the app automatically restarts and the debugger reconnects - preserving your breakpoints.
Parameters
Parameter | Type | Required | Description |
| string | Yes | Path to the .NET project directory (containing .csproj) |
| string | No | Name of a launch profile from |
| array | No | Additional arguments to pass to |
Examples
Basic usage:
With launch profile (recommended for ASP.NET apps):
The launch profile is important for ASP.NET applications as it sets:
ASPNETCORE_ENVIRONMENT(e.g., Development)applicationUrl(e.g., https://localhost:7179)Other environment variables needed for proper operation
How It Works
Starts
dotnet watch runwith the specified projectWaits for the app to build and start
Automatically attaches the debugger to the running process
When you edit code and save,
dotnet watchrebuilds and restartsThe debugger detects the restart and reconnects automatically
Breakpoints are preserved across restarts
Stopping Hot Reload Mode
Use stop_watch to cleanly terminate both the debugger and the dotnet watch process.
Status Information
Use status to see hot reload specific information:
Watch process PID
Child app PID
Whether the debugger is currently reconnecting
Prerequisites
netcoredbg installed and in PATH
Node.js 18+
.NET SDK 8.0+ (for building the harness and target applications)
Installation
Usage with Claude Code
Quick install:
Or manually add to your Claude Code MCP settings:
Security
This tool launches and controls a debugger. By design, it can:
Execute arbitrary .NET applications
Evaluate expressions within the debugged process
Inspect memory and variables
Only use this with code you trust. Do not debug untrusted applications.
Example Session
Full Application Debugging
Build your .NET app with debug symbols:
dotnet build --configuration DebugLaunch debugger:
launchwith the DLL pathSet breakpoints:
set_breakpointat file:lineContinue/step through code
Inspect variables with
scopesandvariablesEvaluate expressions with
evaluateTerminate when done
Method Invocation (Quick Testing)
Build the target assembly:
dotnet buildUse
invokewith the type and method nameIf it fails, check the error for available constructors/methods
For debugging: set breakpoints first, then use
invokewithdebug: true
Agent Guidelines
When using this MCP server as an AI agent:
Choosing Between launch and invoke
Use
invokewhen you want to test a specific method in isolationUse
launchwhen you need to run the full application or debug complex scenarios
Using invoke Effectively
Start simple: Try without
ctorArgsfirst - the harness will use parameterless constructors or auto-injectILogger<T>Handle errors iteratively: If invocation fails, the error response includes available methods/constructors. Use this to correct your call.
For debugging specific methods:
1. Set breakpoints in the source files first 2. Call invoke with debug: true 3. Use continue/step_over/step_into to navigate 4. Use output to see the final resultArguments are JSON: Pass args as a JSON array. The harness handles type conversion:
Strings:
"hello"Numbers:
42,3.14Booleans:
true,falseNull:
nullObjects:
{"name": "Alice", "age": 30}
Common Patterns
Testing a utility method:
Testing with constructor injection:
Debugging a failing method:
License
MIT