ModelContextProtocol.AspNetCore 0.1.0-preview.10

Prefix Reserved
This is a prerelease version of ModelContextProtocol.AspNetCore.
dotnet add package ModelContextProtocol.AspNetCore --version 0.1.0-preview.10
                    
NuGet\Install-Package ModelContextProtocol.AspNetCore -Version 0.1.0-preview.10
                    
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="ModelContextProtocol.AspNetCore" Version="0.1.0-preview.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.1.0-preview.10" />
                    
Directory.Packages.props
<PackageReference Include="ModelContextProtocol.AspNetCore" />
                    
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 ModelContextProtocol.AspNetCore --version 0.1.0-preview.10
                    
#r "nuget: ModelContextProtocol.AspNetCore, 0.1.0-preview.10"
                    
#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.
#addin nuget:?package=ModelContextProtocol.AspNetCore&version=0.1.0-preview.10&prerelease
                    
Install ModelContextProtocol.AspNetCore as a Cake Addin
#tool nuget:?package=ModelContextProtocol.AspNetCore&version=0.1.0-preview.10&prerelease
                    
Install ModelContextProtocol.AspNetCore as a Cake Tool

ASP.NET Core extensions for the MCP C# SDK

NuGet preview version

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 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. 
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 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