Reflect the latest changes on the schema (#682)

<!-- Provide a brief summary of your changes -->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
Addressing
https://github.com/modelcontextprotocol/registry/pull/634#issuecomment-3410615843
## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [ ] My code follows the repository's style guidelines
- [ ] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
This commit is contained in:
Radoslav Dimitrov 2025-10-16 19:40:11 +03:00 • committed by GitHub
commit 893e31bd4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,6 +33,16 @@ func main() {
log.Fatalf("Failed to parse OpenAPI YAML: %v", err)
}
// Extract version from info section
info, ok := openapi["info"].(map[string]interface{})
if !ok {
log.Fatal("Missing 'info' in OpenAPI spec")
}
version, ok := info["version"].(string)
if !ok {
log.Fatal("Missing 'info.version' in OpenAPI spec")
}
// Extract components/schemas
components, ok := openapi["components"].(map[string]interface{})
if !ok {
@ -78,11 +88,12 @@ func main() {
}
}
// Build the JSON Schema document
// Build the JSON Schema document with dynamic version from OpenAPI spec
schemaID := fmt.Sprintf("https://static.modelcontextprotocol.io/schemas/%s/server.schema.json", version)
jsonSchema := map[string]interface{}{
"$comment": "This file is auto-generated from docs/reference/api/openapi.yaml. Do not edit manually. Run 'make generate-schema' to update.",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
"$id": schemaID,
"title": "server.json defining a Model Context Protocol (MCP) server",
"$ref": "#/definitions/ServerDetail",
"definitions": definitions,