Skip to content

Commit 4601c54

Browse files
tadasantclaude
andcommitted
refactor: Simplify to single RemoteTransport type
Replace the weird RemoteStreamableHttpTransport and RemoteSseTransport with a single clean RemoteTransport type that supports both streamable-http and sse with a discriminated union approach. Benefits: - Much more DRY - no repetition between transport types - Clear separation: Package transports vs RemoteTransport - Cleaner schema - single RemoteTransport definition - Simplified Go types - RemoteTransport handles both cases This addresses feedback about the previous design being repetitive and confusing with dual-purpose transport definitions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5885914 commit 4601c54

File tree

1 file changed

+32
-52
lines changed

1 file changed

+32
-52
lines changed

docs/reference/server-json/server.schema.json

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
},
378378
"url": {
379379
"type": "string",
380-
"description": "URL template for the streamable-http transport. Variables in {curly_braces} can reference argument valueHints, argument names, or environment variable names from the parent Package context. After variable substitution, this should produce a valid URI.",
380+
"description": "URL template for the streamable-http transport. Variables in {curly_braces} can reference argument valueHints, argument names, or environment variable names from the parent Package. After variable substitution, this should produce a valid URI.",
381381
"example": "https://api.example.com/mcp"
382382
},
383383
"headers": {
@@ -407,7 +407,7 @@
407407
"url": {
408408
"type": "string",
409409
"format": "uri",
410-
"description": "Server-Sent Events endpoint URL template. Variables in {curly_braces} can reference argument valueHints, argument names, or environment variable names from the parent Package context. After variable substitution, this should produce a valid URI.",
410+
"description": "Server-Sent Events endpoint URL template. Variables in {curly_braces} can reference argument valueHints, argument names, or environment variable names from the parent Package. After variable substitution, this should produce a valid URI.",
411411
"example": "https://mcp-fs.example.com/sse"
412412
},
413413
"headers": {
@@ -419,54 +419,41 @@
419419
}
420420
}
421421
},
422-
"RemoteStreamableHttpTransport": {
423-
"allOf": [
424-
{
425-
"$ref": "#/definitions/StreamableHttpTransport"
422+
"RemoteTransport": {
423+
"type": "object",
424+
"required": [
425+
"type",
426+
"url"
427+
],
428+
"properties": {
429+
"type": {
430+
"type": "string",
431+
"enum": [
432+
"streamable-http",
433+
"sse"
434+
],
435+
"description": "Remote transport type (only streamable-http and sse are supported for remote endpoints)"
426436
},
427-
{
428-
"type": "object",
429-
"properties": {
430-
"url": {
431-
"type": "string",
432-
"description": "URL template for the streamable-http transport. Variables in {curly_braces} reference variable names from the 'variables' object. If variables are not provided, {curly_braces} should be treated as literal text. After variable substitution, this should produce a valid URI.",
433-
"example": "https://api.example.com/mcp/{tenant_id}"
434-
},
435-
"variables": {
436-
"type": "object",
437-
"description": "Configuration variables that can be referenced in URL template {curly_braces}. The key is the variable name, and the value defines the variable properties.",
438-
"additionalProperties": {
439-
"$ref": "#/definitions/Input"
440-
}
441-
}
437+
"url": {
438+
"type": "string",
439+
"description": "URL template for the remote transport. Variables in {curly_braces} reference variable names from the 'variables' object. If variables are not provided, {curly_braces} should be treated as literal text. After variable substitution, this should produce a valid URI.",
440+
"example": "https://api.example.com/mcp/{tenant_id}"
441+
},
442+
"headers": {
443+
"type": "array",
444+
"description": "HTTP headers to include",
445+
"items": {
446+
"$ref": "#/definitions/KeyValueInput"
442447
}
443-
}
444-
]
445-
},
446-
"RemoteSseTransport": {
447-
"allOf": [
448-
{
449-
"$ref": "#/definitions/SseTransport"
450448
},
451-
{
449+
"variables": {
452450
"type": "object",
453-
"properties": {
454-
"url": {
455-
"type": "string",
456-
"format": "uri",
457-
"description": "Server-Sent Events endpoint URL template. Variables in {curly_braces} reference variable names from the 'variables' object. If variables are not provided, {curly_braces} should be treated as literal text. After variable substitution, this should produce a valid URI.",
458-
"example": "https://mcp-fs.example.com/sse/{tenant_id}"
459-
},
460-
"variables": {
461-
"type": "object",
462-
"description": "Configuration variables that can be referenced in URL template {curly_braces}. The key is the variable name, and the value defines the variable properties.",
463-
"additionalProperties": {
464-
"$ref": "#/definitions/Input"
465-
}
466-
}
451+
"description": "Configuration variables that can be referenced in URL template {curly_braces}. The key is the variable name, and the value defines the variable properties.",
452+
"additionalProperties": {
453+
"$ref": "#/definitions/Input"
467454
}
468455
}
469-
]
456+
}
470457
},
471458
"ServerDetail": {
472459
"description": "Schema for a static representation of an MCP server. Used in various contexts related to discovery, installation, and configuration.",
@@ -492,14 +479,7 @@
492479
"remotes": {
493480
"type": "array",
494481
"items": {
495-
"anyOf": [
496-
{
497-
"$ref": "#/definitions/RemoteStreamableHttpTransport"
498-
},
499-
{
500-
"$ref": "#/definitions/RemoteSseTransport"
501-
}
502-
]
482+
"$ref": "#/definitions/RemoteTransport"
503483
}
504484
},
505485
"_meta": {

0 commit comments

Comments
 (0)