Adds a self-contained example package under examples/server-card showing
how clients can consume and validate an MCP Server Card and how servers
can generate and publish one.
- mcp_server_card/types.py: Pydantic port of the Server Card / Server schema,
following mcp.types conventions (camelCase wire format, reuses Icon).
- mcp_server_card/validation.py: JSON Schema validation against the bundled
schema plus semantic guards (e.g. rejecting version ranges).
- mcp_server_card/client.py: fetch/load + validate a card from the conventional
.well-known location.
- mcp_server_card/server.py: build a card and either write it to a file or serve
it from a Starlette app / MCPServer.
- mcp_server_card/cli.py: validate, fetch, and print the schema.
- examples/ and tests/ covering both the client and server flows.
Summary
Adds a self-contained example package under examples/server-card/ demonstrating
MCP Server Cards (SEP-2127)
in Python: clients consuming and validating a card, and servers generating and
publishing one. It ports the TypeScript source of truth in
experimental-ext-server-card
and follows mcp.types conventions, so the mcp_server_card/ library could later
be lifted into mcp/experimental/server_card/ largely unchanged.
A Server Card is a static metadata document (typically at
https://<host>/.well-known/mcp/server-card) describing a remote server's
identity, transport endpoints, and supported protocol versions, so a client can
discover and connect to it before initialization.
Layout
Design
Validation
Open questions