DotNetCampus.ModelContextProtocol
0.1.0-alpha.38
dotnet add package DotNetCampus.ModelContextProtocol --version 0.1.0-alpha.38
NuGet\Install-Package DotNetCampus.ModelContextProtocol -Version 0.1.0-alpha.38
<PackageReference Include="DotNetCampus.ModelContextProtocol" Version="0.1.0-alpha.38" />
<PackageVersion Include="DotNetCampus.ModelContextProtocol" Version="0.1.0-alpha.38" />
<PackageReference Include="DotNetCampus.ModelContextProtocol" />
paket add DotNetCampus.ModelContextProtocol --version 0.1.0-alpha.38
#r "nuget: DotNetCampus.ModelContextProtocol, 0.1.0-alpha.38"
#:package DotNetCampus.ModelContextProtocol@0.1.0-alpha.38
#addin nuget:?package=DotNetCampus.ModelContextProtocol&version=0.1.0-alpha.38&prerelease
#tool nuget:?package=DotNetCampus.ModelContextProtocol&version=0.1.0-alpha.38&prerelease
DotNetCampus.ModelContextProtocol
| English | 简体中文 | 繁體中文 |
|---|
A lightweight, zero-dependency yet full-featured MCP protocol implementation built with .NET. It can be easily integrated into your application, regardless of its architecture.
Features
- 🚀 Lightweight and high-performance
- 📦 Zero external dependencies
- 🔌 Easy to integrate
- 🎯 Full MCP protocol support
Getting Started
Installation
dotnet add package DotNetCampus.ModelContextProtocol
Quick Start
Server
var mcpServer = new McpServerBuilder("Sample Mcp Server", "1.0.0")
.WithTools(tools => tools.WithTool(() => new SampleTools()))
.WithLocalHostHttp(5943, "mcp")
.Build();
await mcpServer.RunAsync();
public class SampleTools
{
/// <summary>
/// 原样返回输入文本。
/// </summary>
/// <param name="text">要原样返回的字符串</param>
[McpServerTool(ReadOnly = true)]
public string EchoTool(string text)
{
return text;
}
}
Client
var client = new McpClientBuilder("Sample Mcp Client", "1.0.0")
.WithHttp("http://localhost:5943/mcp")
.Build();
var arguments = JsonSerializer.SerializeToElement(new { text = "Hello, MCP!" });
var result = await client.CallToolAsync("echo_tool", arguments);
Console.WriteLine(result.Content);
Documentation
See docs/en/README.md for the full documentation index.
Contributing
Contributions are welcome. Please feel free to submit a pull request.
License
This project is licensed under the MIT License. See LICENSE for details.
About dotnet-campus
dotnet-campus(.NET 职业技术学院)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net6.0
- System.Text.Json (>= 10.0.0)
-
net8.0
- System.Text.Json (>= 10.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DotNetCampus.ModelContextProtocol:
| Package | Downloads |
|---|---|
|
DotNetCampus.ModelContextProtocol.TouchSocket.Http
Extension package for DotNetCampus.ModelContextProtocol that provides an implementation of the MCP protocol using TouchSocket.Http as the transport layer. |
|
|
DotNetCampus.ModelContextProtocol.Ipc
Extension package for DotNetCampus.ModelContextProtocol that provides an implementation of the MCP protocol using dotnetCampus.Ipc as the transport layer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.38 | 56 | 5/15/2026 |
| 0.1.0-alpha.37 | 61 | 5/12/2026 |
| 0.1.0-alpha.36 | 56 | 5/12/2026 |
| 0.1.0-alpha.35 | 56 | 5/11/2026 |
| 0.1.0-alpha.34 | 51 | 5/11/2026 |
| 0.1.0-alpha.33 | 60 | 5/9/2026 |
| 0.1.0-alpha.32 | 62 | 5/9/2026 |
| 0.1.0-alpha.31 | 54 | 4/30/2026 |
| 0.1.0-alpha.30 | 58 | 4/27/2026 |
| 0.1.0-alpha.29 | 54 | 4/17/2026 |
| 0.1.0-alpha.28 | 58 | 4/10/2026 |
| 0.1.0-alpha.27 | 51 | 4/8/2026 |
| 0.1.0-alpha.26 | 54 | 4/8/2026 |
| 0.1.0-alpha.25 | 52 | 4/7/2026 |
| 0.1.0-alpha.24 | 75 | 3/30/2026 |
| 0.1.0-alpha.23 | 67 | 3/13/2026 |
| 0.1.0-alpha.22 | 61 | 3/5/2026 |
| 0.1.0-alpha.21 | 67 | 2/27/2026 |
| 0.1.0-alpha.20 | 63 | 2/9/2026 |
| 0.1.0-alpha.19 | 66 | 2/5/2026 |