MCP Catalogs
首页

SharpToolsMCP

by kooshi·197·综合分 50

一个功能全面的C#开发MCP服务器,基于Roslyn提供代码分析和修改能力。

developer-toolsai-llmfile-system
31
Forks
8
活跃 Issue
2 个月前
最近提交
2 天前
收录于

概述

SharpTools是一个强大的MCP服务器,它利用.NET编译平台(Roslyn)为AI代理提供高级的C#代码库理解、分析和修改能力。它超越简单的基于文本的操作,提供深入的静态分析和精确的代码操作,专门为AI用户设计。服务器通过SSE(远程客户端)和标准I/O(本地进程通信)两种方式暴露工具。

试试问 AI

装完之后,这里有 3 个你可以让 AI 做的事:

:AI驱动的C#代码分析和重构
:自动化代码修改和生成
:C#解决方案导航和文档生成

什么时候选它

当您处理C#代码库并需要AI执行超出简单文本操作的深度分析、重构或代码修改时,选择SharpTools。

什么时候不要选它

如果您不使用C#代码,或者需要支持多种编程语言的通用代码分析工具,则应避免使用。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • SharpTool_LoadSolution

    Initializes the workspace with a given .sln file.

  • SharpTool_LoadProject

    Provides a detailed structural overview of a specific project within the loaded solution.

  • SharpTool_GetMembers

    Lists members (methods, properties, etc.) of a type with signatures and XML documentation.

  • SharpTool_ViewDefinition

    Displays the source code of a symbol with contextual information.

  • SharpTool_FindReferences

    Locates all usages of a symbol across the solution with code snippets.

  • SharpTool_AddMember

    Adds a new member (method, property, field, nested type, etc.) to a specified type.

  • SharpTool_OverwriteMember

    Replaces the definition of an existing member or type with new code, or deletes it.

  • SharpTool_RenameSymbol

    Renames a symbol and updates all its references throughout the solution.

  • SharpTool_FindAndReplace

    Performs regex-based find and replace operations within a specified symbol or files matching a pattern.

  • SharpTool_Undo

    Reverts the last applied change using Git integration.

  • SharpTool_ReadRawFromRoslynDocument

    Reads the raw content of a file without indentation.

  • SharpTool_CreateRoslynDocument

    Creates a new file with specified content.

可对比工具

roslyn-mcpcsharp-ls-mcpide-mcp

安装

安装

前置要求

  • .NET 8+ SDK
  • 目标解决方案的.NET SDK

构建

dotnet build SharpTools.sln

SSE服务器(HTTP)

cd SharpTools.SseServer
dotnet run -- --port 3001 --log-file ./logs/mcp-sse-server.log --log-level Debug

Stdio服务器配置(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 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。