
Sharphy
io.github.baharmaulidiii由 GitHub 帳號 baharmaulidiii 發布v1.1.1更新於 Oct 31, 2026
CLR Intelligence and Runtime Forensic Bridge for AI Coding Agents.
概覽
Sharphy 是本地 .NET 診斷 MCP 伺服器,讓 AI 程式助理分析 CLR 當機傾印、檢查受控堆積,並反編譯或修改 .NET 組件。
- 可以做什麼
- 分析當機傾印:對 Windows .dmp 與 Linux ELF core dump 做根因分析,取出當機執行緒呼叫堆疊與例外物件
- 檢查記憶體與執行緒:走訪受控堆積、統計分代與碎片、找出記憶體洩漏保留者,並偵測死鎖循環
- 反編譯與比對:從 CIL 還原 C# 原始碼,並比較兩個組件版本的 API 與位元組碼變化
- 檢查與清理中繼資料:讀取 ECMA-335 中繼資料表、P/Invoke 匯入與資源,並分析混淆
- 修改與產生程式碼:修補 CIL 指令並重新輸出組件、在隔離載入內容中擷取權杖,以及產生強型別 C# 包裝程式碼
- 適用情境
- 適合在助理拿不到原始碼時理解 .NET 程式:依已收集的傾印診斷正式環境當機或卡住、追查記憶體洩漏,或理解並比較編譯後的第三方組件。定位是分析工作站上的事後分析,而非正式環境即時監控。
- 執行需求
- 以本機 stdio 程序執行,需透過 .NET SDK 安裝 .NET 全域工具 Sharphy.Cli,並以 mcp start 參數啟動;支援 .NET 8、9 或 10。傾印檔需另行收集,例如使用 dotnet-dump。未宣告任何驗證、環境變數或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sharphy,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Sharphy: CLR Intelligence & Runtime Forensic Bridge
Native Model Context Protocol (MCP) Server Empowering AI Coding Agents as Advanced .NET Runtime Diagnosticians, Memory Forensic Analysts, and Binary Architects.
Leveraging ECMA-335 Metadata Semantics, Cross-Platform Crash Dump Telemetry, and Rigid CIL Bytecode Navigation.
[NuGet Package] [NuGet Prefix Reserved] [Official MCP Registry Verified] [PulseMCP Listed] [Glama MCP Server] [MCP Catalog] [.NET 8/9/10] [Apache License 2.0] [Contributor Covenant] [GitHub Repo]
Architecture · Ecosystem · MCP Catalog · Agent Setup · Policies & Legal · Changelog · Contributing · Code of Conduct
[!CAUTION] Legal Disclaimer & Limitation of Liability Sharphy is engineered exclusively for good-faith security research, production crash dump diagnostics, vulnerability assessments, incident response, and lawful software engineering. Users bear sole civil and criminal responsibility for complying with applicable territorial cyber laws, third-party End User License Agreements (EULAs), and intellectual property rights. The developer disclaims any liability for malicious misuse or unlawful reverse engineering. Full details: DISCLAIMER.md.
[!IMPORTANT] Install and execute Sharphy only from official distribution channels: verified NuGet packages (
Sharphy.Cliunder the verifiedSharphy.*reserved prefix), official Model Context Protocol (MCP) Registry (io.github.baharmaulidiii/sharphy), or direct compilation from the official repository at github.com/baharmaulidiii/sharphy.
Architecture Overview & Philosophy
Mainstream AI coding agents (Cursor, Claude Code, Windsurf, Copilot) operate primarily on raw source code heuristics in an editor. They suffer from runtime blindness when confronting:
- Production memory crashes and unhandled fatal exceptions
- Multi-threaded synchronization deadlocks and lock cycle contention
- Large Object Heap (LOH) fragmentation and memory leaks
- Compiled third-party binaries lacking source code availability
Sharphy serves as a deterministic runtime forensic bridge implementing the open Model Context Protocol (MCP) specification. Over an isolated JSON-RPC 2.0 Stdio channel, Sharphy exposes Microsoft low-level diagnostics and decompilation engines directly to semantic AI reasoning loops.
Package Ecosystem & Roles
The Sharphy solution is organized into three modular projects with distinct boundaries:
Operational Architecture: Zero-Footprint Production Forensics
A common enterprise architectural question is whether diagnostic servers must be deployed to live production machines.
Does Sharphy need to be installed on your production servers? NO.
Sharphy follows a Zero-Footprint, Post-Mortem Forensic Workflow. The analytical engines, decompilers, and AI agents run strictly in isolated development, CI/CD, or security analyst workstations:
Key Operational Benefits:
- Zero Production Risk: No third-party daemons, background agents, or persistent listeners are installed on mission-critical production servers.
- Standard Microsoft Tooling: Dump collection uses standard, officially supported Microsoft utilities (
dotnet-dump,createdump, or OS crash reporting). - Regulatory & Audit Compliance: Keeps production environments compliant with strict compliance standards (PCI-DSS, ISO/IEC 27001, SOC 2) by avoiding intrusive monitoring hooks.
- Air-Gapped & Offline Ready: Analysis can be performed in completely isolated, offline lab environments without remote runtime connectivity.
10 MCP Tools Catalog
Sharphy exposes ten specialized tools covering the full spectrum of .NET runtime analysis:
1. sharphy_analyze_dump
Automated Root Cause Analysis (RCA) on Windows (.dmp) and Linux (ELF core dump) CoreCLR memory crash dumps. Extracts crashing thread call stacks, unhandled exception objects, and faulty HRESULT codes.
2. sharphy_inspect_heap
Deep managed heap inspection, traversing GC segments, measuring generation distribution (Gen 0, Gen 1, Gen 2, LOH, POH), calculating fragmentation, and pinpointing memory leak retainers.
3. sharphy_deadlock_detector
Traverses the CLR SyncBlock synchronization cache and active thread Monitor locks, building a Wait-For Graph (WFG) to detect thread synchronization deadlock cycles.
4. sharphy_decompile_method
Reconstructs clean, modern idiomatic C# source code from compiled CIL bytecode using the embedded ILSpy engine, reconstructing async state machines and lambda captures.
5. sharphy_diff_assemblies
Performs semantic binary comparisons between two versions of an assembly, flagging added/removed types, breaking changes to public/protected APIs, and CIL instruction size shifts.
6. sharphy_inspect_metadata
Inspects ECMA-335 metadata tables, decoding TypeDef, MethodDef, FieldDef, custom attributes, P/Invoke native imports, and embedded resources.
7. sharphy_clean_obfuscation
Analyzes obfuscated assemblies, demangling Control Flow Graph (CFG) switch-flattening patterns, trimming excessive NOP sleds, and identifying dynamic proxy delegates.
8. sharphy_extract_tokens
Extracts tokens and types by loading assemblies into an isolated, collectible AssemblyLoadContext (isCollectible: true) without locking files on disk or polluting the host process.
9. sharphy_patch_il
Surgically modifies CIL bytecode instructions by replacing target opcodes, adjusting branch offsets, and re-emitting patched binary assemblies.
10. sharphy_generate_wrapper
Generates zero-overhead, strongly-typed C# wrapper code leveraging .NET 8+ [UnsafeAccessor] attributes to access private members and fields without reflection overhead.
Installation & Agent Integration
Quick Start
Install the global CLI tool via the .NET SDK:
Agent Configuration (MCP Setup)
Add Sharphy to your AI coding client configuration:
Cursor (~/.cursor/mcp.json) or Claude Desktop (claude_desktop_config.json):
Multi-Targeting Architecture
Sharphy is engineered with native multi-targeting without emulation layers:
- .NET 8.0 (LTS): Long-term enterprise stability.
- .NET 9.0 (STS): Modern GC and performance optimizations.
- .NET 10.0 (Latest): Cutting-edge compiler APIs and runtime features.
Community Standards, Security & Legal Policies
- Engineering standards and workflows in CONTRIBUTING.md.
- Community code of conduct in CODE_OF_CONDUCT.md.
- Threat modeling and vulnerability reporting in SECURITY.md.
- Accessibility commitments in ACCESSIBILITY.md.
- Trademark and brand guidelines in TRADEMARK.md.
- Liability limitations in DISCLAIMER.md.
- Third-party attributions and licensing in THIRD_PARTY_NOTICE.md.
License
Sharphy is distributed under the Apache License, Version 2.0. Copyright (c) 2026 Moh. Baharudin Yuda Maulidi. All rights reserved.
來源:README.md,提交 ffe227b
工具
0版本歷史
3- v1.1.1最新Oct 31, 2026
- v1.1.0Oct 30, 2026
- v1.0.6Oct 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分