McpEssentials.Core 1.0.0-preview.4

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

McpEssentials.Core

Authenticated MCP task stores and shared primitives for generic Model Context Protocol servers built on the C# SDK.

The SDK ships InMemoryMcpTaskStore, which is process-wide: any caller who knows a task id can get, update, or cancel it. InMemoryMcpTaskStorePlus is our own in-memory store. It records the user who created each task, isolates later manipulation to that user, and never wraps the SDK store.

Install

dotnet add package McpEssentials.Core

Usage

builder.Services.AddHttpContextAccessor();

builder.Services.AddMcpServer()
    .WithHttpTransport()
    .WithTools<MyTools>()
    .WithTasksPlus(
        sp => sp.GetRequiredService<IHttpContextAccessor>().HttpContext?.User,
        o => o.DefaultTimeToLive = TimeSpan.FromMinutes(5));

Local / stdio: .WithTasksPlus("local-user"). Tests: new InMemoryMcpTaskStorePlus("user-1") or store.CreateTaskAsync(principal).

HTTP hosts call AddHttpContextAccessor() and pass a factory that resolves IHttpContextAccessor from the built provider.

Form elicitation

var result = await server.ElicitAsync(
    FormElicitation.Create($"How should we query {entitySet}?")
        .String("filter").Title("$filter")
        .Integer("top").Title("$top").Min(1).Max(1000).Default(20),
    cancellationToken);

var typed = await server.ElicitAsync(
    FormElicitation.From<ProductQuery>("Query products").Exclude(x => x.Skip),
    cancellationToken);

Keep the builder and add a field per name when the shape comes from metadata. From<T>() seeds a CLR type. Both work inside an MCP task: the SDK interceptor parks the form on the task when the tool awaits ElicitAsync. To park yourself: store.SetInputRequestsAsync(taskId, form).

IMcpTaskStorePlus extends IMcpTaskStore with ClaimsPrincipal overloads. McpTaskStoreBase takes a current-user callback and wires InputResponseReceived. CreateTaskAsync stamps the current user (NameIdentifier → sub → UPN → Name). tasks/get, tasks/update, and tasks/cancel return "not found" for another user's task. Server-side completion (SetCompletedAsync / SetFailedAsync / SetInputRequestsAsync) uses the owner recorded at create, because those calls run on a background DI scope after the original request is gone.

Durable stores

Core is the in-memory, single-process store. McpEssentials.EntityFrameworkCore and McpEssentials.Redis are the durable providers in this repo. Other packages (PostgreSQL, Cosmos, …) subclass McpTaskStoreBase the same way. See Authenticated Task Stores.

Documentation

License

MIT © CloudNimble, Inc.

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.  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.  net11.0 is compatible. 
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 McpEssentials.Core:

Package Downloads
McpEssentials.EntityFrameworkCore

EF Core authenticated MCP task store. Persist per-user tasks on any EF Core database (SQL Server, SQLite, PostgreSQL, Cosmos via EF). Host owns migrations.

McpEssentials.Redis

Redis authenticated MCP task store. Native EXPIRE from DiscardAfter and pub/sub for multi-node elicitation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.4 44 10/29/2026
1.0.0-preview.3 48 10/28/2026
1.0.0-preview.2 42 10/27/2026
1.0.0-preview.1 46 10/27/2026