Skip to content

docs: add Server Cards (SEP-2127) usage guide#1

Open
tadasant wants to merge 1 commit into
SamMorrowDrums:experimental-server-card-v2from
tadasant:docs/server-cards-guide
Open

docs: add Server Cards (SEP-2127) usage guide#1
tadasant wants to merge 1 commit into
SamMorrowDrums:experimental-server-card-v2from
tadasant:docs/server-cards-guide

Conversation

@tadasant

@tadasant tadasant commented Jun 26, 2026

Copy link
Copy Markdown

What this adds

Documentation for the experimental MCP Server Cards (SEP-2127) + AI Catalog discovery feature you built on experimental-server-card-v2. The feature shipped without docs; this PR adds a guide so the capability is discoverable and usable.

  • docs/advanced/server-cards.md — a full guide: what a Server Card / AI Catalog is (leads with an experimental / opt-in warning), a discovery sequence diagram, the card fields, building & serving a card on an ASGI app, static-file hosting, discovery HTTP semantics (DISCOVERY_HEADERS, strong-ETag conditional GET / 304, the /.well-known/ai-catalog.json path with /.well-known/mcp/catalog.json fallback), client-side discovery, and the urn:air: identifier derivation.
  • docs_src/server_cards/tutorial00{1..4}.py — the runnable snippets the page embeds via --8<--, written against the real public signatures (build_server_card, mount_server_card, mount_ai_catalog, server_card_entry, discover_server_cards, fetch_ai_catalog/fetch_server_card, the low-level Server).
  • mkdocs.yml — one nav line adding the page under Advanced.

Scope

Additive and docs-only. No src/ or tests/ changes — the single non-doc edit is the one-line nav entry. It targets experimental-server-card-v2 so it folds into modelcontextprotocol#2951 alongside the code it documents.

git diff --stat vs the base:

 docs/advanced/server-cards.md        | 170 +++++++++++++++++++++++++++++++++++
 docs_src/server_cards/__init__.py    |   0
 docs_src/server_cards/tutorial001.py |  36 ++++++++
 docs_src/server_cards/tutorial002.py |  29 ++++++
 docs_src/server_cards/tutorial003.py |  11 +++
 docs_src/server_cards/tutorial004.py |  21 +++++
 mkdocs.yml                           |   1 +
 7 files changed, 268 insertions(+)

Verification

  • Snippets type-check: uv run pyright docs_src/server_cards0 errors, 0 warnings, 0 informations.
  • Structural invariants: uv run pytest tests/docs_src/test_shape.py451 passed — the new chapter imports cleanly against the current SDK, uses only public mcp modules, and every snippet is included by the page.
  • Docs build strictly: scripts/docs/build.sh (Zensical --strict + check_crossrefs.py + llms_txt.py) → exit 0, No issues found; site/advanced/server-cards/index.html renders with all four snippets embedded.

Notes

  • Scoped to documenting the feature as built — no behavior changes. In particular I did not touch the 304 branch in discovery_response (ai_catalog.py) that drops the CORS headers; that's already flagged inline on Add experimental Server Cards support (SEP-2127) modelcontextprotocol/python-sdk#2951 and is out of scope here.
  • Snippets use the low-level Server for the server-side examples (matching this branch's own tests/experimental/server_card/test_server.py), since build_server_card reads plain identity attributes.

🤖 Opened via Claude Code, on behalf of @tadasant.

@SamMorrowDrums SamMorrowDrums force-pushed the experimental-server-card-v2 branch from 3c4d2b0 to 9f42184 Compare July 13, 2026 19:52
🤖 Authored via Claude Code, on behalf of @tadasant.
@tadasant tadasant force-pushed the docs/server-cards-guide branch from 89e0f23 to 8bbe795 Compare July 15, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant