Skip to content

Support server experimental and extension capabilities - #289

Open
EhsanAzish80 wants to merge 1 commit into
modelcontextprotocol:mainfrom
EhsanAzish80:feat/server-capability-extensions
Open

EhsanAzish80 wants to merge 1 commit into
modelcontextprotocol:mainfrom
EhsanAzish80:feat/server-capability-extensions

Conversation

@EhsanAzish80

Copy link
Copy Markdown

Swift servers currently cannot advertise object-valued experimental capabilities from the 2025-11-25 schema or extension settings added in 2026-07-28. This adds both optional fields to Server.Capabilities and keeps the existing initializer calls working.

The test checks the JSON sent in an initialize result and its decode round trip. swift test passed: 552 tests across 40 suites.

This is a small piece of the protocol update tracked in #234. The stateless request lifecycle is separate work.

AI assistance helped prepare the implementation and test.

myyra added a commit to myyra/mcp-swift-sdk that referenced this pull request Sep 30, 2026
Clients may advertise experimental capabilities as JSON objects rather
than strings. Decode those values using Value so initialization accepts
clients such as Codex without rejecting their capability payloads.

Expose optional experimental and extensions dictionaries on server
capabilities as well, following upstream PR modelcontextprotocol#289. Existing server
initializer calls retain their defaults, and nested capability values
survive Codable encoding and decoding.
@varun06

varun06 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Hi @EhsanAzish80, thanks for this PR! I've reviewed it and it looks good to merge.

Could you please rebase it onto the latest main? CI was broken on macOS runners for every PR (a toolchain/SDK mismatch, fixed in #306), so rebasing will pick up the fix and give us a green run. I'll review and merge once it's updated.

This pairs with #276 (the client side of the same change); I plan to merge them together so both use Value for experimental/extensions.

If you're no longer able to work on this, no problem: just let us know. If we don't hear back in about two weeks, we may carry the change forward in a new PR, with credit to you.

@EhsanAzish80
EhsanAzish80 force-pushed the feat/server-capability-extensions branch from 77f1275 to 5a7688c Compare October 22, 2026 15:26
@EhsanAzish80
EhsanAzish80 force-pushed the feat/server-capability-extensions branch from 5a7688c to dd90085 Compare October 22, 2026 16:49
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.

2 participants