Skip to content

test: cover legacy extension capability negotiation - #518

Open
sambhav wants to merge 1 commit into
modelcontextprotocol:mainfrom
sambhav:test/legacy-extension-negotiation
Open

sambhav wants to merge 1 commit into
modelcontextprotocol:mainfrom
sambhav:test/legacy-extension-negotiation

Conversation

@sambhav

@sambhav sambhav commented Sep 23, 2026

Copy link
Copy Markdown
Member

capabilities.extensions can be lost during SDK serialization or parsing even when the legacy initialize handshake succeeds. This adds coverage for the behavior clarified in modelcontextprotocol/modelcontextprotocol#3364 and defined by SEP-2133.

Closes #517.

Changes

  • Add one client scenario (legacy-extensions) and one server scenario (server-legacy-extensions), each exercising the 2025-11-25 handshake and capability preservation in both directions.
  • Check the Apps capability, empty settings objects, and arbitrary nested test settings, including arrays, false, zero, and null. Client and server fixtures use distinct settings.
  • Require a diagnostic tool report from the SDK's capability accessor so deserialization loss is observable. Missing reports fail as untestable instead of silently skipping.
  • Inspect server initialization responses directly on the wire and reject a different negotiated version. Support JSON and SSE responses and clean up sessions.
  • Extend the TypeScript everything-client/server and add negative controls for dropped advertisements, dropped received capabilities, stripped settings, missing reports, and a different negotiated version.
  • Register the scenarios in optional extension suites, outside core/Tier-1 and dated-spec selections. Document the fixture contract and commands in SDK_INTEGRATION.md.

This tests capability preservation on 2025-11-25, not full Apps functionality, all earlier protocol versions, or the newer per-request capability flow. The example.com identifiers are diagnostic fixtures only.

Validation

  • npm run build
  • npm run check (typecheck and lint)
  • npm test: 49 files, 636 tests passed
  • Client CLI run against the TypeScript everything-client: 8/8 checks passed
  • Server scenario against the TypeScript everything-server: passed; included in the integration suite
  • git diff --check

The environment blocks the tsx CLI's IPC socket, so local test execution used a node_modules-only launcher adapter invoking node --import tsx. No dependency, lockfile, or repository script changes are included.

AI assistance: Codex prepared and validated this change at Sambhav's request.

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@518

commit: 2c19a18

@felixweinberger
felixweinberger self-requested a review September 25, 2026 16:55
@felixweinberger
felixweinberger removed their request for review September 25, 2026 17:05

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.

Cover optional extension capability preservation in legacy initialize handshakes

2 participants