This PR brings @khandrew1 SDK v2 migration from #710 upstream together with the core-only protocol dependency-isolation
Problem
Andrew's v2 migration changes App and AppBridge to inherit the official SDK Client and Server. Because ext-apps is one npm package, server-only consumers can then install and bundle the client role as well.
This alternative owns a small Apps-specific JSON-RPC lifecycle and depends only on public @modelcontextprotocol/core schemas. Official clients and servers remain compatible through structural interfaces.
Replaces role inheritance with an ext-apps-owned protocol-neutral JSON-RPC base.
Keeps ui/initialize / ui/notifications/initialized as the only iframe handshake.
Adds structural McpClientLike and McpServerLike interfaces verified against official v2 classes.
Moves shared constants and types into neutral modules.
Removes client and server from published peers; examples declare role-specific dependencies.
Adds packed-install, declaration-graph, and bundle-metafile isolation tests.
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.
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
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 App and AppBridge to inherit the official SDK Client and Server. 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/core schemas. Official clients and servers remain compatible through structural interfaces.
as suggested by @felixweinberger on slack
Implementation
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 Protocol base in #720 is available for direct comparison.
Verification