Update ModelContextProtocol version, early support for new MCP spec#2926
Update ModelContextProtocol version, early support for new MCP spec#2926alzimmermsft wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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(andMicrosoft.Extensions.AI.Abstractions) package versions. - Extend telemetry activity creation to accept request params and extract
io.modelcontextprotocol/clientInfofrom_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. |
vcolin7
left a comment
There was a problem hiding this comment.
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 :)
jongio
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Nit: this </param tag is missing the closing >. Should be </param>.
What does this PR do?
Updates
ModelContextProtocoldependencies 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
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline