Skip to main content
toolsSource-backedReview first Safety Privacy

Official MCP C# SDK

Official C# SDK for Model Context Protocol servers and clients, maintained by the MCP project in collaboration with Microsoft, with NuGet packages for core MCP APIs, hosting and dependency injection extensions, ASP.NET Core HTTP servers, samples, API documentation, and cross-application access support.

by Model Context Protocol·added 2026-06-18·
HarnessCLI
Review first review before installing

Open the source and read safety notes before installing.

Safety notes

  • The official C# SDK is a protocol library; production risk comes from the MCP tools, resources, prompts, transports, and identity flows you implement with it.
  • Treat every MCP tool handler as an API endpoint: validate arguments, enforce permissions, bound side effects, and sanitize errors.
  • HTTP MCP servers need normal web-service controls, including authentication, TLS, request limits, logging policy, and abuse protections.
  • Cross-application access and identity assertion flows are security-sensitive and should be tested against the current MCP specification and enterprise policy.

Privacy notes

  • MCP clients and servers built with the SDK may expose tool arguments, tool results, resource contents, prompt templates, user identity assertions, errors, traces, and logs.
  • Avoid leaking private resources, customer data, internal identifiers, tokens, privileged paths, or operational metadata in schemas, responses, examples, and logs.
  • Document which MCP client, server, model provider, transport, and logging system can observe each request before production use.

Prerequisites

  • .NET project compatible with the SDK package targets and your chosen MCP transport.
  • A package choice: `ModelContextProtocol.Core`, `ModelContextProtocol`, or `ModelContextProtocol.AspNetCore`.
  • Authentication, authorization, and transport-security requirements for any HTTP-accessible MCP server.
  • Reviewed tool, resource, prompt, and identity-flow behavior before deploying beyond local development.

Schema details

Install type
cli
Troubleshooting
No
Source repository stats
Scope
Source repo
Collection metadata
Estimated setup
15 minutes
Difficulty
intermediate
Tool listing metadata
Pricing
free
Disclosure
editorial
Application category
DeveloperApplication
Operating system
Cross-platform
Full copyable content
dotnet add package ModelContextProtocol

About this resource

Overview

The official MCP C# SDK is the Model Context Protocol project's .NET implementation for building MCP clients and servers. The repository is maintained under the modelcontextprotocol organization in collaboration with Microsoft and publishes NuGet packages for core protocol APIs, hosting and dependency injection extensions, and ASP.NET Core HTTP server integrations.

This entry covers the official SDK. It is distinct from community MCP libraries and from individual MCP servers that happen to be written in C#.

Package Options

Package Best Fit
ModelContextProtocol.Core Client or low-level server APIs with fewer dependencies
ModelContextProtocol Main package for most client, stdio server, hosting, and dependency injection usage
ModelContextProtocol.AspNetCore HTTP-based MCP servers on ASP.NET Core

Quick Start

Install the main package:

dotnet add package ModelContextProtocol

For an HTTP MCP server, install the ASP.NET Core package instead:

dotnet add package ModelContextProtocol.AspNetCore

The upstream documentation includes conceptual getting-started material, package-selection guidance, samples, and generated API documentation for the current package surface.

MCP Fit

Choose the official C# SDK when a .NET application, worker service, ASP.NET Core app, internal platform, or enterprise integration needs first-party MCP protocol types and package guidance. It is especially relevant for teams that already standardize on .NET hosting, dependency injection, NuGet packaging, and ASP.NET Core operations.

Because the SDK provides protocol building blocks, safe production behavior still depends on the application you build around it. Treat MCP tools as model-callable APIs and resources as model-visible data surfaces.

Use Cases

  • Add an MCP server to a .NET service, CLI, worker, or desktop integration.
  • Build an MCP client in C# for testing or internal automation.
  • Expose an HTTP-based MCP server with ASP.NET Core.
  • Integrate MCP server registration with .NET hosting and dependency injection.
  • Review sample MCP clients and servers before designing a production surface.
  • Evaluate cross-application access and identity assertion support in .NET.

Source Review

Verified on 2026-06-18:

  • The upstream README identifies modelcontextprotocol/csharp-sdk as the official C# SDK for Model Context Protocol clients and servers.
  • The README states that the SDK is maintained in collaboration with Microsoft.
  • The README documents the three main NuGet packages: ModelContextProtocol.Core, ModelContextProtocol, and ModelContextProtocol.AspNetCore.
  • NuGet resolves the ModelContextProtocol package and lists current versions.
  • The documentation site resolves at csharp.sdk.modelcontextprotocol.io.
  • The README and license file document Apache License 2.0 licensing for the project.

Safety and Privacy

The SDK does not decide which local files, services, identities, resources, or side effects your MCP server exposes. Keep schemas narrow, require authorization for sensitive actions, and avoid returning private data in error messages or debug logs.

HTTP and identity-enabled deployments should be reviewed like any other production API. Add authentication, transport security, request limits, audit logging, and clear retention rules before exposing a server outside localhost.

Duplicate Check

Checked current content/mcp/, content/tools/, content/skills/, open pull requests, and repository-wide content for modelcontextprotocol/csharp-sdk, official MCP C# SDK, Model Context Protocol C# SDK, ModelContextProtocol NuGet, .NET MCP server SDK, ASP.NET Core MCP server, and MCP C# examples. No dedicated official C# SDK entry, exact source URL duplicate, target file, or open duplicate PR was found.

Source citations

Add this badge to your README

Show that Official MCP C# SDK is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/tools/official-mcp-csharp-sdk.svg)](https://heyclau.de/entry/tools/official-mcp-csharp-sdk)

How it compares

Official MCP C# SDK side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

FieldOfficial MCP C# SDK

Official C# SDK for Model Context Protocol servers and clients, maintained by the MCP project in collaboration with Microsoft, with NuGet packages for core MCP APIs, hosting and dependency injection extensions, ASP.NET Core HTTP servers, samples, API documentation, and cross-application access support.

Open dossier
Official MCP Go SDK

Official Go SDK for Model Context Protocol servers and clients, maintained by the MCP project in collaboration with Google, with packages for MCP, JSON-RPC, OAuth primitives, OAuth protected-resource metadata, clients, servers, transports, examples, and conformance work.

Open dossier
Official MCP Java SDK

Official Java SDK for Model Context Protocol clients and servers, maintained in collaboration with Spring AI, with Java 17+ support, Maven artifacts, synchronous and asynchronous APIs, Reactive Streams, Project Reactor, JDK HttpClient, Servlet transport, JSON binding modules, and conformance tests.

Open dossier
Official MCP TypeScript SDK

Official TypeScript SDK for Model Context Protocol clients and servers, with the production v1 `@modelcontextprotocol/sdk` package, active v2 server and client package work, Node.js, Bun, and Deno support, transports, OAuth helpers, tools, resources, prompts, examples, and API documentation.

Open dossier
Trust
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Categorytoolstoolstoolstools
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorModel Context ProtocolModel Context ProtocolModel Context ProtocolModel Context Protocol
Added2026-06-182026-06-182026-06-182026-06-18
Platforms
CLI
CLI
CLI
CLI
Source repo
Safety notesThe official C# SDK is a protocol library; production risk comes from the MCP tools, resources, prompts, transports, and identity flows you implement with it. Treat every MCP tool handler as an API endpoint: validate arguments, enforce permissions, bound side effects, and sanitize errors. HTTP MCP servers need normal web-service controls, including authentication, TLS, request limits, logging policy, and abuse protections. Cross-application access and identity assertion flows are security-sensitive and should be tested against the current MCP specification and enterprise policy.The official Go SDK is a protocol library; the risk is in the MCP clients, servers, tools, resources, prompts, and transports you build with it. Validate inputs, enforce capability checks, and bound side effects for every tool handler. Use local transports for local-only integrations, and add authentication, TLS, authorization, logging, and rate limits before exposing network transports. OAuth and protected-resource metadata are security-sensitive surfaces; test them against the current MCP specification and client expectations.The official Java SDK is a protocol library; production risk comes from your MCP tools, resources, prompts, transports, authorization hooks, and framework integration. Validate tool inputs, enforce caller permissions, bound side effects, and avoid returning raw Java exceptions or internal stack details to MCP clients. Servlet, Spring, and remote transport deployments need authentication, TLS, request limits, observability policy, cancellation behavior, and abuse protection. Spring AI MCP security and annotation support may simplify integration, but application owners still need to review authorization, tenant boundaries, and data retention.The official TypeScript SDK is a protocol library; your MCP server's tool handlers, resources, prompts, transports, and auth logic determine the real risk. Treat every registered tool as a model-callable API endpoint and validate inputs, enforce permissions, bound side effects, and sanitize failures. HTTP and framework middleware deployments need host validation, authentication, TLS, request limits, logging policy, and abuse controls. The upstream main branch documents v2 pre-alpha work; use the production v1 package for stable deployments unless you intentionally accept alpha API churn.
Privacy notesMCP clients and servers built with the SDK may expose tool arguments, tool results, resource contents, prompt templates, user identity assertions, errors, traces, and logs. Avoid leaking private resources, customer data, internal identifiers, tokens, privileged paths, or operational metadata in schemas, responses, examples, and logs. Document which MCP client, server, model provider, transport, and logging system can observe each request before production use.MCP clients and servers built with the SDK may expose request metadata, tool arguments, tool results, resource contents, prompt templates, OAuth state, errors, traces, and logs. Do not leak private resource contents, customer data, internal identifiers, tokens, privileged paths, or operational metadata in schemas, error messages, examples, or logs. Document which model provider, client, server, and transport can observe each request before deploying outside localhost.Java MCP clients and servers may expose tool arguments, tool results, resource contents, prompt templates, request metadata, correlation IDs, logs, traces, and authorization context. Avoid leaking secrets, customer data, private resources, internal identifiers, stack traces, privileged paths, or token values through schemas, responses, errors, or logs. Document which MCP client, server process, Java framework, model provider, transport, and observability system can observe each request.MCP clients and servers built with the SDK may expose tool arguments, tool results, resource contents, prompt templates, OAuth state, errors, traces, and logs. Avoid returning secrets, private file contents, customer data, privileged paths, internal identifiers, or operational metadata through schemas, examples, errors, or logs. Document which MCP client, server, model provider, transport, middleware layer, and logging system can observe each request.
Prerequisites
  • .NET project compatible with the SDK package targets and your chosen MCP transport.
  • A package choice: `ModelContextProtocol.Core`, `ModelContextProtocol`, or `ModelContextProtocol.AspNetCore`.
  • Authentication, authorization, and transport-security requirements for any HTTP-accessible MCP server.
  • Reviewed tool, resource, prompt, and identity-flow behavior before deploying beyond local development.
  • Go toolchain compatible with the SDK's current `go.mod` requirement and Go support policy.
  • A target MCP spec version and compatibility plan for the clients or servers you need to support.
  • Authentication, authorization, and transport-security requirements for non-local MCP deployments.
  • Reviewed tool, resource, prompt, and OAuth behavior before exposing production services.
  • Java 17 or newer and a Maven or Gradle build configured for the selected SDK artifact version.
  • A choice of core Java SDK usage, Spring AI MCP integration, or both.
  • A target transport, such as stdio, JDK HttpClient, Servlet, WebFlux, WebMVC, or another framework path.
  • Authentication, authorization, and data-exposure requirements for production clients and servers.
  • Node.js, Bun, or Deno runtime compatible with the SDK generation you choose.
  • A decision between production v1 package usage and the upstream v2 alpha split-package track.
  • A target MCP transport, such as stdio for local tools or Streamable HTTP for hosted servers.
  • Authentication, authorization, and side-effect boundaries for any production MCP server.
Install
dotnet add package ModelContextProtocol
go get github.com/modelcontextprotocol/go-sdk
mvn dependency:get -Dartifact=io.modelcontextprotocol.sdk:mcp:2.0.0
npm install @modelcontextprotocol/sdk
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.