Next-generation AI coding agents—from Google DeepMind Antigravity, Cursor, Claude Code, to Windsurf—are revolutionizing how we write and refactor code. But when it comes to investigating post-mortem crash dumps, unravelling thread deadlocks, or inspecting compiled .NET assemblies, they hit a wall. An LLM agent cannot open WinDbg, run !dumpheap, or launch dnSpy.

To solve this, we created Sharphy: an open-source, native Model Context Protocol (MCP) server that transforms AI coding agents into deep .NET runtime diagnosticians, memory forensic analysts, and binary architects.

🔍 What Sharphy lets your AI Agent (Antigravity, Cursor, Claude) do directly in chat:

  1. Analyze Crash Dumps (.dmp): Heuristic analysis via Microsoft.Diagnostics.Runtime (ClrMD) to detect ThreadPool starvation, sync-over-async blocking, and high-memory retainers.
  2. Deadlock Detection (Wait-For Graph): Analyzes thread monitor contention and maps circular wait cycles with exact source line attribution.
  3. Decompile CIL into Clean C#: Embedded ILSpy engine decompiles methods on the fly into idiomatic modern C# without touching external GUI tools.
  4. Unified CIL Bytecode Diffing: Compares two assembly versions at the ECMA-335 metadata level and outputs unified line-by-line CIL instruction diffs (--- Baseline vs +++ Updated).
  5. Zero-Touch IL Patching: Allows the AI agent to surgically patch opcodes (e.g. replacing validation with NOP/Ret/Ldnull) inside collectible AssemblyLoadContext without locking files on disk.

⚡ Quickstart with Antigravity / Cursor / Claude Code

1. In Antigravity (MCP Server Configuration)

Add Sharphy to your Antigravity agent configuration or run it via the local CLI wrapper:

{ "mcpServers": { "sharphy": { "command": "dnx", "args": ["Sharphy.Cli", "mcp", "start"] } } } 

2. In Cursor & Claude Desktop

Add the same block to your ~/.cursor/mcp.json or claude_desktop_config.json.

3. As a Global CLI Tool

dotnet tool install -g Sharphy.Cli sharphy mcp start 

🛡️ Architecture & Invariants

  • Multi-Targeting Native Support: Fully compiled and verified across .NET 8.0, .NET 9.0, and .NET 10.0.
  • Extreme Latency Profile: P99 MCP round-trip latency < 70ms under high concurrency.
  • Zero-Footprint Sandbox: Dynamic assembly inspection executes inside an isolated collectible AssemblyLoadContext (isCollectible: true) to prevent memory leaks and host file locks.
  • Stress-Tested Resilience: Validated against 1,000 req/sec extreme tsunami flood stress and malformed binary fuzzing.

🌐 Links & Resources

Feedback, suggestions, and contributions from the community are very welcome!