Skip to content

Fix protocol version tag for stateless server spans - #1810

Merged
tarekgh merged 4 commits into
modelcontextprotocol:mainfrom
luisangelrod:fix/protocol-version-activity-tag
Aug 14, 2026
Merged

Fix protocol version tag for stateless server spans#1810
tarekgh merged 4 commits into
modelcontextprotocol:mainfrom
luisangelrod:fix/protocol-version-activity-tag

Conversation

@luisangelrod

Copy link
Copy Markdown
Contributor

Summary

  • Use the per-request protocol version when tagging server activities before session-level negotiation state is populated
  • Add stateless HTTP coverage for the 2026-07-28 protocol version tag

Fixes #1800

Testing

  • Focused stateless protocol-version activity test: 1 passed
  • ModelContextProtocol.Tests DiagnosticTests on net10.0: 3 passed
  • MapMcpStatelessTests on net10.0: 32 passed, 20 skipped as expected

@jeffhandley

Copy link
Copy Markdown
Contributor

Thanks for submitting this, @luisangelrod! Tagging @tarekgh for review.

Comment thread tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStatelessTests.cs Outdated
Cover per-request protocol version tagging across multiple versions in stateless mode, assert the negotiated version alongside the tag, and add a stateful test asserting the negotiated version drives the tag.

@tarekgh tarekgh 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 pushed small test changes, LGTM otherwise.

Thanks @luisangelrod for helping with this fix.

@tarekgh
tarekgh requested review from jeffhandley and removed request for jeffhandley August 14, 2026 15:38
@tarekgh
tarekgh dismissed jeffhandley’s stale review August 14, 2026 15:40

We addressed the comment and if there is any more follow up we can do it in another PR

@tarekgh
tarekgh merged commit 8754e19 into modelcontextprotocol:main Aug 14, 2026
10 checks passed
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.

mcp.protocol.version activity tag not emitted on server spans in stateless HTTP mode

4 participants