Skip to content

feat: add scenario requires metadata and --production server mode - #587

Draft
sebastienrousseau wants to merge 1 commit into
modelcontextprotocol:mainfrom
sebastienrousseau:feat/scenario-requires-production-mode
Draft

sebastienrousseau wants to merge 1 commit into
modelcontextprotocol:mainfrom
sebastienrousseau:feat/scenario-requires-production-mode

Conversation

@sebastienrousseau

Copy link
Copy Markdown

Hi @olaservo,

This PR adds declarative scenario requirements metadata and an opt-in --production server conformance mode.

Capability-partial production servers now run all applicable protocol checks and report undeclared capabilities or reference-fixture contracts as SKIPPED, while default SDK conformance stays strict.

Highlights ⭐️

  • Declarative Scenario Requirements: Adds ScenarioRequirements (capabilities, anyCapability, extensions, and fixture) to ClientScenario across the 64 server scenarios, separating optional MCP capabilities from everything-server reference-fixture contracts (test_* tools/prompts and test:// resources).
  • Opt-In --production Server Mode: Evaluates scenario.requires against capabilities discovered from initialize (2025-x) or server/discover (2026-07-28), emitting structured SKIPPED checks (skippedReason: 'missing-capability' | 'missing-extension' | 'requires-fixture') without relaxing default SDK conformance (#248, #372) or masking broken capability handlers and unreachable servers.
  • Capability-Aware SEP-2549 Caching: Updates CachingScenario to inspect declared capabilities via conn.discover() so servers advertising a subset of tools, prompts, or resources only receive probes for declared endpoints while keeping all seven SEP-2549 check IDs stable for traceability.

What's Changed

Validation

  • npm run check: 0 TypeScript errors (tsgo --noEmit), 0 ESLint findings, Prettier clean across all files.
  • npm run build: Built dist/index.js (885.81 kB) in 147ms with 0 warnings.
  • npm test: 50/50 test files passed, 664/664 tests passed (including 23 new unit, runner, and CLI --production integration tests across stateful 2025-11-25 and stateless 2026-07-28 servers).

Checksums

8b59224e2e243f90e440c3938de77fcf72cd378a33897b8a8ef7286e25632cca  dist/index.js

Closes #516

Full Changelog: main...sebastienrousseau:feat/scenario-requires-production-mode

Add declarative ScenarioRequirements metadata on ClientScenario to
distinguish optional MCP server capabilities and extensions from
everything-server reference fixtures, and gate SEP-2549 caching probes
on declared capabilities while keeping emitted check IDs stable.

Introduce an opt-in --production flag on the server command that skips
unmet capability, extension, and fixture requirements with structured
SKIPPED details while keeping default SDK conformance strict.

Closes modelcontextprotocol#516
Assisted-by: Antigravity:Claude-Opus-4.6 [tsgo,eslint,prettier,vitest]

Signed-off-by: Sebastien Rousseau <[email protected]>

This branch has not been deployed

No deployments
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.

Server scenarios fail servers for capabilities they never declared

1 participant