docs: align Protocol and role-specific setup

This commit is contained in:
Enrico 2026-07-22 15:37:22 -07:00
commit c847bc0887
2 changed files with 35 additions and 22 deletions

View file

@ -241,11 +241,11 @@ export type AppBridgeEventMap = {
/**
* Host-side bridge for communicating with a single View ({@link app!App `App`}).
*
* `AppBridge` extends the base MCP SDK's public `Server` class and acts as a proxy between
* the host application and a view running in an iframe. When an MCP client
* is provided to the constructor, it automatically forwards MCP server capabilities
* (tools, resources, prompts) to the view. It also handles the initialization
* handshake.
* `AppBridge` extends the base MCP SDK's public `Protocol` class and acts as a
* proxy between the host application and a view running in an iframe. When a
* separate MCP client is provided to the constructor, it automatically forwards
* MCP server capabilities (tools, resources, prompts) to the view. It also
* handles the Apps initialization handshake.
*
* ## Architecture
*

View file

@ -297,7 +297,8 @@ export type AppEventMap = {
*
* The `App` class provides a framework-agnostic way to build interactive MCP Apps
* that run inside host applications. It extends the base MCP SDK's public
* `Client` class and adds the Apps handshake, lifecycle, and high-level APIs.
* `Protocol` class, composes an {@link EventDispatcher}, and adds the Apps
* handshake, lifecycle, and high-level APIs.
*
* ## Architecture
*
@ -314,9 +315,11 @@ export type AppEventMap = {
*
* ## Protocol and event methods
*
* As a subclass of the base MCP SDK's `Client`, `App` provides:
* From the base MCP SDK's `Protocol`, `App` provides:
* - `setRequestHandler()` - Register handlers for requests from host
* - `setNotificationHandler()` - Register handlers for notifications from host
*
* From its composed {@link EventDispatcher}, `App` also provides:
* - `addEventListener()` - Append a listener for a notification event (multi-listener)
* - `removeEventListener()` - Remove a previously added listener
*