fix: update server.json examples in publishing guide to be valid (#524)
- Add missing required fields (description, transport) to all server.json examples - Add $schema field to examples that were missing it - Add version field to MCPB example - Create validation tool for guide examples with $schema - Integrate guide validation into Makefile and CI Fixes #507 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: adam jones <domdomegg@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5746e7e99b
commit
9d184933c5
2 changed files with 130 additions and 69 deletions
|
|
@ -100,7 +100,10 @@ This creates a `server.json` with auto-detected values. You'll see something lik
|
|||
{
|
||||
"registryType": "npm",
|
||||
"identifier": "your-package-name",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -148,12 +151,18 @@ Add an `mcpName` field to your `package.json`:
|
|||
### Example server.json
|
||||
```json
|
||||
{
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides npm package functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "npm",
|
||||
"identifier": "your-npm-package",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -180,12 +189,18 @@ Add it to your README.md file (which becomes the package description on PyPI). T
|
|||
### Example server.json
|
||||
```json
|
||||
{
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides PyPI package functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "pypi",
|
||||
"identifier": "your-pypi-package",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -212,12 +227,18 @@ Add a README file to your NuGet package that includes the server name. This can
|
|||
### Example server.json
|
||||
```json
|
||||
{
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides NuGet package functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "nuget",
|
||||
"identifier": "Your.NuGet.Package",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -248,13 +269,19 @@ LABEL io.modelcontextprotocol.server.name="io.github.username/server-name"
|
|||
### Example server.json (Docker Hub)
|
||||
```json
|
||||
{
|
||||
"name": "io.github.username/server-name",
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides Docker container functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "oci",
|
||||
"registryBaseUrl": "https://docker.io",
|
||||
"identifier": "yourusername/your-mcp-server",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -263,13 +290,19 @@ LABEL io.modelcontextprotocol.server.name="io.github.username/server-name"
|
|||
### Example server.json (GitHub Container Registry)
|
||||
```json
|
||||
{
|
||||
"name": "io.github.username/server-name",
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides GitHub container functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "oci",
|
||||
"registryBaseUrl": "https://ghcr.io",
|
||||
"identifier": "yourusername/your-mcp-server",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.0",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -299,12 +332,19 @@ openssl dgst -sha256 server.mcpb
|
|||
### Example server.json
|
||||
```json
|
||||
{
|
||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "A server that provides MCPB package functionality",
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "mcpb",
|
||||
"identifier": "https://github.com/you/your-repo/releases/download/v1.0.0/server.mcpb",
|
||||
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce"
|
||||
"version": "1.0.0",
|
||||
"fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
|
||||
"transport": {
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,12 +267,6 @@ components:
|
|||
format: uri
|
||||
description: "Optional URL to the server's homepage, documentation, or project website. This provides a central link for users to learn more about the server. Particularly useful when the server has custom installation instructions or setup requirements."
|
||||
example: "https://modelcontextprotocol.io/examples"
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
|
||||
ServerList:
|
||||
|
|
@ -527,9 +521,9 @@ components:
|
|||
required:
|
||||
- serverId
|
||||
- versionId
|
||||
- published_at
|
||||
- updated_at
|
||||
- is_latest
|
||||
- publishedAt
|
||||
- updatedAt
|
||||
- isLatest
|
||||
properties:
|
||||
serverId:
|
||||
type: string
|
||||
|
|
@ -541,17 +535,17 @@ components:
|
|||
format: uuid
|
||||
description: Unique ID for this specific version
|
||||
example: "773f9b2e-1a47-4c8d-b5e6-2f8d9c4a7b3e"
|
||||
published_at:
|
||||
publishedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the server was first published to the registry
|
||||
example: "2023-12-01T10:30:00Z"
|
||||
updated_at:
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the server entry was last updated
|
||||
example: "2023-12-01T11:00:00Z"
|
||||
is_latest:
|
||||
isLatest:
|
||||
type: boolean
|
||||
description: Whether this is the latest version of the server
|
||||
example: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue