Release v2.0.0 (#1758)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a8fe8421-1ce4-4a57-b4c4-3ada2d8ac67c
This commit is contained in:
parent
e8b80f0e6d
commit
15f8b2da11
5 changed files with 26 additions and 16 deletions
12
README.md
12
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
# MCP C# SDK
|
# MCP C# SDK
|
||||||
|
|
||||||
[](https://www.nuget.org/packages/ModelContextProtocol)
|
[](https://www.nuget.org/packages/ModelContextProtocol)
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
@ -8,15 +8,15 @@ The official C# SDK for the [Model Context Protocol](https://modelcontextprotoco
|
||||||
|
|
||||||
The SDK packages are:
|
The SDK packages are:
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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`.
|
- **[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`.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,16 @@ public static IEnumerable<ContentBlock> DescribeImage()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Structured content
|
||||||
|
|
||||||
|
Set `UseStructuredContent = true` on <xref:ModelContextProtocol.Server.McpServerToolAttribute> or
|
||||||
|
<xref:ModelContextProtocol.Server.McpServerToolCreateOptions> to advertise an output schema and
|
||||||
|
serialize the return value into <xref:ModelContextProtocol.Protocol.CallToolResult.StructuredContent>.
|
||||||
|
The output schema may be any JSON Schema 2020-12 document. Non-object return values are represented
|
||||||
|
directly, so a tool returning `72` produces `structuredContent: 72`, not
|
||||||
|
`structuredContent: { "result": 72 }`. Clients should read the value according to the advertised
|
||||||
|
output schema rather than assuming a `result` wrapper.
|
||||||
|
|
||||||
#### Content annotations
|
#### Content annotations
|
||||||
|
|
||||||
Any content block can include <xref:ModelContextProtocol.Protocol.Annotations> to provide hints about the intended audience and priority:
|
Any content block can include <xref:ModelContextProtocol.Protocol.Annotations> to provide hints about the intended audience and priority:
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Services.AddMcpServer()
|
builder.Services.AddMcpServer()
|
||||||
.WithHttpTransport(options =>
|
.WithHttpTransport(options =>
|
||||||
{
|
{
|
||||||
// SSE requires stateful mode (the default). Set explicitly for forward compatibility.
|
// SSE requires stateful mode; opt in explicitly because stateless mode is the default.
|
||||||
options.Stateless = false;
|
options.Stateless = false;
|
||||||
|
|
||||||
#pragma warning disable MCP9004 // EnableLegacySse is obsolete
|
#pragma warning disable MCP9004 // EnableLegacySse is obsolete
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<RepositoryUrl>https://github.com/modelcontextprotocol/csharp-sdk</RepositoryUrl>
|
<RepositoryUrl>https://github.com/modelcontextprotocol/csharp-sdk</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<VersionPrefix>2.0.0</VersionPrefix>
|
<VersionPrefix>2.0.0</VersionPrefix>
|
||||||
<VersionSuffix>rc.2</VersionSuffix>
|
<VersionSuffix></VersionSuffix>
|
||||||
<Authors>ModelContextProtocol</Authors>
|
<Authors>ModelContextProtocol</Authors>
|
||||||
<Copyright>© Model Context Protocol a Series of LF Projects, LLC.</Copyright>
|
<Copyright>© Model Context Protocol a Series of LF Projects, LLC.</Copyright>
|
||||||
<PackageTags>ModelContextProtocol;mcp;ai;llm</PackageTags>
|
<PackageTags>ModelContextProtocol;mcp;ai;llm</PackageTags>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<AssemblyOriginatorKeyFile>$(RepoRoot)\Open.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>$(RepoRoot)\Open.snk</AssemblyOriginatorKeyFile>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<EnablePackageValidation>true</EnablePackageValidation>
|
<EnablePackageValidation>true</EnablePackageValidation>
|
||||||
<PackageValidationBaselineVersion>1.3.0</PackageValidationBaselineVersion>
|
<PackageValidationBaselineVersion>1.4.1</PackageValidationBaselineVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
# MCP C# SDK
|
# MCP C# SDK
|
||||||
|
|
||||||
[](https://www.nuget.org/packages/ModelContextProtocol)
|
[](https://www.nuget.org/packages/ModelContextProtocol)
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
See the [release notes](https://github.com/modelcontextprotocol/csharp-sdk/releases/tag/v2.0.0-rc.2) for what's new in this version.
|
See the [release notes](https://github.com/modelcontextprotocol/csharp-sdk/releases/tag/v2.0.0) for what's new in this version.
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
The SDK packages are:
|
The SDK packages are:
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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`.
|
- **[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`.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
- **[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.
|
- **[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.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue