Update dependency ModelContextProtocol to v2 - #35
Merged
Conversation
ChrisPulman
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.4.0→2.0.0Release Notes
modelcontextprotocol/csharp-sdk (ModelContextProtocol)
v2.0.0Version 2.0.0 brings the C# SDK into stable alignment with the MCP 2026-07-28 specification.
This major release introduces discovery-first negotiation, multi-round-trip requests, stateless-by-default HTTP, caching hints, standardized headers, stronger OAuth and token-cache safety, and dedicated MCP Apps and Tasks extension packages, with down-level interoperability for peers negotiating 2025-11-25 and earlier. Review the migration guidance below.
Breaking Changes
Refer to the C# SDK Versioning documentation for details on versioning and breaking-change policies.
HttpServerTransportOptions.Statelessnow defaults totrue. Stateless servers do not create transport sessions, expose the standalone SSEGET/DELETEendpoints, or support unsolicited server-to-client requests.Stateless = falsewhen an existing server requires legacy stateful behavior. Stateful-only options now produceMCP9006warnings and apply only to down-level initialize-handshake connections.server/discoverfirst and automatically fall back to the legacyinitializehandshake for down-level servers.MCP9005warnings because these features are deprecated by the 2026-07-28 specification.MCP9005temporarily if continued use is required while planning migration.ModelContextProtocol.Extensions.Tasks#1693ModelContextProtocol.Extensions.Tasks, import its namespace, register Tasks withWithTasks(...), and replace CoreRequestMethods.Tasks*constants withTasksProtocolmembers.AuthorizationRedirectDelegateandClientOAuthOptions.AuthorizationRedirectDelegatenow produceMCP9007warnings. Migrate toClientOAuthOptions.AuthorizationCallbackHandlerso callbacks can return the authorization code, state, and issuer.UseStructuredContent = trueand a non-object return type now emit the raw value and matching schema, such asstructuredContent: 72, instead of wrapping it as{ "result": 72 }.resultproperty.Tool.inputSchemaduring deserialization #1600Toolpayload withoutinputSchemanow throwsJsonExceptioninstead of silently defaulting the schema.inputSchema; an empty{}is sufficient.S256incode_challenge_methods_supported.application_typeduring dynamic client registration #1613application_type.DynamicClientRegistrationOptions.ApplicationTypeexplicitly when the inferred value is not appropriate.HttpRequestException,TimeoutException, or genuine I/O exception instead of always wrapping failures inIOException.IOException("Failed to connect transport.")wrapper. In AutoDetect mode, inspect the outerHttpRequestExceptionand its inner SSE failure.insufficient_scopechallenge that introduces no new scopes now throwsMcpExceptioninstead of retrying indefinitely.What's Changed
InheritEnvironmentVariablestoStdioClientTransportOptions#1563 by @halter73offline_accessto authorization scope when advertised (SEP-2207) #1479 by @stephentoub (co-authored by @Copilot)McpErrorCode.ResourceNotFoundper SEP-2164 #1558 by @jayaraman-venkatesanMcpClienttool cache #1590 by @tarekghScopeSelectorDelegateto OAuth options #1596 by @hallloMinVersionForStandardHeaderstoDraftProtocolVersion#1603 by @halter73x-mcp-headerbehavior with SEP-2243 clarifications #1619 by @tarekgh$refpointer resolution after output-schema wrapping #1435 by @weinongMcpClientOptions.InitializeMeta#1599 by @adityasingh2400charset=utf-8from HTTPapplication/jsoncontent types #1528 by @jayaraman-venkatesaninputSchemaduring deserialization #1600 by @DragonFSKYTimeToLiveinstead ofTtlMsin public APIs #1644 by @PranavSenthilnathan (co-authored by @halter73 @Copilot)DeferChangedEvents()for batched primitive-change notifications #1689 by @jeffhandley (co-authored by @Copilot)completeresult discriminator #1684 by @PranavSenthilnathan (co-authored by @Copilot @tarekgh)ModelContextProtocol.Extensions.Tasks#1693 by @jeffhandley (co-authored by @Copilot @tarekgh)application_typeto dynamic client registration #1613 by @jayaraman-venkatesanClientOAuthProvider#1605 by @mikekistlerClientOAuthProviderclient ID availability on cold start #1705 by @halter73 (co-authored by @Copilot)Documentation Updates
Test Improvements
AddIncomingMessageFilter_Multiple_Filters_Execute_In_Ordertest #1627 by @tarekghReadEventsAsync_InStreamingMode_YieldsNewlyWrittenEvents#1491 by @ericstj (co-authored by @Copilot)DiagnosticTests.Session_TracksActivities#1495 by @ericstj (co-authored by @Copilot)http-custom-headersconformance scenario #1691 by @tarekgh_meta.uiserialization round-trip tests #1698 by @yayayouyou (co-authored by @jeffhandley)Repository Infrastructure Updates
Tool.Executionreference from the main build #1660 by @halter73Acknowledgements
Community Stability Contributions
Tool.InputSchemasilently masked malformed payloads (#1575), leading to the required-field fix in #1600._metaon initialize requests (#1593), leading toMcpClientOptions.InitializeMetain #1599.New Contributors
Additional Issue Reporters
Reviewers
Full Changelog: modelcontextprotocol/csharp-sdk@v1.4.1...v2.0.0
v1.4.1This release backports a memory-leak fix for HTTP/SSE-based MCP servers.
StreamableHttpServerTransportnow releases its Server-Sent Events response stream reference as soon as a GET request ends, instead of holding it until the session is disposed via explicit DELETE or idle timeout. Long-lived SSE clients that disconnect without sending DELETE no longer pin the underlying Kestrel connection and its associated memory-pool buffers (~20 MiB per session), preventing the sustained memory growth that could accumulate under connect/disconnect churn.What's Changed
Acknowledgements
Full Changelog: modelcontextprotocol/csharp-sdk@v1.4.0...v1.4.1
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.