Bootstrap repo with TypeScript types and JSON Schema for SEP-2127#1
Merged
SamMorrowDrums merged 1 commit intoApr 27, 2026
Merged
Conversation
Tracks SEP-2127 (MCP Server Cards) as an experimental extension while the SEP
itself is under review. The schema.ts is structured to be lifted directly into
schema/draft/schema.ts of the main spec when Server Cards graduate -- only the
inlined MetaObject and Icon definitions need to be removed during migration.
- schema.ts: ServerCard, Server, Repository, Remote, Package, Argument, Input,
KeyValueInput, etc. plus inlined MetaObject and Icon
- scripts/generate-schema.ts: typescript-json-schema with 2020-12 transforms
- scripts/validate-examples.ts: ajv validator over examples/{ServerCard,Server}/
- examples/: 2 valid + 4 invalid Server Card cases, 1 valid Server case
- README: status, layout, schema URL conventions, graduation plan
- CI workflow: check + validate + format on every PR
9 tasks
SamMorrowDrums
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bootstraps this repo with a TypeScript source-of-truth and generated JSON Schema for MCP Server Cards (SEP-2127) — the static metadata document that lets clients discover and connect to a remote MCP server before initialization.
This relaunches work originally proposed against the core spec in modelcontextprotocol#2652 as an experimental extension, since the SEP itself is still under review and the right home for in-flight types is here, not in
schema/draft/schema.ts.What's in the box
schema.ts— single-file TypeScript source of truth withServerCard,Server,Remote,Package,Repository,Argument,Input,KeyValueInput,PackageTransport(stdio / streamable-http / sse), and inlinedMetaObject/Iconso the file is self-contained.schema.json— generated JSON Schema 2020-12, checked in so consumers can grab it without running the toolchain.scripts/generate-schema.ts— runstypescript-json-schema --defaultNumberType integer --required --skipLibCheckand applies the same draft-07 → 2020-12 post-processing the upstream MCP spec uses.scripts/validate-examples.ts— ajv 2020-12 validator that walksexamples/{ServerCard,Server}/{valid,invalid}/and asserts each fixture validates / rejects as expected.examples/— 2 valid + 4 invalidServerCardfixtures and 1 validServerfixture covering required-field omission, name pattern, schema URL form, and a templated remote with header variables..github/workflows/ci.yml— runsnpm run check(regen + tsc) andnpm run validateandnpm run format:checkon every PR.README.md— replaces the empty stub with status, layout, schema-URL conventions (/v1/form), and a graduation plan back intoschema/draft/schema.tsof the main spec.Schema URL conventions
The
$schemafield on every Server Card / Server document is required and constrained to:Schema URLs are versioned by their
vNsegment rather than by date so additive revisions of the v1 shape don't bump every published document's$schema.Graduation plan
When SEP-2127 is accepted, the contents of
schema.tshere move directly intoschema/draft/schema.tsofmodelcontextprotocol/modelcontextprotocol. The inlinedMetaObject/Icondefinitions are dropped during migration since they already exist in the main spec. Documents update their$schemato point at the main spec's hosted schema URL, and this repository is archived.Verification
npm run generateproducedschema.jsonfromschema.ts(2020-12,$defs, draft 2020-12$schemaURL).npm run checkpasses (regenerated schema matches checked-inschema.json;tsc --noEmitclean).npm run validatepasses — 7/7 fixtures behave as expected (2 validServerCard, 4 invalidServerCardrejected, 1 validServer):npm run format:checkpasses — all files conform to Prettier defaults.🤖 Generated with Claude Code