$git clone https://github.com/modelcontextprotocol/csharp-sdkThe 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 the [API documentation](https://csharp.sdk.modelcontextprotocol.io/api/
| 1 | # MCP C# SDK |
| 2 | |
| 3 | [](https://www.nuget.org/packages/ModelContextProtocol) |
| 4 | |
| 5 | The official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit the [API documentation](https://csharp.sdk.modelcontextprotocol.io/api/ModelContextProtocol.html) for more details on available functionality. |
| 6 | |
| 7 | ## Packages |
| 8 | |
| 9 | The SDK packages are: |
| 10 | |
| 11 | - **[ModelContextProtocol.Core](https://www.nuget.org/packages/ModelContextProtocol.Core)** [](https://www.nuget.org/packages/ModelContextProtocol.Core) - For projects that only need to use the client or low-level server APIs and want the minimum number of dependencies. |
| 12 | |
| 13 | - **[ModelContextProtocol](https://www.nuget.org/packages/ModelContextProtocol)** [](https://www.nuget.org/packages/ModelContextProtocol) - The main package with hosting and dependency injection extensions. References `ModelContextProtocol.Core`. This is the right fit for most projects that don't need HTTP server capabilities. |
| 14 | |
| 15 | - **[ModelContextProtocol.AspNetCore](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore)** [](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore) - The library for HTTP-based MCP servers. References `ModelContextProtocol`. |
| 16 | |
| 17 | - **[ModelContextProtocol.Extensions.Apps](https://www.nuget.org/packages/ModelContextProtocol.Extensions.Apps)** [](https://www.nuget.org/packages/ModelContextProtocol.Extensions.Apps) - MCP Apps extension for building interactive UI applications that render inside MCP hosts. |
| 18 | |
| 19 | - **[ModelContextProtocol.Extensions.Tasks](https://www.nuget.org/packages/ModelContextProtocol.Extensions.Tasks)** [](https://www.nuget.org/packages/ModelContextProtocol.Extensions.Tasks) - MCP Tasks extension for running long-running tool invocations asynchronously with status polling and input requests. |
| 20 | |
| 21 | ## Getting Started |
| 22 | |
| 23 | To get started, see the [Getting Started](https://csharp.sdk.modelcontextprotocol.io/concepts/getting-started.html) guide in the conceptual documentation for installation instructions, package-selection guidance, and complete examples for both clients and servers. |
| 24 | |
| 25 | You can also browse the [samples](samples) directory and the [API documentation](https://csharp.sdk.modelcontextprotocol.io/api/ModelContextProtocol.html) for more details on available functionality. |
| 26 | |
| 27 | ## About MCP |
| 28 | |
| 29 | 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. |
| 30 | |
| 31 | For more information about MCP: |
| 32 | |
| 33 | - [Official MCP Documentation](https://modelcontextprotocol.io/) |
| 34 | - [MCP C# SDK Documentation](https://csharp.sdk.modelcontextprotocol.io/) |
| 35 | - [Protocol Specification](https://modelcontextprotocol.io/specification/) |
| 36 | - [GitHub Organization](https://github.com/modelcontextprotocol) |
| 37 | |
| 38 | ## Cross-Application Access (Identity Assertion Authorization Grant flow) |
| 39 | |
| 40 | The SDK provides support for the [Identity Assertion Authorization Grant flow](https://github.com/modelcontextprotocol/ext-auth/blob/main/specification/draft/enterprise-managed-authorization.mdx) |
| 41 | via `IdentityAssertionGrantProvider`. See the [Cross-Application Access](docs/concepts/transports/transports.md#cross-application-access) section in the transport docs for full usage details. |
| 42 | |
| 43 | ## License |
| 44 | |
| 45 | This project is licensed under the [Apache License 2.0](LICENSE). |