Skip to content

feat: add cancellation and progress notification conformance scenarios - #436

Open
elang2 wants to merge 1 commit into
modelcontextprotocol:mainfrom
elang2:feat/cancellation-progress-scenarios
Open

feat: add cancellation and progress notification conformance scenarios#436
elang2 wants to merge 1 commit into
modelcontextprotocol:mainfrom
elang2:feat/cancellation-progress-scenarios

Conversation

@elang2

@elang2 elang2 commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • Add cancellation scenario: validates server stability under notifications/cancelled (unknown request, in-progress request, rapid burst)
  • Add progress-notifications scenario: validates progress notification semantics (non-decreasing values, token matching, no spurious notifications, cessation after completion)
  • Add test_tool_slow and test_tool_fast to everything-server for cancellation testing
  • Fix test_tool_with_progress to not send notifications when no progressToken is provided

Both scenarios are registered in pendingClientScenariosList until the everything-server tools are merged.

Spec coverage

These features were introduced in 2025-06-18 and remain in all subsequent versions (2025-11-25, 2026-07-28 draft). The scenarios use source.introducedIn: '2025-06-18' so they run at any spec version from that point forward.

Test plan

Tested against the everything-server (Streamable HTTP transport):

$ npx tsx src/index.ts server --url http://localhost:3000/mcp --scenario cancellation --spec-version 2025-06-18
Passed: 4/4, 0 failed, 0 warnings

$ npx tsx src/index.ts server --url http://localhost:3000/mcp --scenario progress-notifications --spec-version 2025-06-18
Passed: 5/5, 0 failed, 0 warnings

Wire-schema validation confirmed 53 JSON-RPC messages with 0 violations across both scenarios.

Full unit test suite: 504/504 passed, 43/43 test files.

Spec references

Closes #433, closes #434

Add two new server conformance test scenarios covering utilities that
previously had no test coverage:

Cancellation (notifications/cancelled):
- Server stability after cancellation of unknown request IDs
- Cancellation of in-progress requests without server degradation
- Rapid burst cancellation tolerance

Progress notifications (notifications/progress):
- Non-decreasing progress values with consistent totals
- Token matching between request _meta and notifications
- No spurious notifications when progressToken is absent
- Cessation of notifications after request completion

Everything-server additions:
- test_tool_slow: configurable sleep duration for cancellation testing
- test_tool_fast: immediate response for health-check verification
- Fixed test_tool_with_progress to not send notifications when no
  progressToken is provided (was using ?? 0 fallback)

Both scenarios are registered in pendingClientScenariosList until the
everything-server tools are merged upstream.

Tested against everything-server (spec 2025-06-18):
  cancellation: 4/4 checks passed (24 wire messages validated)
  progress-notifications: 5/5 checks passed (29 wire messages validated)

Closes modelcontextprotocol#433, closes modelcontextprotocol#434
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.

Add conformance scenario: progress notification edge cases Add conformance scenario: notifications/cancelled

1 participant