沙伦孔
   
一个MCP服务器,使AI代理能够深入了解。NET生态系统。搜索NuGet、浏览程序集、使用XML文档读取类型签名以及反编译到C#源代码——所有这些都不会离开对话。
为什么选择SharpRecon?
当AI代理需要理解。NET库-如何调用API,存在什么重载,版本之间发生了什么变化-它通常必须依赖于可能过时或不完整的训练数据。SharpRecon允许代理直接访问源代码:下载实际包,检查其真实类型签名和文档,并在需要时反编译实现。每个答案都来自包装本身,而不是记忆。
安装
Claude Code插件(推荐)
/plugin marketplace add Webhooks-Ltd/claude-plugins
/plugin install sharp-recon该插件在首次使用时会自动下载适用于您平台的正确预构建二进制文件,并在有新版本可用时进行更新。
VS代码/光标
添加 .vscode/mcp.json 在您的工作空间中:
{
"servers": {
"sharp-recon": {
"type": "stdio",
"command": "node",
"args": ["/path/to/SharpRecon/launcher.js"]
}
}
}任何MCP客户端
SharpRecon使用标准音频MCP。将您的客户端指向启动器:
node /path/to/SharpRecon/launcher.js工具
十个工具排列成一个渐进的钻取管道——根据需要从宽开始,从窄开始:
| 工具 | 目的 |
|---|---|
nuget_search | 在NuGet.org上按关键字查找软件包 |
nuget_download | 下载包并返回版本、TFM和运行状况(弃用、漏洞、发布日期) |
local_load | 加载本地。NET程序集(.dll/.exe)或目录,用于检查和反编译 |
assembly_list | 列出包或本地加载中的程序集,按目标框架分组 |
type_list | 按命名空间分组列出程序集中的所有公共类型 |
type_search | 按名称在包或本地加载中的所有程序集中搜索类型 |
type_detail | 获取完整的类型声明:XML文档、基类型和所有成员签名 |
member_detail | 获取特定成员的所有重载签名和XML文档 |
decompile_type | 将类型分解为C#源代码 |
decompile_member | 将单个成员分解为C#源代码 |
主要惯例:
- 检查和反编译工具适用于这两个NuGet包(
nuget_download)地方议会(local_load). - 之后的所有工具
nuget_download/local_load需要它们返回的标识符。 - 程序集名称省略了
.dll扩展。 - 类型名称必须完全限定(例如。
Newtonsoft.Json.JsonConvert). - 当
tfm如果省略,则自动选择最高可用框架。 type_detail和member_detail速度很快(无需反编译)。使用decompile_*仅当您需要实现源代码时。
技能
当作为Claude Code插件安装时,两个斜线命令提供指导工作流程:
| 技能 | 描述 | 示例 |
|---|---|---|
/investigate-package | 逐步调查NuGet包——下载、浏览类型、读取签名、反编译 | /investigate-package Newtonsoft.Json |
/compare-versions | 比较两个版本之间的公共API表面,以找到突破性的更改和新的API | /compare-versions Newtonsoft.Json 12.0.3 13.0.3 |
典型工作流程
代理通过逐步缩小的工具从包搜索深入到源代码:
nuget_search Find a JSON serialization library
nuget_download Download Newtonsoft.Json 13.*
assembly_list What assemblies and TFMs does it contain?
type_search Find types matching "JsonConvert"
type_detail Full declaration and member signatures
member_detail All overloads of SerializeObject with docs
decompile_member Source of SerializeObject(object)对于本地程序集,相同的管道以 local_load 相反:
local_load Load a build output directory or single DLL
assembly_list What assemblies were loaded?
type_search Find types matching "UserService"
type_detail Full declaration and member signatures
decompile_type Source of the entire type启动器
这 launcher.js 脚本处理二进制管理,因此您不必:
- 自动下载 --首次运行时,从GitHub release获取适用于您平台的正确发布二进制文件(win-x64、linux-x64、osx-x64、osx-arm64)。
- 版本已固定 --下载与插件版本匹配的确切版本,并在插件更新时进行升级。
- 卷影复制 --在启动之前将二进制文件复制到临时目录,防止在重建过程中文件锁定。过期的副本会自动清理。
从源头构建
需要 .NET 10.0 SDK.
# Build
dotnet build
# Run tests
dotnet test
# Publish (required before the launcher can use local binaries)
dotnet publish src/SharpRecon/SharpRecon.csproj -o src/SharpRecon/bin/publish在本地开发时,在代码更改后重新发布——启动器从发布目录读取,而不是生成输出。
