Skip to content

Commit 0828bc4

Browse files
authored
Make mcpb package version optional and fix schema validation (#686)
<!-- Provide a brief summary of your changes --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The following PR: * Makes mcpb package version property optional * Bumps the schema and reflects that in the code * Makes sure the publisher tests are being covered by doing `make check` ## 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 f870a4c commit 0828bc4

File tree

16 files changed

+131
-81
lines changed

16 files changed

+131
-81
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test-unit: ## Run unit tests with coverage (requires PostgreSQL)
3232
@echo "Waiting for PostgreSQL to be ready..."
3333
@sleep 3
3434
@echo "Running unit tests..."
35-
go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/...
35+
go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/... ./cmd/...
3636
go tool cover -html=coverage.out -o coverage.html
3737
@echo "Coverage report generated: coverage.html"
3838
@echo "Stopping PostgreSQL..."

cmd/publisher/commands/publish_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func TestPublishCommand_DeprecatedSchema(t *testing.T) {
4444
errorSubstr: "deprecated schema detected",
4545
},
4646
{
47-
name: "current 2025-09-29 schema should pass validation",
48-
schema: "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
47+
name: "current 2025-10-17 schema should pass validation",
48+
schema: "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
4949
expectError: false,
5050
},
5151
{

data/seed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
3+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
44
"name": "io.github.domdomegg/airtable-mcp-server",
55
"description": "Read and write access to Airtable database schemas, tables, and records.",
66
"repository": {
@@ -62,7 +62,7 @@
6262
]
6363
},
6464
{
65-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
65+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
6666
"name": "io.github.domdomegg/airtable-mcp-server",
6767
"description": "Read and write access to Airtable database schemas, tables, and records.",
6868
"repository": {
@@ -115,7 +115,7 @@
115115
]
116116
},
117117
{
118-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
118+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
119119
"name": "io.github.domdomegg/time-mcp-nuget",
120120
"description": "Get the current UTC time in RFC 3339 format.",
121121
"repository": {
@@ -136,7 +136,7 @@
136136
]
137137
},
138138
{
139-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
139+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
140140
"name": "io.github.domdomegg/time-mcp-pypi",
141141
"description": "Get the current UTC time in RFC 3339 format.",
142142
"repository": {

docs/guides/consuming/use-rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ You can also add custom metadata to servers using the `_meta` field. For example
6767

6868
```json
6969
{
70-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
70+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
7171
"name": "io.github.yourname/weather-server",
7272
"description": "MCP server for weather data access",
7373
"status": "active",

docs/guides/publishing/publish-server.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This creates a `server.json` with auto-detected values. You'll see something lik
9393

9494
```json
9595
{
96-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
96+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
9797
"name": "io.github.yourname/weather-data-mcp",
9898
"title": "Weather Data",
9999
"description": "Access real-time weather data and forecasts",
@@ -153,7 +153,7 @@ Add an `mcpName` field to your `package.json`:
153153
### Example server.json
154154
```json
155155
{
156-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
156+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
157157
"name": "io.github.username/slack-integration-mcp",
158158
"title": "Slack Integration",
159159
"description": "Send messages and manage Slack workspaces",
@@ -192,7 +192,7 @@ Add it to your README.md file (which becomes the package description on PyPI). T
192192
### Example server.json
193193
```json
194194
{
195-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
195+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
196196
"name": "io.github.username/database-query-mcp",
197197
"title": "Database Query",
198198
"description": "Execute SQL queries and manage database connections",
@@ -231,7 +231,7 @@ Add a README file to your NuGet package that includes the server name. This can
231231
### Example server.json
232232
```json
233233
{
234-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
234+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
235235
"name": "io.github.username/azure-devops-mcp",
236236
"title": "Azure DevOps",
237237
"description": "Manage Azure DevOps work items and pipelines",
@@ -274,17 +274,15 @@ LABEL io.modelcontextprotocol.server.name="io.github.username/server-name"
274274
### Example server.json (Docker Hub)
275275
```json
276276
{
277-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
277+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
278278
"name": "io.github.username/kubernetes-manager-mcp",
279279
"title": "Kubernetes Manager",
280280
"description": "Deploy and manage Kubernetes resources",
281281
"version": "1.0.0",
282282
"packages": [
283283
{
284284
"registryType": "oci",
285-
"registryBaseUrl": "https://docker.io",
286-
"identifier": "yourusername/kubernetes-manager-mcp",
287-
"version": "1.0.0",
285+
"identifier": "docker.io/yourusername/kubernetes-manager-mcp:1.0.0",
288286
"transport": {
289287
"type": "stdio"
290288
}
@@ -296,17 +294,15 @@ LABEL io.modelcontextprotocol.server.name="io.github.username/server-name"
296294
### Example server.json (GitHub Container Registry)
297295
```json
298296
{
299-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
297+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
300298
"name": "io.github.username/git-operations-mcp",
301299
"title": "Git Operations",
302300
"description": "Advanced Git repository management and operations",
303301
"version": "1.0.0",
304302
"packages": [
305303
{
306304
"registryType": "oci",
307-
"registryBaseUrl": "https://ghcr.io",
308-
"identifier": "username/git-operations-mcp",
309-
"version": "1.0.0",
305+
"identifier": "ghcr.io/username/git-operations-mcp:1.0.0",
310306
"transport": {
311307
"type": "stdio"
312308
}
@@ -315,9 +311,9 @@ LABEL io.modelcontextprotocol.server.name="io.github.username/server-name"
315311
}
316312
```
317313

318-
The identifier is `namespace/repository`, and version is the tag and optionally digest.
314+
The identifier format is `registry/namespace/repository:tag` (e.g., `docker.io/user/app:1.0.0` or `ghcr.io/user/app:1.0.0`). The version can also be specified as a digest.
319315

320-
The official MCP registry currently supports Docker Hub (`https://docker.io`) and GitHub Container Registry (`https://ghcr.io`).
316+
The official MCP registry currently supports Docker Hub (`docker.io`) and GitHub Container Registry (`ghcr.io`).
321317

322318
</details>
323319

@@ -339,7 +335,7 @@ openssl dgst -sha256 server.mcpb
339335
### Example server.json
340336
```json
341337
{
342-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
338+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
343339
"name": "io.github.username/image-processor-mcp",
344340
"title": "Image Processor",
345341
"description": "Process and transform images with various filters",
@@ -348,7 +344,6 @@ openssl dgst -sha256 server.mcpb
348344
{
349345
"registryType": "mcpb",
350346
"identifier": "https://github.com/username/image-processor-mcp/releases/download/v1.0.0/image-processor.mcpb",
351-
"version": "1.0.0",
352347
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
353348
"transport": {
354349
"type": "stdio"
@@ -385,7 +380,7 @@ Add the `remotes` field to your `server.json` (can coexist with `packages`):
385380

386381
```json
387382
{
388-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
383+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
389384
"name": "com.yourcompany/acme-analytics",
390385
"title": "ACME Analytics",
391386
"description": "Real-time business intelligence and reporting platform",

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-10-11/server-registry-openapi
3+
$id: https://modelcontextprotocol.io/schemas/draft/2025-10-17/server-registry-openapi
44
info:
55
title: MCP Server Registry API
6-
version: "2025-10-11"
6+
version: "2025-10-17"
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-10-11/server.schema.json"
619+
example: "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json"
620620
packages:
621621
type: array
622622
items:

docs/reference/server-json/CHANGELOG.md

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

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

5+
## 2025-10-17
6+
7+
### Changed
8+
9+
The `version` field is now **optional** for MCPB packages, providing flexibility for publishers.
10+
11+
**Key Changes:**
12+
13+
- **MCPB packages can now include an optional `version` field** - Previously rejected by validation, MCPB packages can now optionally specify a version field for clarity and metadata purposes.
14+
- **Both formats are valid**:
15+
- MCPB packages **with** version field: Provides explicit version metadata
16+
- MCPB packages **without** version field: Version information is embedded in the download URL (as before)
17+
18+
**Migration:**
19+
20+
Publishers using MCPB packages can optionally add a `version` field to their package configuration. This is particularly useful when:
21+
- The version information is not clearly visible in the download URL
22+
- You want to provide explicit version metadata for tooling and clients
23+
- You need consistent version tracking across different package types
24+
25+
Existing MCPB packages without the version field continue to work without any changes.
26+
27+
**Example - MCPB Package with optional version:**
28+
```json
29+
{
30+
"packages": [{
31+
"registryType": "mcpb",
32+
"identifier": "https://github.com/example/releases/download/v1.0.0/package.mcpb",
33+
"version": "1.0.0",
34+
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
35+
"transport": {
36+
"type": "stdio"
37+
}
38+
}]
39+
}
40+
```
41+
42+
**Example - MCPB Package without version (still valid):**
43+
```json
44+
{
45+
"packages": [{
46+
"registryType": "mcpb",
47+
"identifier": "https://github.com/example/releases/download/v1.0.0/package.mcpb",
48+
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
49+
"transport": {
50+
"type": "stdio"
51+
}
52+
}]
53+
}
54+
```
55+
56+
### Schema Version
57+
- Schema version: `2025-10-11``2025-10-17`
58+
559
## 2025-10-11
660

761
### Changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The official registry has some more restrictions on top of this. See the [offici
2222

2323
```json
2424
{
25-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
25+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
2626
"name": "io.modelcontextprotocol.anonymous/brave-search",
2727
"description": "MCP server for Brave Search API integration",
2828
"title": "Brave Search",
@@ -69,7 +69,7 @@ For MCP servers located within a subdirectory of a larger repository (monorepo s
6969

7070
```json
7171
{
72-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
72+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
7373
"name": "io.modelcontextprotocol/everything",
7474
"description": "MCP server that exercises all the features of the MCP protocol",
7575
"title": "Everything",
@@ -108,7 +108,7 @@ Suppose your MCP server application requires a `mcp start` CLI arguments to star
108108

109109
```json
110110
{
111-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
111+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
112112
"name": "io.github.joelverhagen/knapcode-samplemcpserver",
113113
"description": "Sample NuGet MCP server for a random number and random weather",
114114
"version": "0.4.0-beta",
@@ -152,7 +152,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
152152

153153
```json
154154
{
155-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
155+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
156156
"name": "io.github.modelcontextprotocol/filesystem",
157157
"description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations.",
158158
"title": "Filesystem",
@@ -252,7 +252,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
252252

253253
```json
254254
{
255-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
255+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
256256
"name": "io.modelcontextprotocol.anonymous/mcp-fs",
257257
"description": "Cloud-hosted MCP filesystem server",
258258
"repository": {
@@ -286,7 +286,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
286286

287287
```json
288288
{
289-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
289+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
290290
"name": "io.github.example/weather-mcp",
291291
"description": "Python MCP server for weather data access",
292292
"title": "Weather",
@@ -342,7 +342,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
342342

343343
```json
344344
{
345-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
345+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
346346
"name": "io.github.joelverhagen/knapcode-samplemcpserver",
347347
"description": "Sample NuGet MCP server for a random number and random weather",
348348
"repository": {
@@ -391,7 +391,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
391391

392392
```json
393393
{
394-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
394+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
395395
"name": "io.github.example/database-manager",
396396
"description": "MCP server for database operations with support for multiple database types",
397397
"repository": {
@@ -500,7 +500,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
500500

501501
```json
502502
{
503-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
503+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
504504
"name": "io.modelcontextprotocol.anonymous/hybrid-mcp",
505505
"description": "MCP server available as both local package and remote service",
506506
"title": "Hybrid",
@@ -586,7 +586,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
586586

587587
```json
588588
{
589-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
589+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
590590
"name": "io.modelcontextprotocol/text-editor",
591591
"description": "MCP Bundle server for advanced text editing capabilities",
592592
"title": "Text Editor",
@@ -629,7 +629,7 @@ Some CLI tools bundle an MCP server, without a standalone MCP package or a publi
629629

630630
```json
631631
{
632-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
632+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
633633
"name": "io.snyk/cli-mcp",
634634
"description": "MCP server provided by the Snyk CLI",
635635
"title": "Snyk",
@@ -664,7 +664,7 @@ For MCP servers that follow a custom installation path or are embedded in applic
664664

665665
```json
666666
{
667-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
667+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
668668
"name": "io.modelcontextprotocol.anonymous/embedded-mcp",
669669
"description": "MCP server embedded in a Desktop app",
670670
"websiteUrl": "https://anonymous.modelcontextprotocol.io/embedded-mcp-guide",

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

0 commit comments

Comments
 (0)