Command Palette

Search for a command to run...

Home / Servers

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_launch verifies the file is a .NET assembly (PE CorHeader, with AppHost .exe.dll fallback); debug_attach verifies 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_select to switch default session, debug_list to 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_list shows 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_get supports scope selection (locals/arguments/all), auto-expand depth, and targeted expansion by name — one call replaces multiple round-trips
  • Exception breakpoints: exception_breakpoints lists available filters and configures which exceptions cause breaks
  • Auto-capture: breakpoints with action="capture" auto-capture variables and continue (per captureScope/captureDepth), accumulating snapshots. capture_state / get_captures / clear_captures manage state snapshots
  • No missed stops: if the program stops (breakpoint or exception) while no tool call is waiting — e.g. after a debug_continue timed out — the pending stop is delivered on the next debug_continue / debug_wait without resuming, so an agent never loses a stop opportunity. debug_state and 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 today

by n8n-io

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

NOASSERTION199,059

mcp-server-fetch

OfficialUpdated today

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

89,138

@modelcontextprotocol/server-filesystem

OfficialUpdated today

by modelcontextprotocol

MCP server for filesystem access

SEE LICENSE IN LICENSE89,138

@modelcontextprotocol/server-everything

OfficialUpdated today

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

89,138