Skip to content

Bump MCP SDK to 2.0.0-preview.3#3145

Open
g2vinay wants to merge 6 commits into
microsoft:mainfrom
g2vinay:bump-sdk
Open

Bump MCP SDK to 2.0.0-preview.3#3145
g2vinay wants to merge 6 commits into
microsoft:mainfrom
g2vinay:bump-sdk

Conversation

@g2vinay

@g2vinay g2vinay commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

g2vinay added 3 commits July 23, 2026 15:18
…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
g2vinay marked this pull request as ready for review July 24, 2026 07:48
@g2vinay
g2vinay requested a review from a team as a code owner July 24, 2026 07:48
Copilot AI review requested due to automatic review settings July 24, 2026 07:48
@g2vinay
g2vinay requested a review from a team as a code owner July 24, 2026 07:48
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ModelContextProtocol and ModelContextProtocol.AspNetCore package versions to 2.0.0-preview.3.
  • Updated Azure/Fabric HTTP startup tests to include the required _meta payload 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.

g2vinay added 2 commits July 24, 2026 10:24
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants