Skip to main content
MCP Apps SDK
This reference covers MCP Apps SDK v2.0.3, which current sunpeak releases use. Version 2.0 keeps the same View protocol, uses split peer packages, deprecates the union types below, and broadens some core schemas. See the SDK 2.0 migration guide.

Request / Result Types

Initialization

View → Host Requests

Proxied Requests

The host proxies select MCP requests between the View and the originating MCP server (or, for sampling, between the View and the host’s LLM). These reuse standard MCP request/result types from @modelcontextprotocol/client in View and Host code, or @modelcontextprotocol/server in server code.

Host → View Requests

Notification Types

Host → View

View → Host

Union Types

These union types group all possible message types in the protocol. They are useful for building generic message handlers, routers, or middleware that processes any protocol message.

Event Maps

Type-safe maps of event names to notification params types, used by addEventListener / removeEventListener.

Method Constants

Type-safe string constants for protocol method names.

Other Constants

Zod Schemas

Every type has a corresponding Zod schema exported for runtime validation. Schema names follow the pattern {TypeName}Schema (e.g., McpUiTheme → McpUiThemeSchema).

Core Type Schemas

Initialization Schemas

Request / Result Schemas

Notification Schemas

Metadata Schemas