csharp-sdk/src/ModelContextProtocol.AspNetCore
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Copilot dbf91bcb1a
Change ProtectedResourceMetadata URI properties to strings and build resource strings directly (#1264)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-02-12 22:28:43 -05:00
..
Authentication Change ProtectedResourceMetadata URI properties to strings and build resource strings directly (#1264) 2026-02-12 22:28:43 -05:00
AuthorizationFilterSetup.cs Add net10.0 assets and run some fixers (#875) 2025-10-15 15:27:43 -04:00
HttpMcpServerBuilderExtensions.cs Docs edit pass (MCP.AspNetCore and a few other files) (#1034) 2025-11-26 08:36:33 -05:00
HttpServerTransportOptions.cs Add 2025-11-25 as supported version (#1130) 2026-01-15 09:59:42 -05:00
IdleTrackingBackgroundService.cs Move options validation to constructor (#826) 2025-10-02 12:38:13 -07:00
McpEndpointRouteBuilderExtensions.cs Add 2025-11-25 as supported version (#1130) 2026-01-15 09:59:42 -05:00
ModelContextProtocol.AspNetCore.csproj Add net10.0 assets and run some fixers (#875) 2025-10-15 15:27:43 -04:00
README.md Address additional feedback on Versioning doc (#999) 2025-11-20 21:59:28 -05:00
SseEventStreamReaderExtensions.cs Streamable HTTP resumability + redelivery + SSE polling via server-side disconnect (#1077) 2026-01-14 22:54:25 -08:00
SseHandler.cs Restructure IMcpEndpoint, IMcpClient, and IMcpServer (#723) 2025-09-16 10:22:10 -07:00
StatefulSessionManager.cs Fix session timeout due to timestamp frequency mismatch and activity tracking (#1106) 2025-12-15 16:21:21 -05:00
StreamableHttpHandler.cs Add ILoggerFactory to StreamableHttpServerTransport (#1213) 2026-01-30 17:45:39 -05:00
StreamableHttpSession.cs Fix session timeout due to timestamp frequency mismatch and activity tracking (#1106) 2025-12-15 16:21:21 -05:00
UserIdClaim.cs Prune idle sessions before starting new ones (#701) 2025-08-18 11:04:27 -07:00

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}";
}