Skip to content

Commit a8542ea

Browse files
tadasantclaude
andcommitted
docs: Add URL template variables examples to remote servers guide
Add two examples demonstrating the new URL template variables feature introduced in #570: - Basic example with tenant_id variable for multi-tenant deployments - Advanced example showing choices, default, and isRequired properties 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 772bfde commit a8542ea

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

docs/modelcontextprotocol-io/remote-servers.mdx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,64 @@ Specify the transport by setting the `type` property of the `remotes` entry to e
4949
}
5050
```
5151

52+
## URL Template Variables
53+
54+
Remote servers can define URL template variables using `{curly_braces}` notation. This enables multi-tenant deployments where a single server definition can support multiple endpoints with configurable values:
55+
56+
```json server.json highlight={10-17}
57+
{
58+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
59+
"name": "com.example/acme-analytics",
60+
"title": "ACME Analytics",
61+
"description": "Real-time business intelligence and reporting platform",
62+
"version": "2.0.0",
63+
"remotes": [
64+
{
65+
"type": "streamable-http",
66+
"url": "https://{tenant_id}.analytics.example.com/mcp",
67+
"variables": {
68+
"tenant_id": {
69+
"description": "Your tenant identifier (e.g., 'us-cell1', 'emea-cell1')",
70+
"isRequired": true
71+
}
72+
}
73+
}
74+
]
75+
}
76+
```
77+
78+
When configuring this server, users provide their `tenant_id` value, and the URL template gets resolved to the appropriate endpoint (e.g., `https://us-cell1.analytics.example.com/mcp`).
79+
80+
Variables support additional properties like `default`, `choices`, and `isSecret`:
81+
82+
```json server.json highlight={12-22}
83+
{
84+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
85+
"name": "com.example/multi-region-mcp",
86+
"title": "Multi-Region MCP",
87+
"description": "MCP server with regional endpoints",
88+
"version": "1.0.0",
89+
"remotes": [
90+
{
91+
"type": "streamable-http",
92+
"url": "https://api.example.com/{region}/mcp",
93+
"variables": {
94+
"region": {
95+
"description": "Deployment region",
96+
"isRequired": true,
97+
"choices": [
98+
"us-east-1",
99+
"eu-west-1",
100+
"ap-southeast-1"
101+
],
102+
"default": "us-east-1"
103+
}
104+
}
105+
}
106+
]
107+
}
108+
```
109+
52110
## HTTP Headers
53111

54112
MCP clients can be instructed to send specific HTTP headers by adding the `headers` property to the `remotes` entry:

0 commit comments

Comments
 (0)