You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add template variable support for remote transport URLs
Enable URL templating for StreamableHttpTransport and SseTransport by adding
'arguments' and 'environmentVariables' arrays. This allows remote servers
to support multi-tenant deployments with configurable endpoints.
Key changes:
- Add optional 'arguments' array to both transport types for valueHint-based templating
- Add optional 'environmentVariables' array for environment-based templating
- Update URL descriptions to clarify template variable resolution behavior
- Add comprehensive multi-tenant example demonstrating the new functionality
- Maintain backwards compatibility - existing configs continue to work
This addresses the common use case where remote MCP servers are deployed
across multiple tenants/regions, each requiring different endpoint URLs.
Variables in {curly_braces} now properly resolve from the defined arrays.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/server-json/generic-server-json.md
+97Lines changed: 97 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -670,6 +670,103 @@ For MCP servers that follow a custom installation path or are embedded in applic
670
670
}
671
671
```
672
672
673
+
### Multi-Tenant Remote Server with URL Templating
674
+
675
+
This example demonstrates how to use URL templating for remote servers deployed across multiple tenants or regions, addressing scenarios where each deployment has its own endpoint:
Copy file name to clipboardExpand all lines: docs/reference/server-json/server.schema.json
+30-2Lines changed: 30 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -377,7 +377,7 @@
377
377
},
378
378
"url": {
379
379
"type": "string",
380
-
"description": "URL template for the streamable-http transport. Variables in {curly_braces} reference argument valueHints, argument names, or environment variable names. After variable substitution, this should produce a valid URI.",
380
+
"description": "URL template for the streamable-http transport. Variables in {curly_braces} reference argument valueHints from 'arguments' array or names from 'environmentVariables' array. If arguments/environmentVariables are not provided, {curly_braces} should be treated as literal text. After variable substitution, this should produce a valid URI.",
381
381
"example": "https://api.example.com/mcp"
382
382
},
383
383
"headers": {
@@ -386,6 +386,20 @@
386
386
"items": {
387
387
"$ref": "#/definitions/KeyValueInput"
388
388
}
389
+
},
390
+
"arguments": {
391
+
"type": "array",
392
+
"description": "Arguments that can be referenced in URL template {curly_braces} via their valueHint property",
393
+
"items": {
394
+
"$ref": "#/definitions/Argument"
395
+
}
396
+
},
397
+
"environmentVariables": {
398
+
"type": "array",
399
+
"description": "Environment variables that can be referenced in URL template {curly_braces} via their name property",
400
+
"items": {
401
+
"$ref": "#/definitions/KeyValueInput"
402
+
}
389
403
}
390
404
}
391
405
},
@@ -407,7 +421,7 @@
407
421
"url": {
408
422
"type": "string",
409
423
"format": "uri",
410
-
"description": "Server-Sent Events endpoint URL",
424
+
"description": "Server-Sent Events endpoint URL template. Variables in {curly_braces} reference argument valueHints from 'arguments' array or names from 'environmentVariables' array. If arguments/environmentVariables are not provided, {curly_braces} should be treated as literal text. After variable substitution, this should produce a valid URI.",
411
425
"example": "https://mcp-fs.example.com/sse"
412
426
},
413
427
"headers": {
@@ -416,6 +430,20 @@
416
430
"items": {
417
431
"$ref": "#/definitions/KeyValueInput"
418
432
}
433
+
},
434
+
"arguments": {
435
+
"type": "array",
436
+
"description": "Arguments that can be referenced in URL template {curly_braces} via their valueHint property",
437
+
"items": {
438
+
"$ref": "#/definitions/Argument"
439
+
}
440
+
},
441
+
"environmentVariables": {
442
+
"type": "array",
443
+
"description": "Environment variables that can be referenced in URL template {curly_braces} via their name property",
0 commit comments