Skip to content

Conversation

BobDickinson
Copy link
Contributor

@BobDickinson BobDickinson commented Sep 29, 2025

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 description was updated and the format: uri was 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

…ble and replaced format: "uri" on sse with same pattern (json schema uri format doesn't allow for {token} substitution, which we support)
@BobDickinson
Copy link
Contributor Author

BobDickinson commented Sep 29, 2025

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).

- 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
@BobDickinson
Copy link
Contributor Author

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).

@toby
Copy link
Member

toby commented Oct 6, 2025

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.

@toby toby closed this Oct 6, 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