Skip to content

Commit e1de336

Browse files
tadasantclaude
andcommitted
refactor: Replace schema pattern test with SSE template validation example
Instead of adding a new test pattern (schema_pattern_test.go), add a simple SSE transport example with template variables to the documentation which gets validated by the existing validate-examples tool. Changes: - Add SSE remote transport example with {tenant_id} template variable to generic-server-json.md - Update expectedServerJSONCount from 14 to 15 in validate-examples tool - Remove internal/validators/schema_pattern_test.go (new test pattern) This follows the existing testing patterns where schema validation happens through documentation examples rather than dedicated unit tests. The new SSE example proves that template variables work correctly with the pattern validation added in the previous commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 9f127fe commit e1de336

File tree

3 files changed

+24
-196
lines changed

3 files changed

+24
-196
lines changed

docs/reference/server-json/generic-server-json.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,29 @@ This example demonstrates URL templating for remote servers, useful for multi-te
701701

702702
Clients configure the tenant identifier, and the `{tenant_id}` variable in the URL gets replaced with the provided variable value to connect to the appropriate tenant endpoint (e.g., `https://anonymous.modelcontextprotocol.io/mcp/us-cell1` or `https://anonymous.modelcontextprotocol.io/mcp/emea-cell1`).
703703

704+
The same URL templating works with SSE transport:
705+
706+
```json
707+
{
708+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
709+
"name": "io.modelcontextprotocol.anonymous/events-server",
710+
"description": "MCP server using SSE with tenant-specific endpoints",
711+
"version": "1.0.0",
712+
"remotes": [
713+
{
714+
"type": "sse",
715+
"url": "https://events.anonymous.modelcontextprotocol.io/sse/{tenant_id}",
716+
"variables": {
717+
"tenant_id": {
718+
"description": "Tenant identifier",
719+
"isRequired": true
720+
}
721+
}
722+
}
723+
]
724+
}
725+
```
726+
704727
### Local Server with URL Templating
705728

706729
This example demonstrates URL templating for local/package servers, where variables reference parent Package arguments or environment variables:

internal/validators/schema_pattern_test.go

Lines changed: 0 additions & 195 deletions
This file was deleted.

tools/validate-examples/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func main() {
3333

3434
func runValidation() error {
3535
// Define what we validate and how
36-
expectedServerJSONCount := 14
36+
expectedServerJSONCount := 15
3737
targets := []validationTarget{
3838
{
3939
path: filepath.Join("docs", "reference", "server-json", "generic-server-json.md"),

0 commit comments

Comments
 (0)