Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> #### **Status:** Experimental. This work is for prototyping and feedback only, and is not an accepted or official MCP extension.

This repository defines a TypeScript source-of-truth and generated JSON Schema for **MCP Server Cards** a static metadata document that describes a remote MCP server enough for clients to discover and connect to it before initialization.
This repository defines a TypeScript source-of-truth and generated JSON Schema for **MCP Server Cards**. Server Cards are a static metadata document that describes a remote MCP server enough for clients to discover and connect to it before initialization.

It tracks [SEP-2127](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2127) and is intended to be lifted directly into the main spec when Server Cards graduate (see [Graduation plan](#graduation-plan) below).

Expand All @@ -16,9 +16,13 @@ A **Server Card** is a JSON document — hosted at any unreserved URI, with `GET
- Its remote transport endpoints (URLs, headers, variable templates, supported protocol versions)
- Optional registry-style extension metadata (`_meta`)

The companion **Server** document is a strict superset that adds locally-runnable `packages` — it is the shape the [MCP Registry](https://github.com/modelcontextprotocol/registry) uses for `server.json`.
Server Cards intentionally omit primitive listings (tools, resources, prompts) — those remain subject to runtime listing via the protocol's standard list operations. They also intentionally omit local installation metadata — see [Relationship to the MCP Registry](#relationship-to-the-mcp-registry).

Server Cards intentionally omit primitive listings (tools, resources, prompts) — those remain subject to runtime listing via the protocol's standard list operations.
## Relationship to the MCP Registry

A Server Card describes **remote connectivity only**. Metadata for locally-installable servers, packages, registries (npm, PyPI, OCI, NuGet, MCPB), runtime hints, command-line arguments, environment variables, lives in the [MCP Registry](https://github.com/modelcontextprotocol/registry)'s [`server.json` schema](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/server-json/generic-server-json.md), which is owned by the registry, not by this extension.

Vendors who genuinely need to attach install hints to a Server Card can use namespaced [`_meta`](https://modelcontextprotocol.io/specification/latest/basic#meta) extension metadata, which remains the card's extension point.

## Layout

Expand All @@ -30,7 +34,6 @@ scripts/
validate-examples.ts # Validates examples/ against the generated schema
examples/
ServerCard/{valid,invalid} # Example Server Card documents
Server/{valid,invalid} # Example Server (registry-shaped) documents
```

The generated `schema.json` is checked into the repo so consumers can grab it without running the toolchain.
Expand All @@ -55,14 +58,14 @@ The `$schema` field on every document MUST be a URL of the form:
https://static.modelcontextprotocol.io/schemas/v1/<name>.schema.json
```

Schema URLs are versioned by their `vN` segment rather than by date, so additive revisions of the v1 shape don't bump every published document's `$schema`. Breaking changes would publish a `v2` family.
Schema URLs are versioned by their `vN` segment. Server Card objects are closed (`additionalProperties: false`): a document using a field the schema doesn't declare is rejected, and vendor-specific data belongs in namespaced `_meta`, which stays open. Once `v1` is published a breaking revision of the shape would publish a new `vN` family rather than mutating `v1` in place. The `v1` shape is still pre-release and card-only — it intentionally does not include the registry-shaped `Server` / `packages` types.

## Graduation plan

When the SEP is accepted and Server Cards graduate from this experimental extension:

1. The contents of `schema.ts` in this repo move into `schema/draft/schema.ts` of [`modelcontextprotocol/modelcontextprotocol`](https://github.com/modelcontextprotocol/modelcontextprotocol). The two `MetaObject` and `Icon` definitions inlined here at the bottom of `schema.ts` already exist in the main spec and are dropped from the migration.
2. The main spec's existing `scripts/generate-schemas.ts` regenerates `schema/draft/schema.json` (and downstream `docs/specification/draft/schema.mdx`) — no per-extension generator is required there.
2. The main spec's existing `scripts/generate-schemas.ts` regenerates `schema/draft/schema.json` (and downstream `docs/specification/draft/schema.mdx`) — no per-extension generator is required there. One caveat: this repo passes `--noExtraProps` to `typescript-json-schema`, which is what makes Server Card objects closed (`additionalProperties: false`) and rejects registry-style `packages` documents. The main spec's generator does not use that flag, so the closed-object behavior must be carried over (or re-expressed) during migration — otherwise the graduated schema would silently accept unknown properties again.
3. Published documents update their `$schema` to point at the main spec's hosted schema URL (e.g., `https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json` served from `modelcontextprotocol/static`).
4. This repository is archived with a pointer to the relevant section of `schema/draft/schema.ts` in the main spec.

Expand Down
27 changes: 0 additions & 27 deletions examples/Server/valid/with-package.json

This file was deleted.

19 changes: 19 additions & 0 deletions examples/ServerCard/invalid/with-packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",
"name": "example-org/with-packages",
"version": "0.4.2",
"description": "Package metadata belongs to the registry's server.json, not a Server Card.",
"remotes": [
{
"type": "streamable-http",
"url": "https://example.com/mcp"
}
],
"packages": [
{
"registryType": "npm",
"identifier": "@example-org/with-packages",
"transport": { "type": "stdio" }
}
]
}
6 changes: 6 additions & 0 deletions examples/ServerCard/invalid/wrong-schema-name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/v1/server.schema.json",
"name": "example-org/wrong-schema-name",
"version": "1.0.0",
"description": "References the removed registry server.json schema; only server-card.schema.json is valid in v1."
}
Loading
Loading