Skip to content

Fix specification of experimental capabilities#65

Closed
Liam-DeVoe wants to merge 1 commit intomodelcontextprotocol:mainfrom
Liam-DeVoe:experimental-typing
Closed

Fix specification of experimental capabilities#65
Liam-DeVoe wants to merge 1 commit intomodelcontextprotocol:mainfrom
Liam-DeVoe:experimental-typing

Conversation

@Liam-DeVoe
Copy link
Copy Markdown

The example python library usage assumes experimental is eg {"experimental": {"key": True}}. Right now I believe the typescript spec and therefore the jsonschema spec forces an additional level of nesting {"experimental": {"key": {"why": True}}}:

https://github.com/modelcontextprotocol/specification/blob/9d3c21d9a9384c080ae7de308a6f8116bbf2c801/schema/schema.ts#L188-L192

as : object implies a key:value pair rather than the true unknown value (which in python really is object).

@Liam-DeVoe Liam-DeVoe changed the title Fix jsonschema specification of experimental capabilities Fix specification of experimental capabilities Nov 26, 2024
@jspahrsummers
Copy link
Copy Markdown
Member

jspahrsummers commented Nov 26, 2024

Thanks for the suggestion!

The schema is correct in this case—we want to require all capabilities to be objects, because this gives flexibility in declaring different degrees of conformance. For example, with one of the standardized capabilities right now:

{
  "resources": {}
}

… means only "resources are supported, but no additional optional features on resources."

OTOH this:

{
  "resources": {
    "subscribe": true
  }
}

… means "resources are supported, and you can subscribe to changes on individual resources."

We want to encourage the same structure inside of experimental, with the idea that maybe sub-objects there could graduate into standardized, top-level capabilities later on.

Hope this clarifies things! It sounds like there is an issue in the Python example that we should fix, but the spec seems correct here. 🙂

@Liam-DeVoe
Copy link
Copy Markdown
Author

I see, thanks for the clarification! That comment in the source code was the only documentation I could find about experimental capabilities, so it wasn't clear to me whether this was a bug or a feature.

@Liam-DeVoe Liam-DeVoe deleted the experimental-typing branch November 26, 2024 03:17
jspahrsummers added a commit to modelcontextprotocol/python-sdk that referenced this pull request Nov 26, 2024
jspahrsummers added a commit that referenced this pull request Mar 12, 2025
talltree-eng added a commit to talltree-eng/python-sdk that referenced this pull request Nov 16, 2025
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