Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository:modelcontextprotocol/typescript-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base:b093040
Choose a base ref
...
head repository:modelcontextprotocol/typescript-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare:400cfa6
Choose a head ref
  • 1 commit
  • 7 files changed
  • 2 contributors

Commits on Dec 12, 2025

  1. feat: add library-based ts-to-zod schema generation

    Add auto-generated Zod schemas from spec.types.ts using ts-to-zod as a library, with post-processing for SDK compatibility. ## What's New - `src/generated/spec.schemas.ts` - 145 auto-generated Zod schemas - `src/generated/index.ts` - Public API with explicit exports by name - `test/generated/spec.schemas.compare.test.ts` - 97 tests verifying equivalence - `scripts/generate-schemas.ts` - Library-based generator with post-processing ## Post-Processing The generator applies several transformations for SDK compatibility: 1. **Zod v4 import** - `"zod"` → `"zod/v4"` 2. **Index signatures** - `z.record().and(z.object())` → `z.looseObject()` 3. **typeof expressions** - `jsonrpc: z.any()` → `z.literal("2.0")` 4. **SDK hierarchy** - Notifications/Requests extend `NotificationSchema`/`RequestSchema` 5. **Integer refinements** - `ProgressTokenSchema`, `RequestIdSchema` use `.int()` ## Usage ```typescript import{ProgressTokenSchema } from '@modelcontextprotocol/sdk/generated'; ``` ## Design - **types.ts unchanged** - Full refactor to thin re-export layer deferred - **Explicit exports** - Each schema/type listed by name for legibility - **No description duplication** - spec.types.ts kept clean (no @description injection) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
    @ochafik@claude
    ochafik and claude committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    400cfa6View commit details
    Browse the repository at this point in the history
Loading