csdbg is an IDE-independent MCP debugger for agent-driven C#/.NET debugging.
Install the .NET 10 SDK, then install the global tool from NuGet.org:
dotnet tool install --global Csdbg.Mcp
csdbg --install-netcoredbg
csdbg --checkThe backend installer supports Linux x64/arm64, macOS arm64, and Windows x64,
and selects the correct netcoredbg package automatically.
Configure an MCP client to launch csdbg over stdio:
{
"mcpServers": {
"csdbg": {
"command": "csdbg",
"args": []
}
}
}The MCP server describes its tools and recommended next actions to the agent. A typical debugging flow is:
- Call
get_status. - Add source breakpoints with
add_breakpoint. - Launch a .NET DLL or executable with
start_debug, or useattach_debug. - Inspect threads, call stacks, scopes, variables, and expressions while stopped.
- Continue or step until the problem is understood.
- Call
stop_debugwhen finished.
Available MCP tools:
- Session:
get_status,start_debug,attach_debug,stop_debug - Breakpoints:
add_breakpoint,remove_breakpoint,set_exception_breakpoints - Execution:
continue_execution,wait_for_stop,pause_execution,step_over,step_into,step_out - Inspection:
get_threads,get_call_stack,get_scopes,get_variables,evaluate_expression,get_exception_info
The MCP client owns the csdbg process. Running csdbg directly starts the same
stdio server, writes one startup message to stderr, and waits for MCP input;
stdout is reserved for protocol messages.
The server has no fixed idle timeout and starts netcoredbg only when a debug
session is requested. Closing the MCP client or its stdio connection stops the
server and cleans up the active session. Ctrl+C and SIGTERM also perform graceful
cleanup. stop_debug stops the debuggee and netcoredbg without stopping the
MCP server.
See the development and design guide for local builds, tests, publishing, architecture, supported targets, and project scope.
The repository also includes the concise
csdbg-debug agent skill for runtime investigations.
- Added
wait_for_stop, MCPtools/callmetadata compatibility, and a focusedcsdbg-debugskill with diagnostics and sensitive-output guidance. - Removed redundant successful-response actions and compacted execution and breakpoint-mutation responses.
- Exposed the current top frame ID and improved running-session thread discovery.
- Hardened positive timeout validation and recovery after invalid breakpoint or debugger-session operations.
- Improved evaluation safety for lambda arrows, assignment operators, and mutation-like characters inside string literals.
- Added stable evaluation failure, timeout, and stale-frame error codes, with explicit capability metadata when the backend cannot distinguish syntax, unavailable context, and target failures.
- Exposed concise package and source build provenance through
get_status.
- Added direct package discovery and automated GitHub Releases and Packages mirroring.
- Improved MCP stdio startup, shutdown, CLI guidance, and agent initialization instructions.
- Initial .NET tool and MCP server release with launch and attach debugging, breakpoints, execution control, inspection, expression evaluation, and exception handling.