
SharpBridge
by gang2k-coder
SharpBridge
An MCP (Model Context Protocol) server that enables AI agents to debug .NET programs interactively. Supports multiple simultaneous debug sessions — launch or attach to several processes at once. Built on .NET 10 and SharpDbg via the Debug Adapter Protocol (DAP).
How It Works
AI Agent (Claude/Copilot/...) ←→ MCP ←→ SharpBridge ←→ DAP ←→ SharpDbg ←→ Your .NET App(s)
SharpBridge translates MCP tool calls into DAP debug commands, giving AI coding agents the ability to set breakpoints, step through code, inspect variables, and evaluate expressions at runtime. Under the hood it uses SharpDbg, a .NET debug adapter built on ICorDebug — the same COM-based debugging API that Visual Studio uses.
Features
- Multi-session: debug multiple processes simultaneously — each with its own DAP connection, breakpoints, and state
- Launch .NET programs with debugging, or attach to running processes (by PID or process name)
- Target validation:
debug_launchverifies the file is a .NET assembly (PE CorHeader, with AppHost.exe→.dllfallback);debug_attachverifies the process has the CLR loaded — non-.NET targets are rejected with a clear error before any debugger work starts - Smart attach: auto-detect single vs. multiple process instances by name
- Session management:
debug_selectto switch default session,debug_listto see all active sessions - 25 MCP tools: session management, breakpoints (source + function, with auto-capture), exception breakpoints, execution control, state inspection, and capture snapshots
- Module introspection:
modules_listshows the modules (assemblies) loaded into the debugged process with their paths — useful for diagnosing pending breakpoints or verifying which assembly was loaded - Smart inspect:
variables_getsupports scope selection (locals/arguments/all), auto-expand depth, and targeted expansion by name — one call replaces multiple round-trips - Exception breakpoints:
exception_breakpointslists available filters and configures which exceptions cause breaks - Auto-capture: breakpoints with
action="capture"auto-capture variables and continue (percaptureScope/captureDepth), accumulating snapshots.capture_state/get_captures/clear_capturesmanage state snapshots - No missed stops: if the program stops (breakpoint or exception) while no tool call is waiting — e.g. after a
debug_continuetimed out — the pending stop is delivered on the nextdebug_continue/debug_waitwithout resuming, so an agent never loses a stop opportunity.debug_stateand inspection tools acknowledge a seen stop; launch/attach reset the tracking per process - Single STDIO transport — zero-config MCP integration
Quick Start
Prerequisites
- .NET 10 SDK (for building/running .NET apps to debug)
- A supported AI coding agent (Claude Desktop, Claude Code, Cursor, GitHub Copilot, etc.)
Option 1: Install from NuGet (recommended)
dotnet tool install -g SharpBridge
Then add this to your MCP config (see client-specific paths below):
{
"mcpServers": {
"sharpbridge": {
"command": "sharpbridge"
}
}
}
Option 2: Build from source
git clone https://github.com/gang2k-coder/SharpBridge.git
cd SharpBridge
dotnet build
When built from source, use this MCP config instead:
{
"mcpServers": {
"sharpbridge": {
"command": "dotnet",
"args": ["run", "--project", "/path/to/SharpBridge/SharpBridge"]
}
}
}
Configure your MCP client
Add SharpBridge to your MCP client's configuration file:
<details> <summary><b>Claude Code</b></summary>Create or edit .mcp.json in your project root:
{
"mcpServers": {
"sharpbridge": {
"command": "sharpbridge"
}
}
}
`
Related servers

n8n
Updated todayby n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

mcp-server-fetch
OfficialUpdated todayA Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

@modelcontextprotocol/server-filesystem
OfficialUpdated todayMCP server for filesystem access