Mcpsharp MCP Server
C# development tools for building and connecting to MCP-compliant servers.
Data last scanned today · Reviewed today
Overview
MCPSharp is a .NET library designed to streamline the creation of MCP servers and clients. By using attribute-based mapping, developers can expose existing C# methods as discoverable AI tools, manage JSON-RPC communication automatically, and handle complex object parameters without manual protocol implementation. The library offers specific integrations for the .NET ecosystem, including support for Microsoft.Extensions.AI and Semantic Kernel. It simplifies the development process by handling parameter validation, type conversion, and providing tool change notifications, allowing for dynamic tool registration within standard .NET applications.
Our verdict
With a security score of 39/100, this project carries a high-risk rating. Key concerns include the lack of an independent security review for its authentication methods and the fact that its read-only mode support remains unverified. Given these factors and the project's relative inactivity—with its last commit over 300 days ago—it is best suited for experimental local development rather than sensitive or production-facing environments.
- Supports attribute-based API for simplified tool creation
- Integrates natively with Microsoft.Extensions.AI and Semantic Kernel
- Zero direct dependencies reduce supply-chain surface area
- High-risk security score due to unverified authentication methods
- Inactivity concerns with last commit dated 318 days ago
- Community-maintained project lacking official vendor support
Compatibility
| Client | Local | Docker | Remote | Read-only |
|---|---|---|---|---|
| Claude Desktop | ||||
| Cursor | ||||
| VS Code | ||||
| Windsurf | ||||
| ChatGPT |
Frequently asked questions
›What are the runtime requirements for using MCPSharp?
MCPSharp requires any version of .NET that supports .NET Standard 2.0.
›How do I expose my existing .NET methods as MCP tools?
You can mark methods with the [McpTool] attribute. The server will automatically discover these methods in the base assembly when MCPServer.StartAsync is called.
›Can I register tools from referenced libraries?
Yes, you can manually register methods from referenced libraries by calling MCPServer.Register<T>() where T is the class containing the tools.
›Does MCPSharp support Semantic Kernel or Microsoft.Extensions.AI?
Yes, the library supports Semantic Kernel functions marked with [KernelFunction] and provides integration for Microsoft.Extensions.AI, allowing tools to be exposed as AIFunctions.
›Is it possible to add tools dynamically at runtime?
Yes, you can register tools dynamically using the MCPServer.AddToolHandler method, which accepts a tool definition and a corresponding delegate implementation.
›How should I mark method parameters for MCP tools?
Use the [McpParameter] attribute to provide metadata for your parameters, such as a description and whether the parameter is required.
Changelog
- ImprovedMCPSharp 1.0.11
2025-06-18
- ImprovedMCPSharp 1.0.10
2025-03-15
- ImprovedMCPSharp 1.0.9
2025-03-15
- ImprovedMCPSharp 1.0.8
2025-03-15
- ImprovedMCPSharp 1.0.7
2025-03-15
- ImprovedMCPSharp 1.0.6
2025-03-11
- ImprovedMCPSharp 1.0.5
2025-03-11
- ImprovedMCPSharp 1.0.4
2025-03-03
- ImprovedMCPSharp 1.0.3
2025-03-02
- ImprovedMCPSharp v1.0.0
2025-03-02
Badge
Maintain this server? Add the live badge to your README.