Skip to content

Commit 893e31b

Browse files
authored
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 #634 (comment) ## 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 <[email protected]>
1 parent 84387c9 commit 893e31b

File tree

4 files changed

+74
-7
lines changed

4 files changed

+74
-7
lines changed

docs/reference/api/openapi.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
openapi: 3.1.0
22
jsonSchemaDialect: "https://json-schema.org/draft/2020-12/schema"
3-
$id: https://modelcontextprotocol.io/schemas/draft/2025-09-29/server-registry-openapi
3+
$id: https://modelcontextprotocol.io/schemas/draft/2025-10-11/server-registry-openapi
44
info:
55
title: MCP Server Registry API
6-
version: "2025-09-29"
6+
version: "2025-10-11"
77
summary: API for discovering and accessing MCP server metadata
88
description: |
99
Specification for a theoretical REST API that serves up metadata about MCP servers.
@@ -616,7 +616,7 @@ components:
616616
type: string
617617
format: uri
618618
description: JSON Schema URI for this server.json format
619-
example: "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json"
619+
example: "https://static.modelcontextprotocol.io/schemas/2025-10-11/server.schema.json"
620620
packages:
621621
type: array
622622
items:

docs/reference/server-json/CHANGELOG.md

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

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

5+
## 2025-10-11
6+
7+
### Changed
8+
9+
#### Package Format Enhancements ([#634](https://github.com/modelcontextprotocol/registry/pull/634))
10+
11+
The `Package` schema has been refactored to better support different package types with dedicated handling per registry type.
12+
13+
**Key Changes:**
14+
15+
- **`version` field is now optional** - Previously required for all packages, now only used by npm, pypi, and nuget. OCI packages include version in the identifier (e.g., `ghcr.io/owner/repo:v1.0.0`), and MCPB packages use direct download URLs.
16+
17+
- **Enhanced documentation** - Added detailed comments explaining which fields are relevant for each `registryType`:
18+
- **NPM/PyPI/NuGet**: Use `registryType`, `identifier` (package name), `version`, optional `registryBaseUrl`
19+
- **OCI**: Use `registryType`, `identifier` (full image reference with tag)
20+
- **MCPB**: Use `registryType`, `identifier` (download URL), `fileSha256` (required)
21+
22+
- **Field clarifications**:
23+
- `identifier`: Now clearly documented as package name for registries, full image reference for OCI, or download URL for MCPB
24+
- `fileSha256`: Clarified as required for MCPB packages and optional for other types
25+
- `registryBaseUrl`: Clarified as used by npm/pypi/nuget but not by oci/mcpb
26+
27+
**Migration:**
28+
29+
Publishers using OCI or MCPB packages can now omit the `version` field, as it's either embedded in the identifier (OCI) or not applicable (MCPB direct downloads). Publishers using npm, pypi, or nuget should continue to provide the `version` field as before.
30+
31+
**Example - OCI Package (version in identifier):**
32+
```json
33+
{
34+
"packages": [{
35+
"registryType": "oci",
36+
"identifier": "ghcr.io/modelcontextprotocol/server-example:v1.2.3",
37+
"transport": {
38+
"type": "stdio"
39+
}
40+
}]
41+
}
42+
```
43+
44+
**Example - MCPB Package (no version field):**
45+
```json
46+
{
47+
"packages": [{
48+
"registryType": "mcpb",
49+
"identifier": "https://github.com/example/releases/download/v1.0.0/package.mcpb",
50+
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
51+
"transport": {
52+
"type": "stdio"
53+
}
54+
}]
55+
}
56+
```
57+
58+
### Schema Version
59+
- Schema version: `2025-09-29``2025-10-11`
60+
561
## 2025-09-29
662

763
### ⚠️ BREAKING CHANGES

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-09-29/server.schema.json",
3+
"$id": "https://static.modelcontextprotocol.io/schemas/2025-10-11/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-09-29/server.schema.json",
376+
"example": "https://static.modelcontextprotocol.io/schemas/2025-10-11/server.schema.json",
377377
"format": "uri",
378378
"type": "string"
379379
},

tools/extract-server-schema/main.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ func main() {
3333
log.Fatalf("Failed to parse OpenAPI YAML: %v", err)
3434
}
3535

36+
// Extract version from info section
37+
info, ok := openapi["info"].(map[string]interface{})
38+
if !ok {
39+
log.Fatal("Missing 'info' in OpenAPI spec")
40+
}
41+
version, ok := info["version"].(string)
42+
if !ok {
43+
log.Fatal("Missing 'info.version' in OpenAPI spec")
44+
}
45+
3646
// Extract components/schemas
3747
components, ok := openapi["components"].(map[string]interface{})
3848
if !ok {
@@ -78,11 +88,12 @@ func main() {
7888
}
7989
}
8090

81-
// Build the JSON Schema document
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)
8293
jsonSchema := map[string]interface{}{
8394
"$comment": "This file is auto-generated from docs/reference/api/openapi.yaml. Do not edit manually. Run 'make generate-schema' to update.",
8495
"$schema": "http://json-schema.org/draft-07/schema#",
85-
"$id": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
96+
"$id": schemaID,
8697
"title": "server.json defining a Model Context Protocol (MCP) server",
8798
"$ref": "#/definitions/ServerDetail",
8899
"definitions": definitions,

0 commit comments

Comments
 (0)