ModelContextProtocol.AspNetCore
0.1.0-preview.10
Prefix Reserved
dotnet add package ModelContextProtocol.AspNetCore --version 0.1.0-preview.10
NuGet\Install-Package ModelContextProtocol.AspNetCore -Version 0.1.0-preview.10
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="0.1.0-preview.10" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.1.0-preview.10" />
<PackageReference Include="ModelContextProtocol.AspNetCore" />
paket add ModelContextProtocol.AspNetCore --version 0.1.0-preview.10
#r "nuget: ModelContextProtocol.AspNetCore, 0.1.0-preview.10"
#addin nuget:?package=ModelContextProtocol.AspNetCore&version=0.1.0-preview.10&prerelease
#tool nuget:?package=ModelContextProtocol.AspNetCore&version=0.1.0-preview.10&prerelease
ASP.NET Core extensions for the MCP C# SDK
The official C# SDK for the Model Context Protocol, enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit our API documentation for more details on available functionality.
[!NOTE] This project is in preview; breaking changes can be introduced without prior notice.
About MCP
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools.
For more information about MCP:
Installation
To get started, install the package from NuGet
dotnet new web
dotnet add package ModelContextProtocol.AspNetCore --prerelease
Getting Started
// Program.cs
using ModelContextProtocol.Server;
using System.ComponentModel;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithToolsFromAssembly();
var app = builder.Build();
app.MapMcp();
app.Run("http://localhost:3001");
[McpServerToolType]
public static class EchoTool
{
[McpServerTool, Description("Echoes the message back to the client.")]
public static string Echo(string message) => $"hello {message}";
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 is compatible. 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. |
-
net8.0
- ModelContextProtocol (>= 0.1.0-preview.10)
-
net9.0
- ModelContextProtocol (>= 0.1.0-preview.10)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ModelContextProtocol.AspNetCore:
Package | Downloads |
---|---|
ModelContextProtocolServer.Sse
Common framework for building a Sse MCP server. |
|
Senparc.Xncf.MCP
Model Context Protocol(MCP) Manager |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.0-preview.10 | 210 | 4/19/2025 |
0.1.0-preview.9 | 1,843 | 4/15/2025 |
0.1.0-preview.8 | 1,815 | 4/11/2025 |
0.1.0-preview.7 | 790 | 4/9/2025 |
0.1.0-preview.6 | 1,410 | 4/4/2025 |
0.1.0-preview.5 | 809 | 4/3/2025 |
0.1.0-preview.4 | 888 | 3/31/2025 |