Skip to content

generate:schema:json produces empty schemas when using wildcard type on Windows #3114

Description

@vortsghost2025

What's broken?

The spec defines behavior that doesn't work in practice

Where in the spec or docs?

https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/scripts/generate-schemas.ts#L63-L67

What should happen?

npm run generate:schema:json should generate complete JSON schemas containing all exported protocol types. The generated draft schema should include definitions such as AudioContent, and npm run check:schema:examples should pass.

What actually happens?

On a clean checkout, npm run generate:schema:json exits successfully but replaces all five schema files with nearly empty schemas.

For schema/draft/schema.json:

$defs: 0
AudioContent: false

Running npm run check:schema:examples afterward reports:

Results: 0 passed, 128 failed

The generated diff is:

5 files changed, 5 insertions(+), 14713 deletions(-)

Anything else?

Environment:

  • Windows 11
  • PowerShell 7.6.3
  • Node.js 24.2.0
  • npm 11.12.1
  • Dependencies installed with npm ci
  • Clean git working tree before reproduction

The failure appears specific to wildcard type discovery.

This command produces an empty schema:

npx typescript-json-schema --defaultNumberType integer --required --skipLibCheck "schema/draft/schema.ts" "*" -o output.json

Generating one named type works correctly:

npx typescript-json-schema --defaultNumberType integer --required --skipLibCheck "schema/draft/schema.ts" "AudioContent" -o output.json

Named-type result:

bytes: 4015
type: object
properties: [ '_meta', 'annotations', 'data', 'mimeType', 'type' ]
definitions: 3

I also reproduced the empty wildcard result with both typescript-json-schema 0.67.4 and 0.68.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions