Clean up schema by simplifying version structure (#379)
## Summary Simplified the schema structure by: - Replacing `version_detail.version` with direct `version` field - Removing unused `release_date` field from seed data - Updating all API types, models, and tests to match new structure - Maintaining backwards compatibility in API responses This change makes the schema more intuitive and reduces nesting depth.
This commit is contained in:
parent
f51c187e52
commit
f975e68cf2
5 changed files with 540 additions and 1973 deletions
|
|
@ -38,10 +38,7 @@ curl https://registry.example.com/v0/servers?limit=10
|
|||
"name": "io.modelcontextprotocol/filesystem",
|
||||
"description": "Filesystem operations server",
|
||||
"status": "active",
|
||||
"version_detail": {
|
||||
"version": "1.0.2",
|
||||
"is_latest": true
|
||||
}
|
||||
"version": "1.0.2"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
|
|
@ -97,8 +97,7 @@ paths:
|
|||
repository:
|
||||
url: "https://github.com/modelcontextprotocol/servers"
|
||||
source: "github"
|
||||
version_detail:
|
||||
version: "1.0.2"
|
||||
version: "1.0.2"
|
||||
packages:
|
||||
- registry_type: "npm"
|
||||
registry_base_url: "https://registry.npmjs.org"
|
||||
|
|
@ -120,8 +119,7 @@ paths:
|
|||
repository:
|
||||
url: "https://github.com/example/mcp-demo"
|
||||
source: "github"
|
||||
version_detail:
|
||||
version: "1.0.0"
|
||||
version: "1.0.0"
|
||||
packages:
|
||||
- registry_type: "npm"
|
||||
registry_base_url: "https://registry.npmjs.org"
|
||||
|
|
@ -213,7 +211,7 @@ components:
|
|||
required:
|
||||
- name
|
||||
- description
|
||||
- version_detail
|
||||
- version
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
|
|
@ -231,8 +229,10 @@ components:
|
|||
example: "active"
|
||||
repository:
|
||||
$ref: '#/components/schemas/Repository'
|
||||
version_detail:
|
||||
$ref: '#/components/schemas/VersionDetail'
|
||||
version:
|
||||
type: string
|
||||
example: "1.0.2"
|
||||
description: "Version string for this server. SHOULD follow semantic versioning (e.g., '1.0.2', '2.1.0-alpha'). Equivalent of Implementation.version in MCP specification."
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
|
@ -240,26 +240,6 @@ components:
|
|||
type: string
|
||||
format: date-time
|
||||
|
||||
VersionDetail:
|
||||
type: object
|
||||
required:
|
||||
- version
|
||||
- release_date
|
||||
- is_latest
|
||||
properties:
|
||||
version:
|
||||
type: string
|
||||
example: "1.0.2"
|
||||
description: Equivalent of Implementation.version in MCP specification.
|
||||
release_date:
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2023-06-15T10:30:00Z"
|
||||
description: Datetime that the MCP server version was published to the registry.
|
||||
is_latest:
|
||||
type: boolean
|
||||
example: true
|
||||
description: Whether the MCP server version is the latest version available in the registry.
|
||||
|
||||
ServerList:
|
||||
type: object
|
||||
|
|
@ -535,10 +515,5 @@ components:
|
|||
type: boolean
|
||||
description: Whether this is the latest version of the server
|
||||
example: true
|
||||
release_date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Release date of the server version
|
||||
example: "2023-12-01T10:30:00Z"
|
||||
additionalProperties: false
|
||||
additionalProperties: true
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ mcp-publisher init [options]
|
|||
{
|
||||
"name": "io.github.username/server-name",
|
||||
"description": "TODO: Add server description",
|
||||
"version_detail": { "version": "1.0.0" },
|
||||
"version": "1.0.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ The official registry has some more restrictions on top of this. See the [offici
|
|||
"url": "https://github.com/modelcontextprotocol/servers",
|
||||
"source": "github"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"version": "1.0.2",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
@ -79,9 +77,7 @@ For MCP servers located within a subdirectory of a larger repository (monorepo s
|
|||
"source": "github",
|
||||
"subfolder": "src/everything"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "0.6.2"
|
||||
},
|
||||
"version": "0.6.2",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
@ -113,9 +109,7 @@ Suppose your MCP server application requires a `mcp start` CLI arguments to star
|
|||
{
|
||||
"name": "io.github.joelverhagen/knapcode-samplemcpserver",
|
||||
"description": "Sample NuGet MCP server for a random number and random weather",
|
||||
"version_detail": {
|
||||
"version": "0.4.0-beta"
|
||||
},
|
||||
"version": "0.4.0-beta",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "nuget",
|
||||
|
|
@ -165,9 +159,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
|
|||
"source": "github",
|
||||
"id": "b94b5f7e-c7c6-d760-2c78-a5e9b8a5b8c9"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"version": "1.0.2",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
@ -267,9 +259,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
|
|||
"source": "github",
|
||||
"id": "xyz789ab-cdef-0123-4567-890ghijklmno"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "2.0.0"
|
||||
},
|
||||
"version": "2.0.0",
|
||||
"remotes": [
|
||||
{
|
||||
"type": "sse",
|
||||
|
|
@ -302,9 +292,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
|
|||
"source": "github",
|
||||
"id": "def456gh-ijkl-7890-mnop-qrstuvwxyz12"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "0.5.0"
|
||||
},
|
||||
"version": "0.5.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "pypi",
|
||||
|
|
@ -358,9 +346,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
|
|||
"source": "github",
|
||||
"id": "example-nuget-id-0000-1111-222222222222"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "0.5.0"
|
||||
},
|
||||
"version": "0.5.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "nuget",
|
||||
|
|
@ -408,9 +394,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
|
|||
"source": "github",
|
||||
"id": "ghi789jk-lmno-1234-pqrs-tuvwxyz56789"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "3.1.0"
|
||||
},
|
||||
"version": "3.1.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "oci",
|
||||
|
|
@ -521,9 +505,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
|
|||
"source": "github",
|
||||
"id": "klm012no-pqrs-3456-tuvw-xyz789abcdef"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "1.5.0"
|
||||
},
|
||||
"version": "1.5.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
@ -606,9 +588,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
|
|||
"url": "https://github.com/modelcontextprotocol/text-editor-mcpb",
|
||||
"source": "github"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"version": "1.0.2",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "mcpb",
|
||||
|
|
@ -649,9 +629,7 @@ Some CLI tools bundle an MCP server, without a standalone MCP package or a publi
|
|||
"name": "io.snyk/cli-mcp",
|
||||
"description": "MCP server provided by the Snyk CLI",
|
||||
"status": "active",
|
||||
"version_detail": {
|
||||
"version": "1.1298.0"
|
||||
},
|
||||
"version": "1.1298.0",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
@ -688,9 +666,7 @@ Some CLI tools bundle an MCP server, without a standalone MCP package or a publi
|
|||
"source": "github",
|
||||
"id": "legacy-abc123-def456-789012-345678-901234567890"
|
||||
},
|
||||
"version_detail": {
|
||||
"version": "0.9.5"
|
||||
},
|
||||
"version": "0.9.5",
|
||||
"packages": [
|
||||
{
|
||||
"registry_type": "npm",
|
||||
|
|
|
|||
|
|
@ -35,27 +35,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"VersionDetail": {
|
||||
"type": "object",
|
||||
"description": "Version information for this server. Defined as an object to allow for downstream extensibility (e.g. release_date)",
|
||||
"required": [
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"example": "1.0.2",
|
||||
"description": "Version string for this server. SHOULD follow semantic versioning (e.g., '1.0.2', '2.1.0-alpha'). Equivalent of Implementation.version in MCP specification. Non-semantic versions are allowed but may not sort predictably."
|
||||
}
|
||||
}
|
||||
},
|
||||
"Server": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"version_detail"
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
|
|
@ -83,8 +68,11 @@
|
|||
"$ref": "#/$defs/Repository",
|
||||
"description": "Optional repository metadata for the MCP server source code. Recommended for transparency and security inspection."
|
||||
},
|
||||
"version_detail": {
|
||||
"$ref": "#/$defs/VersionDetail"
|
||||
"version": {
|
||||
"type": "string",
|
||||
"maxLength": 255,
|
||||
"example": "1.0.2",
|
||||
"description": "Version string for this server. SHOULD follow semantic versioning (e.g., '1.0.2', '2.1.0-alpha'). Equivalent of Implementation.version in MCP specification. Non-semantic versions are allowed but may not sort predictably."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue