Skip to content

Update ModelContextProtocol version, early support for new MCP spec#2926

Open
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:McpProtocolUpdates
Open

Update ModelContextProtocol version, early support for new MCP spec#2926
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:McpProtocolUpdates

Conversation

@alzimmermsft

@alzimmermsft alzimmermsft commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates ModelContextProtocol dependencies to the latest releases. Adds preliminary support for MCP 2026-07-28 spec version by handling request _meta-based client info.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@alzimmermsft alzimmermsft self-assigned this Jun 22, 2026
Copilot AI review requested due to automatic review settings June 22, 2026 22:08
@alzimmermsft alzimmermsft requested review from a team as code owners June 22, 2026 22:08

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 repository-wide MCP dependencies and adapts the server runtime/telemetry plumbing to newer ModelContextProtocol APIs, adding early support for extracting MCP client identity from _meta (per the upcoming 2026-07-28 spec).

Changes:

  • Bump ModelContextProtocol / ModelContextProtocol.AspNetCore (and Microsoft.Extensions.AI.Abstractions) package versions.
  • Extend telemetry activity creation to accept request params and extract io.modelcontextprotocol/clientInfo from _meta.
  • Update runtime/tool-loader request construction and associated tests to match updated RequestContext<T> patterns.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/tools/ToolMetadataExporter/src/Program.cs Tweaks Managed Identity credential construction used by the metadata exporter tool.
Directory.Packages.props Bumps ModelContextProtocol and AI abstractions dependency versions.
core/Microsoft.Mcp.Core/src/Services/Telemetry/TelemetryService.cs Adds _meta-based client info parsing when starting telemetry activities.
core/Microsoft.Mcp.Core/src/Services/Telemetry/ITelemetryService.cs Updates telemetry service API surface to accept request params for client info extraction.
core/Microsoft.Mcp.Core/src/Services/Telemetry/NoopTelemetryService.cs Updates noop telemetry implementation to match the updated interface.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs Passes request params into telemetry when listing tools / calling tools.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/CompositeToolLoader.cs Updates list-tools request construction to the new RequestContext<T> initialization style.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.Tests/Services/Telemetry/TelemetryServiceTests.cs Adds coverage for _meta client info extraction and updates StartActivity calls.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/ToolLoaderTelemetryTests.cs Updates telemetry mock expectations and request creation for new params plumbing.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/SingleProxyToolLoaderTests.cs Updates request construction and types for updated MCP server/request context APIs.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/ServerToolLoaderTests.cs Updates request construction to the new RequestContext<T> constructor shape.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/RegistryToolLoaderTests.cs Updates request construction and namespaces for updated MCP server/request context APIs.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs Updates request construction to pass explicit params object into RequestContext<T>.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CompositeToolLoaderTests.cs Updates request construction patterns and null-param request scenarios.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoaderTests.cs Updates request creation to match new request-context constructor patterns.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/BaseToolLoaderTests.cs Updates request context construction and modernizes helper class to primary constructor.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs Updates telemetry mocks and request creation to match new StartActivity signature.

Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/ITelemetryService.cs Outdated
Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/NoopTelemetryService.cs Outdated
Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/TelemetryService.cs Outdated

@vcolin7 vcolin7 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.

I don't have all the context I'd like on how we handle telemetry, but the changes look good at first glance. I'm just curious about the things Copilot flagged :)

Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/ITelemetryService.cs Outdated
Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/TelemetryService.cs Outdated
Comment thread core/Microsoft.Mcp.Core/src/Services/Telemetry/TelemetryService.cs Outdated

@jongio jongio 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.

Dependency bump from ModelContextProtocol 1.1.0 to 1.4.0 looks solid. The new SetClientNameAndVersion logic correctly handles the per-request _meta-based client info with proper precedence (meta overrides session-level Implementation per-field) and uses TryGetValue for type safety. Tests cover the edge cases well (partial fields, non-string values, arrays, missing keys).

One minor doc nit below, otherwise this is ready to go.

/// </summary>
/// <param name="activityName">Name of the activity.</param>
/// <param name="clientInfo">The MCP client information to add to the activity.</param>
/// <param name="requestParams">The request parameters for the MCP call. Starting in MCP 2026-07-28 spec, this contains MCP client info.</param

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.

Nit: this </param tag is missing the closing >. Should be </param>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

5 participants