Updated sse/streamable uri constraints#576
Updated sse/streamable uri constraints#576BobDickinson wants to merge 4 commits intomodelcontextprotocol:mainfrom
Conversation
…ble and replaced format: "uri" on sse with same pattern (json schema uri format doesn't allow for {token} substitution, which we support)
|
I'm not sure about the convention for updating the schema version when it changes (or who makes that call), so I didn't touch that. These changes do not break any currently published servers, but it is more strict in that the tokens are now only allowed in streamable transport uris inside of a package (there were no instances of these outside of a package in the published data, but the schema technically would have allowed it and now does not). |
…URL template" support).
- Make base StreamableHttpTransport and SseTransport use format: 'uri' for remote usage - Create PackageStreamableHttpTransport and PackageSseTransport with variable substitution support - Update package transport references to use package-specific versions - Maintain backwards compatibility while providing clearer validation contexts
|
I somehow missed #570 which looks like the proper solution. Assuming that gets done soon, this PR should be closed (preferred option). It that PR isn't adopted, or adopted soon-ish, this change at least addresses current servers failing validation that shouldn't (in a fairly simple way). |
|
Thank you for this (and your other awesome contributions!). I agree that we should close this PR in favor of #570, which we are actively working on. |
Added token substitution support to SSE transport URIs to fix failing schema validations in public servers (bug fix)
Constrained token substitution to only package transport uris (where there is something to resolve tokens against)
Motivation and Context
Quite a number of existing servers failed schema validation because of package SSE transports with tokens in their uris. It appears that the intent was to support variable substitution in both streamable and sse transport uris, but the change enabling that was only applied to streamable (where the
descriptionwas updated and theformat: uriwas removed).It also appears to be the case that variable substitution is only intended to be supported for transports inside of packages where there is something to resolve the variables against. The original streamable change would have allowed for tokens in remote transport uris as well (which would be unresolvable).
This change makes StreamableHttpTransport and SseTransport work like they used to (restored
format: uri, and reverted to simplified description). And it makes new PackageStreamableHttpTransport and PackageSseTransport derived from those that overrides the uri properties with ones that support variable substitution (description, pattern, and examples with variable substitution).How Has This Been Tested?
I ran schema validation with a local typescript script against all servers with current schema version using Ajv before and after and verified results. If there is a tooling in the repo that would be better, please let me know.
Breaking Changes
No breaking changes
Types of changes
Checklist