feat(schema): allow template variables in transport URL field#910
Merged
feat(schema): allow template variables in transport URL field#910
Conversation
The URL pattern for StreamableHttpTransport and SseTransport now accepts
template variables like {baseUrl} as an alternative to requiring the
https:// prefix. This enables more flexible URL configuration in remotes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added explicit documentation that the url field must start with
http://, https://, or a template variable (e.g., {baseUrl}).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3b74111 to
713be29
Compare
Adds a test suite that extracts regex patterns from the JSON schema and
validates them against test cases. Tests cover:
- Transport URL pattern (http/https or template variables like {baseUrl})
- Icon sizes pattern (WxH format or "any")
- Server name pattern (namespace/name format)
- File SHA-256 pattern (64 hex chars)
Includes helper functions for cleaner schema traversal and pattern testing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
713be29 to
1a99275
Compare
Member
Author
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
I like it |
rdimitrov
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Authored by Claude Code Opus 4.5, steered/reviewed by me.
Summary
StreamableHttpTransportandSseTransportto allow template variables like{baseUrl}as an alternative to requiring thehttps://prefixremotessection of server.jsonChanges
urlfield pattern from^https?://[^\s]+$to^(https?://[^\s]+|\{[a-zA-Z_][a-zA-Z0-9_]*\}[^\s]*)$openapi.yamland the derivedserver.schema.jsonhttp://,https://, or a template variableRegex breakdown
^(https?://[^\s]+http://orhttps://followed by non-whitespace|\{[a-zA-Z_][a-zA-Z0-9_]*\}{+ valid identifier +}[^\s]*)$Test cases
Should match ✓
https://api.example.com/mcphttp://localhost:8080/ssehttps://example.com/path?query=value{baseUrl}{baseUrl}/mcp{server_url}/api/v1{API_ENDPOINT}Should NOT match ✗
ftp://example.com— wrong protocolexample.com— missing protocol or variable/relative/path— relative paths not allowed{invalid-name}/path— hyphens not valid in variable names{123invalid}— variables can't start with numbers