Skip to content

Commit 9c3e5be

Browse files
tadasantclaude
andcommitted
feat: Implement proper LocalTransport and RemoteTransport separation
Create clean separation with proper inheritance/composition: - **LocalTransport**: Union of StdioTransport | StreamableHttpTransport | SseTransport - Used in Package context for local/package transports - Non-breaking rename of existing concepts - **RemoteTransport**: Extends StreamableHttpTransport | SseTransport + variables - Reuses base transport definitions via allOf composition - Adds variables object for URL templating - Only supports streamable-http and sse (no stdio for remotes) Benefits: - ✅ Proper code reuse - shares StreamableHttp/Sse definitions - ✅ Clear naming - LocalTransport vs RemoteTransport - ✅ Non-breaking - just renames Package transport concept - ✅ DRY design - no duplication between transport types - ✅ Type safety - RemoteTransport can't use stdio This addresses feedback about wanting proper inheritance and clearer separation between local vs remote transport contexts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4601c54 commit 9c3e5be

File tree

1 file changed

+64
-42
lines changed

1 file changed

+64
-42
lines changed

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

Lines changed: 64 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,7 @@
134134
]
135135
},
136136
"transport": {
137-
"anyOf": [
138-
{
139-
"$ref": "#/definitions/StdioTransport"
140-
},
141-
{
142-
"$ref": "#/definitions/StreamableHttpTransport"
143-
},
144-
{
145-
"$ref": "#/definitions/SseTransport"
146-
}
147-
],
137+
"$ref": "#/definitions/LocalTransport",
148138
"description": "Transport protocol configuration for the package"
149139
},
150140
"runtimeArguments": {
@@ -419,41 +409,73 @@
419409
}
420410
}
421411
},
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)"
412+
"LocalTransport": {
413+
"anyOf": [
414+
{
415+
"$ref": "#/definitions/StdioTransport"
436416
},
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}"
417+
{
418+
"$ref": "#/definitions/StreamableHttpTransport"
441419
},
442-
"headers": {
443-
"type": "array",
444-
"description": "HTTP headers to include",
445-
"items": {
446-
"$ref": "#/definitions/KeyValueInput"
447-
}
420+
{
421+
"$ref": "#/definitions/SseTransport"
422+
}
423+
],
424+
"description": "Transport protocol configuration for local/package context"
425+
},
426+
"RemoteTransport": {
427+
"anyOf": [
428+
{
429+
"allOf": [
430+
{
431+
"$ref": "#/definitions/StreamableHttpTransport"
432+
},
433+
{
434+
"type": "object",
435+
"properties": {
436+
"url": {
437+
"type": "string",
438+
"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.",
439+
"example": "https://api.example.com/mcp/{tenant_id}"
440+
},
441+
"variables": {
442+
"type": "object",
443+
"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.",
444+
"additionalProperties": {
445+
"$ref": "#/definitions/Input"
446+
}
447+
}
448+
}
449+
}
450+
]
448451
},
449-
"variables": {
450-
"type": "object",
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"
454-
}
452+
{
453+
"allOf": [
454+
{
455+
"$ref": "#/definitions/SseTransport"
456+
},
457+
{
458+
"type": "object",
459+
"properties": {
460+
"url": {
461+
"type": "string",
462+
"format": "uri",
463+
"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.",
464+
"example": "https://mcp-fs.example.com/sse/{tenant_id}"
465+
},
466+
"variables": {
467+
"type": "object",
468+
"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.",
469+
"additionalProperties": {
470+
"$ref": "#/definitions/Input"
471+
}
472+
}
473+
}
474+
}
475+
]
455476
}
456-
}
477+
],
478+
"description": "Transport protocol configuration for remote context - extends StreamableHttpTransport or SseTransport with variables"
457479
},
458480
"ServerDetail": {
459481
"description": "Schema for a static representation of an MCP server. Used in various contexts related to discovery, installation, and configuration.",

0 commit comments

Comments
 (0)