Skip to content

Commit 1345480

Browse files
committed
Use draft URL for in-repo server.json schema
The schema in this repo may contain unreleased changes, so labeling it with a dated version URL is misleading. Change to use a draft URL instead, and add documentation for the schema contribution process. - Update $id in server.schema.json to use draft URL - Update example $schema URL in openapi.yaml - Add Draft (Unreleased) section to CHANGELOG.md - Add CONTRIBUTING.md with process for making/releasing schema changes Note: This PR was written by Claude Code.
1 parent 52e3744 commit 1345480

File tree

5 files changed

+53
-5
lines changed

5 files changed

+53
-5
lines changed

docs/reference/api/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ components:
709709
type: string
710710
format: uri
711711
description: JSON Schema URI for this server.json format
712-
example: "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json"
712+
example: "https://static.modelcontextprotocol.io/schemas/draft/server.schema.json"
713713
packages:
714714
type: array
715715
items:

docs/reference/server-json/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Changes to the server.json schema and format.
44

5+
## Draft (Unreleased)
6+
7+
This section tracks changes that are in development and not yet released. The draft schema is available at [`server.schema.json`](./server.schema.json) in this repository.
8+
9+
### Changed
10+
11+
- No changes yet.
12+
13+
### Notes
14+
15+
When ready for release, changes in this section will be moved to a dated version section (e.g., `## 2025-XX-XX`) and the schema will be published to a versioned URL.
16+
17+
---
18+
519
## 2025-10-17
620

721
### Changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Contributing to server.json Schema
2+
3+
This document describes the process for making and releasing changes to the `server.json` schema.
4+
5+
## Making Changes
6+
7+
1. **Modify the OpenAPI spec**: Edit `docs/reference/api/openapi.yaml` with your schema changes. The `ServerDetail` component defines the server.json structure.
8+
9+
2. **Regenerate the schema**: Run `make generate-schema` to update `server.schema.json` from the OpenAPI spec.
10+
11+
3. **Update the changelog**: Add your changes to the "Draft (Unreleased)" section in `CHANGELOG.md`.
12+
13+
4. **Open a PR**: Submit a pull request to this repository for review.
14+
15+
## Releasing Changes
16+
17+
When the draft changes are ready for release:
18+
19+
1. **Update the changelog**: Move changes from "Draft (Unreleased)" to a new dated section (e.g., `## 2025-XX-XX`).
20+
21+
2. **Update the schema URL**: Change the `$id` in the schema and the example URL in `openapi.yaml` from `draft` to the release date (e.g., `2025-XX-XX`).
22+
23+
3. **Merge the PR**: Get approval and merge the changes to main.
24+
25+
4. **Publish to static hosting**: Open a PR on [modelcontextprotocol/static](https://github.com/modelcontextprotocol/static/tree/main/schemas) to add the new versioned schema file. This "locks in" the released schema at its versioned URL.
26+
27+
## Schema Versioning
28+
29+
- **Draft schema**: `https://static.modelcontextprotocol.io/schemas/draft/server.schema.json` - For in-progress changes, may change without notice.
30+
- **Released schemas**: `https://static.modelcontextprotocol.io/schemas/YYYY-MM-DD/server.schema.json` - Stable, versioned by release date.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$comment": "This file is auto-generated from docs/reference/api/openapi.yaml. Do not edit manually. Run 'make generate-schema' to update.",
3-
"$id": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
3+
"$id": "https://static.modelcontextprotocol.io/schemas/draft/server.schema.json",
44
"$ref": "#/definitions/ServerDetail",
55
"$schema": "http://json-schema.org/draft-07/schema#",
66
"definitions": {
@@ -373,7 +373,7 @@
373373
"properties": {
374374
"$schema": {
375375
"description": "JSON Schema URI for this server.json format",
376-
"example": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
376+
"example": "https://static.modelcontextprotocol.io/schemas/draft/server.schema.json",
377377
"format": "uri",
378378
"type": "string"
379379
},

tools/extract-server-schema/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ func main() {
8888
}
8989
}
9090

91-
// Build the JSON Schema document with dynamic version from OpenAPI spec
92-
schemaID := fmt.Sprintf("https://static.modelcontextprotocol.io/schemas/%s/server.schema.json", version)
91+
// Build the JSON Schema document with draft URL
92+
// The in-repo schema uses "draft" since it may contain unreleased changes.
93+
// When releasing, the schema is published to a versioned URL (e.g., 2025-10-17)
94+
// on https://github.com/modelcontextprotocol/static
95+
_ = version // version from OpenAPI spec available if needed
96+
schemaID := "https://static.modelcontextprotocol.io/schemas/draft/server.schema.json"
9397
jsonSchema := map[string]interface{}{
9498
"$comment": "This file is auto-generated from docs/reference/api/openapi.yaml. Do not edit manually. Run 'make generate-schema' to update.",
9599
"$schema": "http://json-schema.org/draft-07/schema#",

0 commit comments

Comments
 (0)