@@ -38,6 +38,27 @@ export {
3838 type McpUiResourceMeta ,
3939} from "./spec.types.js" ;
4040
41+ // Import types needed for protocol type unions (not re-exported, just used internally)
42+ import type {
43+ McpUiInitializeRequest ,
44+ McpUiOpenLinkRequest ,
45+ McpUiMessageRequest ,
46+ McpUiResourceTeardownRequest ,
47+ McpUiHostContextChangedNotification ,
48+ McpUiToolInputNotification ,
49+ McpUiToolInputPartialNotification ,
50+ McpUiToolResultNotification ,
51+ McpUiToolCancelledNotification ,
52+ McpUiSandboxResourceReadyNotification ,
53+ McpUiInitializedNotification ,
54+ McpUiSizeChangedNotification ,
55+ McpUiSandboxProxyReadyNotification ,
56+ McpUiInitializeResult ,
57+ McpUiOpenLinkResult ,
58+ McpUiMessageResult ,
59+ McpUiResourceTeardownResult ,
60+ } from "./spec.types.js" ;
61+
4162// Re-export all schemas from generated/schema.ts (already PascalCase)
4263export {
4364 McpUiThemeSchema ,
@@ -65,3 +86,92 @@ export {
6586 McpUiResourceCspSchema ,
6687 McpUiResourceMetaSchema ,
6788} from "./generated/schema.js" ;
89+
90+ // Re-export SDK types used in protocol type unions
91+ import {
92+ CallToolRequest ,
93+ CallToolResult ,
94+ EmptyResult ,
95+ ListPromptsRequest ,
96+ ListPromptsResult ,
97+ ListResourcesRequest ,
98+ ListResourcesResult ,
99+ ListResourceTemplatesRequest ,
100+ ListResourceTemplatesResult ,
101+ ListToolsRequest ,
102+ ListToolsResult ,
103+ LoggingMessageNotification ,
104+ PingRequest ,
105+ PromptListChangedNotification ,
106+ ReadResourceRequest ,
107+ ReadResourceResult ,
108+ ResourceListChangedNotification ,
109+ ToolListChangedNotification ,
110+ } from "@modelcontextprotocol/sdk/types.js" ;
111+
112+ /**
113+ * All request types in the MCP Apps protocol.
114+ *
115+ * Includes:
116+ * - MCP UI requests (initialize, open-link, message, resource-teardown)
117+ * - MCP server requests forwarded from the app (tools/call, resources/*, prompts/list)
118+ * - Protocol requests (ping)
119+ */
120+ export type AppRequest =
121+ | McpUiInitializeRequest
122+ | McpUiOpenLinkRequest
123+ | McpUiMessageRequest
124+ | McpUiResourceTeardownRequest
125+ | CallToolRequest
126+ | ListToolsRequest
127+ | ListResourcesRequest
128+ | ListResourceTemplatesRequest
129+ | ReadResourceRequest
130+ | ListPromptsRequest
131+ | PingRequest ;
132+
133+ /**
134+ * All notification types in the MCP Apps protocol.
135+ *
136+ * Host to app:
137+ * - Tool lifecycle (input, input-partial, result, cancelled)
138+ * - Host context changes
139+ * - MCP list changes (tools, resources, prompts)
140+ * - Sandbox resource ready
141+ *
142+ * App to host:
143+ * - Initialized, size-changed, sandbox-proxy-ready
144+ * - Logging messages
145+ */
146+ export type AppNotification =
147+ // Sent to app
148+ | McpUiHostContextChangedNotification
149+ | McpUiToolInputNotification
150+ | McpUiToolInputPartialNotification
151+ | McpUiToolResultNotification
152+ | McpUiToolCancelledNotification
153+ | McpUiSandboxResourceReadyNotification
154+ | ToolListChangedNotification
155+ | ResourceListChangedNotification
156+ | PromptListChangedNotification
157+ // Received from app
158+ | McpUiInitializedNotification
159+ | McpUiSizeChangedNotification
160+ | McpUiSandboxProxyReadyNotification
161+ | LoggingMessageNotification ;
162+
163+ /**
164+ * All result types in the MCP Apps protocol.
165+ */
166+ export type AppResult =
167+ | McpUiInitializeResult
168+ | McpUiOpenLinkResult
169+ | McpUiMessageResult
170+ | McpUiResourceTeardownResult
171+ | CallToolResult
172+ | ListToolsResult
173+ | ListResourcesResult
174+ | ListResourceTemplatesResult
175+ | ReadResourceResult
176+ | ListPromptsResult
177+ | EmptyResult ;
0 commit comments