独立运营 · 不出售排名位置  · 我们怎么评估工具 →
Anclum 提交收录
A

afrise/MCPSharp

.NET library for building MCP servers and clients

装之前:没有可直接复制的命令 · 许可证未标注 · 站点拦截自动检测

第一步:这条暂时没有可执行的下一步,可先看原仓库 https://github.com/afrise/MCPSharp

在 GitHub 查看 ↗链接已于 2026-11-12 核查 · 自动访问被拒(HTTP 429),状态未能确认

我们没有从该仓库取到可核对的安装命令,也没有公开的远端端点。这两样都没有时,我们不出配置——编一条出来比不给更糟。 各客户端的接法 →

来源明细
收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
收录与活跃
收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 10 个来源列出
评分构成
综合分 1,003 · 10 个来源 · mcp
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。

# MCPSharp

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

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. With MCPSharp, you can:
Create MCP-compliant tools and functions that AI models can discover and use
Connect directly to existing MCP servers from C# code with an easy to use client
Expose your .NET methods as MCP endpoints with simple attributes
Handle MCP protocol details and JSON-RPC communication seamlessly
## 🚀 What's New in MCPSharp
Microsoft.Extensions.AI Integration: MCPSharp now integrates with Microsoft.Extensions.AI, allowing tools to be exposed as AIFunctions
Semantic Kernel Support: Add tools using Semantic Kernel's KernelFunctionAttribute
Dynamic Tool Registration: Register tools on-the-fly with custom implementation logic
Tool Change Notifications: Server now notifies clients when tools are added, updated, or removed
Complex Object Parameter Support: Better handling of complex objects in tool parameters
Better Error Handling: Improved error handling with detailed stack traces
## When to Use MCPSharp
Use MCPSharp when you want to:
Create tools that AI assistants like Anthropic's Claude Desktop can use
Build MCP-compliant APIs without dealing with the protocol details
Expose existing .NET code as MCP endpoints
Add AI capabilities to your applications through standardized interfaces
Integrate with Microsoft.Extensions.AI and/or Semantic Kernel without locking into a single vendor
## Features
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
Near zero configuration required for basic usage
## Prerequisites
Any version of .NET that supports standard 2.0
## Installation
bash
dotnet add package MCPSharp
## Quick Start
### 1. Define a Tool
Create a class and mark your method(s) with the [McpTool] attribute:
csharp
using MCPSharp;
public class Calculator
[McpTool("add", "Adds two numbers")] // Note: [McpFunction] is deprecated, use [McpTool] instead
public static int Add([McpParameter(true)] int a, [McpParameter(true)] int b)
return a + b;
### 2. Start the Server
csharp
await MCPServer.StartAsync("CalculatorServer", "1.0.0");
The StartAsync() method will automatically find any methods in the base assembly that are marked with the McpTool attribute. In order to add any methods that are in a referenced library, you can manually register them by calling MCPServer.Register (); with T being the class containing the desired methods. If your methods are marked with Semantic Kernel attributes, this will work as well. If the client supports list changed notifications, it will be notified when additional tools are registered.
## Advanced Usage
### Dynamic Tool Registration
Register tools dynamically with custom implementation:
csharp
MCPServer.AddToolHandler(new Tool()
Name = "dynamicTool",
Description = "A dynamic tool",
InputSchema = new InputSchema {
Type = "object",
Required = ["input"],
Properties = new Dictionary {
{"input", new ParameterSchema{Type="string", Description="Input value"}}
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[![Listed on Anclum](https://anclum.com/badge/listed.svg)](https://anclum.com/zh/s/afrise-mcpsharp/)
来源
awesome · https://github.com/afrise/MCPSharp
按领域浏览
MCP 服务
收录来源
10 个独立来源
收录于
今天

同类推荐

全部 6,229 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引