Skip to content

Conversation

@findleyr
Copy link
Contributor

@findleyr findleyr commented Dec 11, 2025

This allows users to configure default capabilities, disable defaults,
or suppress listChanged notifications by setting ListChanged: false.

Key changes:

  • Add ServerOptions.Capabilities and ClientOptions.Capabilities fields.
  • Merge user-provided capabilities with dynamically-added ones (tools,
    prompts, resources, sampling, elicitation).
  • Check ListChanged before sending list-changed notifications.
  • Sync Roots from RootsV2 for backward compatibility (How to check client capabilities and handle unsupported capability errors? #607).
  • Deprecate HasPrompts, HasResources, HasTools on ServerOptions.
  • Remove unreleased ElicitationModes field from ClientOptions.
  • Add clone methods to capability structs using shallowClone helper.
  • Add synctest-based tests for notification behavior (go1.25).
  • Add TestClientCapabilitiesOverWire and TestServerCapabilitiesOverWire
  • Document the new Capabilities API in docs/

Fixes #706

@findleyr findleyr changed the title mcp: Add Capabilities fields to ClientOptions and ServerOptions mcp: add Capabilities fields to ServerOptions and ClientOptions Dec 11, 2025
@findleyr findleyr force-pushed the capabilities-refactor branch 5 times, most recently from a04ada4 to cb0fcb7 Compare December 11, 2025 15:22
@findleyr findleyr marked this pull request as ready for review December 11, 2025 15:25
Copy link
Contributor Author

@findleyr findleyr left a comment

Choose a reason for hiding this comment

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

Markus: could you please review carefully:

  • The new inference logic (both capabilities and should... methods)
  • The API and API documentation.

@markus-kusano markus-kusano self-assigned this Dec 11, 2025
@markus-kusano markus-kusano self-requested a review December 11, 2025 16:18
@markus-kusano markus-kusano removed their assignment Dec 11, 2025
markus-kusano
markus-kusano previously approved these changes Dec 11, 2025
jba
jba previously approved these changes Dec 11, 2025
@findleyr findleyr force-pushed the capabilities-refactor branch 2 times, most recently from 0829c36 to 4430d6f Compare December 11, 2025 21:30
This allows users to configure default capabilities, disable defaults,
or suppress listChanged notifications by setting ListChanged: false.

Key changes:
- Add ServerOptions.Capabilities and ClientOptions.Capabilities fields.
- Merge user-provided capabilities with dynamically-added ones (tools,
  prompts, resources, sampling, elicitation).
- Check ListChanged before sending list-changed notifications.
- Deprecate HasPrompts, HasResources, HasTools on ServerOptions.
- Remove unreleased ElicitationModes field from ClientOptions.
- Add clone methods to capability structs using shallowClone helper.
- Add synctest-based tests for notification behavior (go1.25).
- Add TestClientCapabilitiesOverWire and TestServerCapabilitiesOverWire
- Document the new Capabilities API in docs/

Updates modelcontextprotocol#706
@findleyr findleyr force-pushed the capabilities-refactor branch from 4430d6f to d257480 Compare December 11, 2025 21:32
@findleyr findleyr merged commit 3430e22 into modelcontextprotocol:main Dec 12, 2025
6 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.

Proposal: Add {Client,Server}Options.Capabilities, and deprecate Has{Tools,Prompts,Resources}

3 participants