Bump MCP SDK to 2.0.0-preview.3#3145
Open
g2vinay wants to merge 6 commits into
Open
Conversation
…hanges SDK preview.3 introduced two breaking changes requiring test fixes: 1. ProtocolVersion validation tightened - bare '2024' is now rejected; must use ISO date format (e.g. '2025-11-25'). MockClientTests.CreateOptions updated accordingly. 2. logging/setLevel removed from 2026-07-28 spec - the method is no longer available in the 2026-07-28 protocol; per-request log level is now set via _meta/io.modelcontextprotocol/logLevel. ClientToolTests .Should_Not_Hang_On_Logging_SetLevel_Not_Supported updated to assert McpProtocolException is thrown with 'logging/setLevel' in the message. All 1068 Azure.Mcp.Core unit tests pass with 2.0.0-preview.3.
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
…envelope changes preview.3 (PR microsoft#1692) tightened protocol negotiation boundaries: - initialize response now returns the McpServerOptions.ProtocolVersion (2025-11-25), not the legacy bare '2024' string - ValidateProtocolVersionEnvelope now requires that MCP-Protocol-Version: 2026-07-28 HTTP requests also carry _meta.protocolVersion: '2026-07-28' in the request body Fixes: - MockClientTests.Invoke_Init_Command: assert '2025-11-25' instead of '2024' - ConsolidatedModeTests / ServerStartupTests: add _meta.protocolVersion to all HTTP requests using the 2026-07-28 protocol that expect a successful response
…for 2026-07-28 preview.3 changed the _meta key namespace from bare keys (e.g. 'protocolVersion') to namespaced keys under 'io.modelcontextprotocol/' as per SEP-2575: - 'io.modelcontextprotocol/protocolVersion' (was 'protocolVersion') - 'io.modelcontextprotocol/clientInfo' (required, new) - 'io.modelcontextprotocol/clientCapabilities' (required, new) All 2026-07-28 HTTP requests that expect a successful response must include all three fields. Also fixes Should_List_Tools_On_Root_Endpoint which was missing _meta entirely.
g2vinay
marked this pull request as ready for review
July 24, 2026 07:48
g2vinay
requested review from
JasonYeMSFT,
anannya03,
chidozieononiwu,
jongio,
joshfree,
msalaman and
vukelich
July 24, 2026 07:48
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the repository’s MCP SDK dependency to 2.0.0-preview.3 and adjusts tests to comply with the tightened protocol/meta requirements introduced by that preview.
Changes:
- Bumped
ModelContextProtocolandModelContextProtocol.AspNetCorepackage versions to2.0.0-preview.3. - Updated Azure/Fabric HTTP startup tests to include the required
_metapayload in JSON-RPC request bodies. - Updated core client tests to reflect removed/invalid protocol behaviors (e.g.,
logging/setLevel, bare"2024"protocol version), and added a changelog entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| servers/Fabric.Mcp.Server/tests/Fabric.Mcp.Server.Tests/Infrastructure/ServerStartupTests.cs | Adds required _meta fields to tools/list HTTP request payload in Fabric server startup test. |
| servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/ConsolidatedModeTests.cs | Updates multiple consolidated-mode HTTP requests to include required _meta fields for preview.3 compliance. |
| servers/Azure.Mcp.Server/changelog-entries/1784845074408.yaml | Adds changelog entry documenting the MCP SDK dependency update. |
| Directory.Packages.props | Bumps central package versions for MCP SDK packages to 2.0.0-preview.3. |
| core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/ClientToolTests.cs | Updates expectation for removed logging/setLevel behavior (throw instead of hanging). |
| core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Client/MockClientTests.cs | Uses a supported protocol version string and updates initialization assertions accordingly. |
Replace hand-concatenated JSON string literals with a CreateStateless2026RequestContent helper that uses JsonObject. This eliminates brittle string escaping and ensures future protocol changes require only a single-point update. - ConsolidatedModeTests: adds helper with optional extraMeta; replaces all 6 test bodies - ServerStartupTests (Fabric): adds equivalent helper; replaces the single HTTP test body - Both files: replace inline '2026-07-28' string with StatelessProtocolVersion constant
…out to 60s AllMode_Should_List_Tools_Without_Initialize was timing out on macOS CI runners because registering all Azure tools takes longer than the previous 15-second ReadResponseAsync timeout. Made the timeout parameter optional (defaults to 15s so SingleMode/NamespaceMode tests are unaffected) and pass 60s for AllMode.
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.
No description provided.