SharpToolsMCP
by kooshi·★ 197·综合分 50
一个功能全面的C#开发MCP服务器,基于Roslyn提供代码分析和修改能力。
概述
SharpTools是一个强大的MCP服务器,它利用.NET编译平台(Roslyn)为AI代理提供高级的C#代码库理解、分析和修改能力。它超越简单的基于文本的操作,提供深入的静态分析和精确的代码操作,专门为AI用户设计。服务器通过SSE(远程客户端)和标准I/O(本地进程通信)两种方式暴露工具。
试试问 AI
装完之后,这里有 3 个你可以让 AI 做的事:
什么时候选它
当您处理C#代码库并需要AI执行超出简单文本操作的深度分析、重构或代码修改时,选择SharpTools。
什么时候不要选它
如果您不使用C#代码,或者需要支持多种编程语言的通用代码分析工具,则应避免使用。
此 server 暴露的工具
从 README 抽取出 12 个工具SharpTool_LoadSolutionInitializes the workspace with a given .sln file.
SharpTool_LoadProjectProvides a detailed structural overview of a specific project within the loaded solution.
SharpTool_GetMembersLists members (methods, properties, etc.) of a type with signatures and XML documentation.
SharpTool_ViewDefinitionDisplays the source code of a symbol with contextual information.
SharpTool_FindReferencesLocates all usages of a symbol across the solution with code snippets.
SharpTool_AddMemberAdds a new member (method, property, field, nested type, etc.) to a specified type.
SharpTool_OverwriteMemberReplaces the definition of an existing member or type with new code, or deletes it.
SharpTool_RenameSymbolRenames a symbol and updates all its references throughout the solution.
SharpTool_FindAndReplacePerforms regex-based find and replace operations within a specified symbol or files matching a pattern.
SharpTool_UndoReverts the last applied change using Git integration.
SharpTool_ReadRawFromRoslynDocumentReads the raw content of a file without indentation.
SharpTool_CreateRoslynDocumentCreates a new file with specified content.
可对比工具
安装
安装
前置要求
- .NET 8+ SDK
- 目标解决方案的.NET SDK
构建
dotnet build SharpTools.slnSSE服务器(HTTP)
cd SharpTools.SseServer
dotnet run -- --port 3001 --log-file ./logs/mcp-sse-server.log --log-level DebugStdio服务器配置(VSCode Copilot)
"mcp": {
"servers": {
"SharpTools": {
"type": "stdio",
"command": "/path/to/repo/SharpToolsMCP/SharpTools.StdioServer/bin/Debug/net8.0/SharpTools.StdioServer",
"args": [
"--log-directory",
"/var/log/sharptools/",
"--log-level",
"Debug"
]
}
}
}SharpToolsMCP 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。