Skip to content

Model nested experimental values and extensions in Client.Capabilities - #276

Open
nstrm wants to merge 1 commit into
modelcontextprotocol:mainfrom
nstrm:fix/client-capabilities-experimental-extensions
Open

Model nested experimental values and extensions in Client.Capabilities#276
nstrm wants to merge 1 commit into
modelcontextprotocol:mainfrom
nstrm:fix/client-capabilities-experimental-extensions

Conversation

@nstrm

@nstrm nstrm commented Aug 19, 2026

Copy link
Copy Markdown

Fixes #262.

Client.Capabilities.experimental is typed [String: String]?, but the spec defines it as a map of arbitrary objects. Clients that send nested values there — ChatGPT sends {"openai/visibility": {"enabled": true}} — fail decoding inside TypedRequestHandler, and the server returns JSON-RPC -32603 to a valid initialize. The extensions capability map was also unmodeled (ignored on decode).

Note for reviewers: this changes the public type of experimental. Dictionary literals with string values still compile (Value is ExpressibleByStringLiteral); no call sites in the repo needed updating.

Type experimental as [String: Value] per the spec and add the
extensions capability map, so initialize requests carrying nested
JSON (e.g. ChatGPT's) decode instead of failing with -32603.

Fixes modelcontextprotocol#262
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 fails to decode ChatGPT's initialize (experimental typed [String: String], extensions unmodeled); error is returned inside an HTTP 200

1 participant