{"type":"mcp_server","name":"MCPSharp","description":"MCPSharp is a .NET library for building Model Context Protocol (MCP) servers and clients, enabling seamless creation of AI-compatible tools and integration with Microsoft.Extensions.AI and Semantic Kernel. MCPSharp is a","category":"Developer Tools","language":"C#","stars":373,"forks":23,"owner":"afrise","github_url":"https://github.com/afrise/MCPSharp","homepage":null,"setup":"## Setup\n\n1.  **Prerequisites**: Any version of .NET that supports [standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0)\n2.  **Installation**: Run `dotnet add package MCPSharp` in your project.","tools":"## Available Tools\n\n1.  Create MCP-compliant tools and functions that AI models can discover and use.\n2.  Connect directly to existing MCP servers from C# code with an easy to use client.\n3.  Expose your .NET methods as MCP endpoints with simple attributes.\n4.  Handle MCP protocol details and JSON-RPC communication seamlessly.\n5.  Easy-to-use attribute-based API (`[McpTool]`, `[McpResource]`)\n6.  Built-in JSON-RPC support with automatic request/response handling.\n7.  Automatic parameter validation and type conversion.\n8.  Rich documentation support through XML comments.\n9.  Near zero configuration required for basic usage.\n10. Microsoft.Extensions.AI Integration: Allows tools to be exposed as AIFunctions.\n11. Semantic Kernel Support: Add tools using Semantic Kernel's KernelFunctionAttribute.\n12. Dynamic Tool Registration: Register tools on-the-fly with custom implementation logic.\n13. Tool Change Notifications: Server now notifies clients when tools are added, updated, or removed.\n14. Complex Object Parameter Support: Better handling of complex objects in tool parameters.\n15. Better Error Handling: Improved error handling with detailed stack traces.","faq":null,"created_at":"2025-02-17T17:39:43+00:00","updated_at":"2025-03-28T08:52:24+00:00","source_url":"https://model-context-protocol.com/servers/dotnet-library-model-context-protocol-servers","related_articles":[]}