DotNetCampus.ModelContextProtocol 0.1.0-alpha.38

This is a prerelease version of DotNetCampus.ModelContextProtocol.
dotnet add package DotNetCampus.ModelContextProtocol --version 0.1.0-alpha.38
                    
NuGet\Install-Package DotNetCampus.ModelContextProtocol -Version 0.1.0-alpha.38
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetCampus.ModelContextProtocol" Version="0.1.0-alpha.38" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetCampus.ModelContextProtocol" Version="0.1.0-alpha.38" />
                    
Directory.Packages.props
<PackageReference Include="DotNetCampus.ModelContextProtocol" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetCampus.ModelContextProtocol --version 0.1.0-alpha.38
                    
#r "nuget: DotNetCampus.ModelContextProtocol, 0.1.0-alpha.38"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotNetCampus.ModelContextProtocol@0.1.0-alpha.38
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetCampus.ModelContextProtocol&version=0.1.0-alpha.38&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetCampus.ModelContextProtocol&version=0.1.0-alpha.38&prerelease
                    
Install as a Cake Tool

DotNetCampus.ModelContextProtocol

.NET Build and Test NuGet NuGet NuGet

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed