-
Notifications
You must be signed in to change notification settings - Fork 294
typescript: upgrade MCP SDK to 1.22.0 #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades the @modelcontextprotocol/sdk dependency from versions 1.11.x and 1.16.x to 1.22.0 across the monorepo. The upgrade includes necessary type fixes where Resource is replaced with EmbeddedResource['resource'] to align with the SDK's updated type structure, and adds proper type guards using the 'in' operator for property existence checks.
Key Changes
- Updated SDK version to 1.22.0 in all package.json files and pnpm-lock.yaml
- Replaced
Resourcetype withEmbeddedResource['resource']in client SDK components and tests - Added type guards with 'in' operator for safe property access on partial resource types
- Fixed import paths in test files and removed file extension from bundled adapter import
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdks/typescript/server/src/adapters/appssdk/adapter.ts | Removed .ts extension from bundled adapter import for better module resolution |
| sdks/typescript/client/src/utils/processResource.ts | Added 'in' operator type guards for text/blob property checks and updated processRemoteDOMResource signature to use EmbeddedResource['resource'] |
| sdks/typescript/client/src/components/__tests__/UIResourceRendererWC.test.tsx | Fixed import paths from ./ to ../ to correctly resolve parent directory modules |
| sdks/typescript/client/src/components/__tests__/UIResourceRenderer.unmocked.test.tsx | Updated Resource type import to EmbeddedResource and changed type annotations |
| sdks/typescript/client/src/components/__tests__/UIResourceRenderer.test.tsx | Changed baseResource property from 'content' to 'text' to match correct resource schema |
| sdks/typescript/client/src/components/__tests__/HTMLResourceRenderer.test.tsx | Updated type import and test resource type annotations to use EmbeddedResource['resource'] |
| sdks/typescript/client/src/components/UIResourceRendererWC.tsx | Updated type imports and annotations to use EmbeddedResource['resource'] |
| sdks/typescript/client/src/components/UIResourceRenderer.tsx | Updated type to use EmbeddedResource['resource'] and added intersection type for custom contentType property |
| sdks/typescript/client/src/components/RemoteDOMResourceRenderer.tsx | Updated type import and prop interface to use EmbeddedResource['resource'] |
| sdks/typescript/client/src/components/HTMLResourceRenderer.tsx | Updated type import and prop interface to use EmbeddedResource['resource'] |
| sdks/typescript/client/package.json | Added vite-tsconfig-paths dev dependency for TypeScript path resolution |
| pnpm-lock.yaml | Updated SDK version to 1.22.0 and added new dependencies (ajv@8.17.1, ajv-formats, React 19.2.0 peer dependencies) |
| examples/typescript-server-demo/package.json | Updated SDK dependency to ^1.22.0 |
| examples/server/package.json | Updated SDK dependency to ^1.22.0 |
| examples/server/package-lock.json | Updated top-level SDK dependency reference to ^1.22.0 |
Files not reviewed (2)
- examples/server/package-lock.json: Language not supported
- pnpm-lock.yaml: Language not supported
|
Thanks @ochafik! |
|
🎉 This PR is included in version 5.18.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 5.17.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@modelcontextprotocol/sdkfrom1.11.x&1.16.xto1.22.0Resourcewas used instead ofEmbeddedResource['resource'])cc/ @idosal @liady: please let me know if I misunderstood the type usage