Skip to content

Conversation

@LucaButBoring
Copy link
Contributor

Adds a @ts-ignore comment to avoid a type error in consuming code when @cfworker/json-schema is not installed.

Motivation and Context

Currently, the @cfworker/json-schema peer dependency is marked as optional; however, if it is not installed, consuming packages will fail to typecheck unless they set skipLibCheck: true in their compiler options. This PR fixes this to ignore errors associated with that import, which will cause it to degrade to any if the package is not installed.

How Has This Been Tested?

Tested npm run typecheck in this repro before and after installing my local SDK build and making this change.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@LucaButBoring LucaButBoring requested a review from a team as a code owner December 3, 2025 19:59
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 3, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1229

commit: 974f526

@LucaButBoring LucaButBoring force-pushed the fix/json-schema-optional-dependencies branch from c7a48b6 to 3a8edf8 Compare December 3, 2025 20:01
@mattzcarey mattzcarey changed the title fix: add tsignore to make @cfworker/json-schema optional Remove type dependency on @cfworker/json-schema Dec 5, 2025
@mattzcarey
Copy link
Contributor

Updated to use a types packge for JSON schema not ts-ignore. Hope thats okay. Waiting on review from @KKonstantinov or @felixweinberger

@KKonstantinov KKonstantinov merged commit 7655eeb into modelcontextprotocol:main Dec 5, 2025
6 checks passed
@LucaButBoring LucaButBoring deleted the fix/json-schema-optional-dependencies branch December 5, 2025 17:15
@LucaButBoring
Copy link
Contributor Author

Should be fine since you added that as a required dep

@LucaButBoring
Copy link
Contributor Author

Confirmed working against the repro

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.

3 participants