- C# 99.8%
- JavaScript 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Remove _getHttpResponseCompleted and rely on _httpSseWriter being null as the signal that the GET response stream has been released. Null out _httpSseWriter in DisposeAsync so SendMessageAsync correctly skips writing post-dispose. - Replace the dispose-idempotency role of the old flag with a dedicated _disposed bool. - Move the explanatory comment in SendMessageAsync onto the event store branch (which intentionally still runs when the response stream is gone, to support Last-Event-ID replay). - Rewrite the unit test to assert observable behavior via a recording Stream instead of reflecting on private fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
| .config | ||
| .devcontainer | ||
| .github | ||
| docs | ||
| samples | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| CONTRIBUTING.md | ||
| Directory.Build.props | ||
| Directory.Packages.props | ||
| global.json | ||
| LICENSE | ||
| logo.png | ||
| Makefile | ||
| ModelContextProtocol.slnx | ||
| nuget.config | ||
| Open.snk | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| SECURITY.md | ||
| THIRD-PARTY-NOTICES.txt | ||
MCP C# SDK
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 the API documentation for more details on available functionality.
Packages
This SDK consists of three main packages:
-
ModelContextProtocol.Core
- For projects that only need to use the client or low-level server APIs and want the minimum number of dependencies.
-
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. -
ModelContextProtocol.AspNetCore
- The library for HTTP-based MCP servers. References
ModelContextProtocol.
Getting Started
To get started, see the Getting Started guide in the conceptual documentation for installation instructions, package-selection guidance, and complete examples for both clients and servers.
You can also browse the samples directory and the API documentation for more details on available functionality.
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:
Cross-Application Access (Identity Assertion Authorization Grant flow)
The SDK provides support for the Identity Assertion Authorization Grant flow
via IdentityAssertionGrantProvider. See the Cross-Application Access section in the transport docs for full usage details.
License
This project is licensed under the Apache License 2.0.