Skip to content

v0.5.0-preview.1

Pre-release
Pre-release

Choose a tag to compare

@jeffhandley jeffhandley released this 05 Dec 23:43
fd3a951

Breaking Changes

The 0.5.0-preview.1 release includes several categories of breaking changes as we continue to refine the API surface area for the path toward a 1.0.0 stable release. Refer to the C# SDK Versioning documentation for information regarding our versioning, breaking change, and support approaches.

  1. Add request options bag to high level requests and include Meta (#970)
    • High-level request methods refactored to use options bag. Methods CallToolAsync, GetPromptAsync, ListResourcesAsync, ReadResourceAsync, SubscribeResourceAsync, UnsubscribeResourceAsync, ListToolsAsync, ListPromptsAsync, and similar now accept a new RequestOptions parameter instead of individual JsonSerializerOptions and ProgressToken parameters.
    • Code that passes JsonSerializerOptions or ProgressToken as named or positional parameters to high-level request methods will break and must be updated to use the RequestOptions bag instead.
  2. Remove obsolete APIs from codebase (#985)
    • McpServerFactory class: Removed obsolete factory class for creating MCP servers.
    • McpClientFactory class: Removed obsolete factory class for creating MCP clients.
    • Obsolete interfaces removed: IMcpEndpoint, IMcpClient, IMcpServer
    • Extension methods and properties that were previously marked obsolete are no longer available.
    • LegacyTitledEnumSchema and EnumSchema remain in place as obsolete APIs, but they now use a custom diagnostic ID of MCP9001 instead of the default CS0618 obsoletion diagnostic ID. This allows references to these APIs to be suppressed with a targeted diagnostic.
  3. Fall back to well-known URL in client if 401 response is missing resource_metadata parameter (#1054)
    • IsConfiguredEndpointRequest() now properly validates absolute URIs by checking both host and scheme match, not just the path. This may cause previously accepted requests to be rejected if host/scheme don't match.
    • ModelContextProtocol.AspNetCore.Authentication.McpAuthenticationOptions.ResourceMetadataUri was changed from string to a nullable string?.
    • ModelContextProtocol.Authentication.ProtectedResourceMetadata.Resource was changed from required Uri to a non-required and nulalble Uri?
  4. Remove McpClient.Enumerate*Async methods (#1060)
    • Removes EnumerateToolsAsync, EnumeratePromptsAsync, EnumerateResourceTemplatesAsync, and EnumerateResourcesAsync from the public API surface. These scenarios are covered by the corresponding List*Async methods.
  5. Add McpClient/Session methods using .Protocol types (#1063)
    • Methods accepting a CancellationToken token had the argument renamed from token to cancellationToken for consistency throughout the SDK.
    • Methods accepting a JsonSerializerOptions? serializerOptions argument were updated to accept a RequestOptions? options argument instead, further adopting the RequestOptions class introduced in #970.
    • ModelContextProtocol.Client.McpClient.CompleteAsync was updated to add an optional RequestOptions? options argument, changing the position of the optional CancellationToken argument on the method signature.
    • ModelContextProtocol.Client.McpClient.UnsubscribeFromResourceAsync arguments were changed to now accept UnsubscribeRequestParams requestParams, CancellationToken cancellationToken = default.
    • ModelContextProtocol.Client.McpClient.SetLoggingLevel was renamed to SetLoggingLevelAsync.

What's Changed

  • Add support for Client ID Metadata Documents to enable URL-based client registration by @MackinnonBuck in #1023
  • MCP Core docs edit pass by @gewarren in #1033
  • Adjust analyzer diagnostic severities and improve MCP001 reporting by @Copilot in #1038
  • Remove obsolete APIs from codebase by @Copilot in #985
  • Add support for data to McpProtocolException by @Copilot in #1028
  • Fix XML generator partial method issues by @jongalloway in #1059
  • Remove McpClient.Enumerate*Async methods by @Copilot in #1060
  • Add request options bag to high level requests and include Meta by @mikekistler in #970
  • Add support for URL mode elicitation by @halter73 in #1021
  • Synthesize return description into tool description when UseStructuredContent is false by @Copilot in #1049
  • Add ResourceNotFound error code (-32002) by @Copilot in #1062
  • Add McpClient/Session methods using .Protocol types by @stephentoub in #1063
  • WithMeta for McpClientTool by @PederHP in #1027
  • Fall back to well-known URL in client if 401 response is missing resource_metadata parameter by @halter73 in #1054

Documentation Updates

Repository Infrastructure Updates

New Contributors

Full Changelog: v0.4.1-preview.1...v0.5.0-preview.1