MCPSharp
@afrise
About MCPSharp
MCPSharp is a .NET library that helps you build Model Context Protocol (MCP) servers and clients - the standardized API protocol used by AI assistants and models.
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCPSharp?
MCPSharp is a .NET library that helps you build Model Context Protocol (MCP) servers and clients, the standardized API protocol used by AI assistants and models. It allows you to create MCP-compliant tools and functions, connect to MCP servers from C# code, and expose .NET methods as MCP endpoints using simple attributes.
How to use MCPSharp?
Install the NuGet package with dotnet add package MCPSharp. Define a class and mark methods with the [McpTool] attribute, then start the server by calling MCPServer.StartAsync("serverName", "1.0.0"). Optionally, register tools from referenced libraries using MCPServer.Register<T>().
Key features of MCPSharp
- Easy-to-use attribute-based API (
[McpTool],[McpResource]) - Built-in JSON-RPC support with automatic request/response handling
- Automatic parameter validation and type conversion
- Rich documentation support through XML comments
- Dynamic tool registration with custom implementation logic
- Integration with Microsoft.Extensions.AI and Semantic Kernel
Use cases of MCPSharp
- Create tools that AI assistants like Anthropic's Claude Desktop can use
- Build MCP-compliant APIs without dealing with protocol details
- Expose existing .NET code as MCP endpoints
- Add AI capabilities to applications through standardized interfaces
- Integrate with Microsoft.Extensions.AI or Semantic Kernel without vendor lock-in
FAQ from MCPSharp
What are the runtime dependencies for MCPSharp?
MCPSharp requires any version of .NET that supports .NET Standard 2.0.
How do I define a tool in MCPSharp?
Create a class and mark a method with the [McpTool] attribute, optionally providing a name and description. Use [McpParameter] to specify parameter metadata.
Can I use MCPSharp with Semantic Kernel?
Yes. Mark methods with [KernelFunction] and [Description], then register the class with MCPServer.Register<T>(). The server will expose those methods as MCP tools.
How does MCPSharp integrate with Microsoft.Extensions.AI?
On the client side, call client.GetFunctionsAsync() to obtain a list of AIFunction objects that can be plugged into ChatOptions.Tools for any IChatClient implementation.
Are there any migration notes from previous versions?
Yes. The [McpFunction] attribute is deprecated and replaced with [McpTool]. Also, use MCPServer.Register<T>() instead of the deprecated MCPServer.RegisterTool<T>().
Frequently asked questions
What are the runtime dependencies for MCPSharp?
MCPSharp requires any version of .NET that supports .NET Standard 2.0.
How do I define a tool in MCPSharp?
Create a class and mark a method with the `[McpTool]` attribute, optionally providing a name and description. Use `[McpParameter]` to specify parameter metadata.
Can I use MCPSharp with Semantic Kernel?
Yes. Mark methods with `[KernelFunction]` and `[Description]`, then register the class with `MCPServer.Register<T>()`. The server will expose those methods as MCP tools.
How does MCPSharp integrate with Microsoft.Extensions.AI?
On the client side, call `client.GetFunctionsAsync()` to obtain a list of `AIFunction` objects that can be plugged into `ChatOptions.Tools` for any `IChatClient` implementation.
Are there any migration notes from previous versions?
Yes. The `[McpFunction]` attribute is deprecated and replaced with `[McpTool]`. Also, use `MCPServer.Register<T>()` instead of the deprecated `MCPServer.RegisterTool<T>()`.
Basic information
More Developer Tools MCP servers
MCP Containers
metorialConnect any AI model to 1200+ integrations (MCP, CLI, API)
Serena
oraiosA powerful MCP toolkit for coding, providing semantic retrieval and editing capabilities - the IDE for your agent

Moxie Docs
Jackalope-DevAutomated codebase documentation for GitHub: searchable docs, MCP context for AI agents, doc drift detection, and Friday Cleanup PRs.
TalkToFigma
sonnylazuardiTalkToFigma: MCP integration between AI Agent (Cursor, Claude Code, Codex) and Figma, allowing Agentic AI to communicate with Figma for reading designs and modifying them programmatically.
TranscriptFetch MCP Server
TranscriptFetchModel Context Protocol (MCP) server for TranscriptFetch: fetch YouTube transcripts, search, channels, and playlists from any MCP client.
Comments