Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@felixweinberger
Copy link
Collaborator

@felixweinberger felixweinberger commented Nov 11, 2025

Adds conformance test to validate that MCP clients properly apply default values for omitted elicitation fields as required by SEP-1034.

Motivation and Context

SEP-1034 specifies that clients SHOULD apply default values when users omit optional fields in elicitation responses. This PR adds conformance tests to verify this client-side behavior.

How Has This Been Tested?

  • Ran all 5 conformance checks against TypeScript SDK with client-side default support
  • String, integer, number, enum, and boolean defaults all pass
  • Uses server.request() instead of elicitInput() to ensure true client-side default application is tested

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This test complements the existing server-side test (which validates servers advertise defaults in schemas). The client-side test validates that client SDKs automatically fill in defaults when users return partial/empty content.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/conformance/@modelcontextprotocol/conformance@19

commit: a3e1aa9

@felixweinberger
Copy link
Collaborator Author

Right now this doesn't pass yet because it's pending landing of modelcontextprotocol/typescript-sdk#1096

Adds a conformance test that validates client SDKs properly apply
default values for omitted fields in elicitation responses per SEP-1034.

The test spins up a server that sends elicitation requests with defaults,
and validates that the client returns content with those defaults applied.
Updates client-side test to validate server-side default application
using elicitInput() helper, which applies defaults via validation layer.
This aligns with the TypeScript SDK's SEP-1034 implementation approach.

The test now validates:
- Server uses elicitInput() with schemas containing defaults
- Client returns empty/partial content
- Server automatically applies defaults during validation
- Defaults are correctly merged for all primitive types
…de defaults test

Ensures conformance test validates true client-side default application
rather than server-side validation behavior.
@felixweinberger felixweinberger force-pushed the fweinberger/sep-1034-client branch from 39060b4 to 6c33d31 Compare November 11, 2025 13:33
@felixweinberger
Copy link
Collaborator Author

Running this with the everything server on modelcontextprotocol/typescript-sdk#1096:

CleanShot 2025-11-11 at 13 50 10

Enables conformance test to opt into client-side elicitation defaults
by setting the applyDefaults capability flag.
Copy link
Member

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: come back and add test file b/c current example fails w/o ts-sdk update.

@pcarleton pcarleton merged commit f7bc687 into main Nov 11, 2025
8 checks passed
@pcarleton pcarleton deleted the fweinberger/sep-1034-client branch November 11, 2025 14:05
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.

3 participants