McpSdk.Adapter.System.Net.Http 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package McpSdk.Adapter.System.Net.Http --version 1.0.0
                    
NuGet\Install-Package McpSdk.Adapter.System.Net.Http -Version 1.0.0
                    
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="McpSdk.Adapter.System.Net.Http" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="McpSdk.Adapter.System.Net.Http" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="McpSdk.Adapter.System.Net.Http" />
                    
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 McpSdk.Adapter.System.Net.Http --version 1.0.0
                    
#r "nuget: McpSdk.Adapter.System.Net.Http, 1.0.0"
                    
#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 McpSdk.Adapter.System.Net.Http@1.0.0
                    
#: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=McpSdk.Adapter.System.Net.Http&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=McpSdk.Adapter.System.Net.Http&version=1.0.0
                    
Install as a Cake Tool

McpSdk

McpSdk.Server McpSdk.Client CI License: MIT

A lean, zero-dependency C# SDK for the Model Context Protocol. It implements the 2025-11-25 revision and negotiates down to older peers (2025-06-18, 2025-03-26, 2024-11-05). Both client and server ship from this repo, over stdio or Streamable HTTP.

Capability & feature matrix

Reflects what the code actually serves as of the 2025-11-25 revision. ✅ supported · ❌ not implemented (by deliberate scope choice).

Protocol & transport

Area Support
Protocol revision 2025-11-25 (latest), negotiated per-handshake
Back-compat (negotiated) 2025-06-18, 2025-03-26, 2024-11-05
stdio transport ✅ client + server
Streamable HTTP transport ✅ client + server — single endpoint, Mcp-Session-Id, Origin403, MCP-Protocol-Version header, server→client SSE stream, Last-Event-ID resumption, DELETE lifecycle
OAuth 2.1 authorization ❌ out of scope (fine for stdio / trusted-network; a public HTTP server normally needs it)

Server — methods served

Capability Methods Enable with
Base protocol initialize, ping always on
Tools tools/list, tools/call WithToolsCapability / WithDefaultToolsCapability
Prompts prompts/list, prompts/get WithPromptsCapability
Resources resources/list, resources/read, resources/templates/list WithResourcesCapability
Resource subscriptions resources/subscribe, resources/unsubscribe WithResourcesCapability (when subscribe is supported)
Completion completion/complete WithCompletionCapability
Logging logging/setLevel WithLoggingCapability

Server-emitted notifications: notifications/message, notifications/progress, notifications/cancelled, notifications/tools/list_changed, notifications/prompts/list_changed, notifications/resources/list_changed, notifications/resources/updated.

Client — server→client requests handled

Capability Methods handled Enable with
Base protocol ping; any unknown method → MethodNotFound always on
Roots roots/list WithRootsCapability
Sampling sampling/createMessage (incl. tools + toolChoice) WithSamplingCapability
Elicitation elicitation/create (form + URL modes) WithElicitationCapability

The client surfaces inbound notifications/message as LogMessageReceived and notifications/progress as ProgressReceived.

Tools & content features

Feature Support
Tool inputSchema / outputSchema (JSON Schema 2020-12 default dialect)
Structured tool output (structuredContent, mirrored to a text block for back-compat)
Tool title, annotations, icons, _meta
Validation failures returned as tool errors (isError), not protocol errors
Cursor-based pagination on every list op
Content types text, image, audio, embedded resource, resource_link, tool_use, tool_result — plus verbatim passthrough of unmodeled types
Elicitation schemas primitives with defaults; EnumSchema (titled/untitled × single/multi-select)
Sampling model preferences, tool-calling (tools + toolChoice), single-or-array content
Base-protocol utilities ping, cancellation (notifications/cancelled), progress (progressToken), _meta passthrough
Implementation metadata name, version, title, description

Examples

Client Example

using McpSdk.Adapter.Newtonsoft.Json;
using McpSdk.Client;
using McpSdk.Protocol;

var json = new NewtonsoftJson();
var rootsCapabilityFactory = new RootsCapabilityFactory(json);
var samplingCapabilityFactory = new SamplingCapabilityFactory(json);

var client = new ClientBuilder(json)
    .WithName("Echo Client")
    .WithVersion("1.0.0")
    .WithStdioTransport("bun", ["index.ts"])
    .WithRootsCapability(rootsCapabilityFactory)
    .WithSamplingCapability(samplingCapabilityFactory)
    .Build();

await client.Connect();

Server Example

using McpSdk.Adapter.ConsoleLogger;
using McpSdk.Adapter.Newtonsoft.Json;
using McpSdk.Server;
using McpSdk.Server.Tests;

var json = new NewtonsoftJson();
var mcpServer = new ServerBuilder()
    .WithName("Demo Server")
    .WithVersion("1.0.0")
    .WithConsoleLogger()
    .WithStdioTransport(json)
    .WithDefaultToolsCapability(json, tools =>
    {
        tools.AddTool(new TestTool());
    })
    .Build();

await mcpServer.Start();

Streamable HTTP (2025-11-25)

A single MCP endpoint over HTTP. The listener issues an Mcp-Session-Id on initialize and serves one McpServer per session; subsequent requests carry that id and the MCP-Protocol-Version header. Disallowed Origins are rejected with 403, and the server→client GET stream supports Last-Event-ID resumption.

// Server
using McpSdk.Adapter.ConsoleLogger;
using McpSdk.Adapter.Newtonsoft.Json;
using McpSdk.Adapter.StreamableHttpServer;
using McpSdk.Server;

var json = new NewtonsoftJson();
var loggerFactory = new ServerConsoleLoggerFactory();
var listener = new StreamableHttpListener(
    "http://localhost:3000", "/mcp", json, loggerFactory,
    onSession: async transport =>
    {
        var server = new ServerBuilder()
            .WithName("Demo Server")
            .WithVersion("1.0.0")
            .WithLogger(loggerFactory)
            .WithStreamableHttpTransport(transport)
            .WithDefaultToolsCapability(json, tools => tools.AddTool(new TestTool()))
            .Build();
        await server.Start();
    });

await listener.Start();
// Client
using McpSdk.Adapter.ConsoleLogger;
using McpSdk.Adapter.Newtonsoft.Json;
using McpSdk.Adapter.System.Net.Http;
using McpSdk.Client;

var json = new NewtonsoftJson();
var loggerFactory = new ClientConsoleLoggerFactory();
var http = new StreamableHttpClientAdapter("http://localhost:3000/mcp", loggerFactory);

var client = new ClientBuilder()
    .WithName("Echo Client")
    .WithVersion("1.0.0")
    .WithLogger(loggerFactory)
    .WithStreamableHttpTransport(json, http)
    .Build();

await client.Connect();

License

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 107 8/14/2026
1.1.0 92 8/14/2026
1.0.3 122 6/29/2026
1.0.2 105 6/29/2026
1.0.0 130 6/29/2026