Migrate to SDK v2 with a core-only Apps protocol#719
Draft
tonxxd wants to merge 8 commits into
Draft
Conversation
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
This PR brings @khandrew1 SDK v2 migration from #710 upstream together with the core-only protocol dependency-isolation
Problem
Andrew's v2 migration changes
AppandAppBridgeto inherit the official SDKClientandServer. Because ext-apps is one npm package, server-only consumers can then install and bundle the client role as well.Proposed architecture
This alternative owns a small Apps-specific JSON-RPC lifecycle and depends only on public
@modelcontextprotocol/coreschemas. Official clients and servers remain compatible through structural interfaces.as suggested by @felixweinberger on slack
Implementation
ui/initialize/ui/notifications/initializedas the only iframe handshake.McpClientLikeandMcpServerLikeinterfaces verified against official v2 classes.Tradeoff
This provides the strongest dependency isolation: app-only consumers do not install the server, and server-only consumers do not install the client. The tradeoff is that ext-apps owns protocol lifecycle code that must stay aligned with the official SDK.
The alternative using the official public
Protocolbase in #720 is available for direct comparison.Verification
npm test: 398 passed, 1 skippednpm run buildnpm run build:all