@modelcontextprotocol/ext-apps 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  /**
3
3
  * @description Color theme preference for the host environment.
4
4
  */
@@ -7,6 +7,20 @@ export declare const McpUiThemeSchema: z.ZodUnion<readonly [z.ZodLiteral<"light"
7
7
  * @description Display mode for UI presentation.
8
8
  */
9
9
  export declare const McpUiDisplayModeSchema: z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>;
10
+ /**
11
+ * @description CSS variable keys available to MCP apps for theming.
12
+ */
13
+ export declare const McpUiStyleVariableKeySchema: z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>;
14
+ /**
15
+ * @description Style variables for theming MCP apps.
16
+ *
17
+ * Individual style keys are optional - hosts may provide any subset of these values.
18
+ * Values are strings containing CSS values (colors, sizes, font stacks, etc.).
19
+ *
20
+ * Note: This type uses `Record<K, string | undefined>` rather than `Partial<Record<K, string>>`
21
+ * for compatibility with Zod schema generation. Both are functionally equivalent for validation.
22
+ */
23
+ export declare const McpUiStylesSchema: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>, z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
10
24
  /**
11
25
  * @description Request to open an external URL in the host's default browser.
12
26
  * @see {@link app.App.sendOpenLink} for the method that sends this request
@@ -98,9 +112,24 @@ export declare const McpUiToolCancelledNotificationSchema: z.ZodObject<{
98
112
  reason: z.ZodOptional<z.ZodString>;
99
113
  }, z.core.$strip>;
100
114
  }, z.core.$strip>;
115
+ /**
116
+ * @description CSS blocks that can be injected by apps.
117
+ */
118
+ export declare const McpUiHostCssSchema: z.ZodObject<{
119
+ fonts: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ /**
122
+ * @description Style configuration for theming MCP apps.
123
+ */
124
+ export declare const McpUiHostStylesSchema: z.ZodObject<{
125
+ variables: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>, z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>>;
126
+ css: z.ZodOptional<z.ZodObject<{
127
+ fonts: z.ZodOptional<z.ZodString>;
128
+ }, z.core.$strip>>;
129
+ }, z.core.$strip>;
101
130
  /**
102
131
  * @description Request for graceful shutdown of the Guest UI (Host -> Guest UI).
103
- * @see {@link app-bridge.AppBridge.sendResourceTeardown} for the host method that sends this
132
+ * @see {@link app-bridge.AppBridge.teardownResource} for the host method that sends this
104
133
  */
105
134
  export declare const McpUiResourceTeardownRequestSchema: z.ZodObject<{
106
135
  method: z.ZodLiteral<"ui/resource-teardown">;
@@ -162,6 +191,37 @@ export declare const McpUiResourceMetaSchema: z.ZodObject<{
162
191
  domain: z.ZodOptional<z.ZodString>;
163
192
  prefersBorder: z.ZodOptional<z.ZodBoolean>;
164
193
  }, z.core.$strip>;
194
+ /**
195
+ * @description Request to change the display mode of the UI.
196
+ * The host will respond with the actual display mode that was set,
197
+ * which may differ from the requested mode if not supported.
198
+ * @see {@link app.App.requestDisplayMode} for the method that sends this request
199
+ */
200
+ export declare const McpUiRequestDisplayModeRequestSchema: z.ZodObject<{
201
+ method: z.ZodLiteral<"ui/request-display-mode">;
202
+ params: z.ZodObject<{
203
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>;
204
+ }, z.core.$strip>;
205
+ }, z.core.$strip>;
206
+ /**
207
+ * @description Result from requesting a display mode change.
208
+ * @see {@link McpUiRequestDisplayModeRequest}
209
+ */
210
+ export declare const McpUiRequestDisplayModeResultSchema: z.ZodObject<{
211
+ /** @description The display mode that was actually set. May differ from requested if not supported. */
212
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>;
213
+ }, z.core.$loose>;
214
+ /**
215
+ * @description Tool visibility scope - who can access the tool.
216
+ */
217
+ export declare const McpUiToolVisibilitySchema: z.ZodUnion<readonly [z.ZodLiteral<"model">, z.ZodLiteral<"app">]>;
218
+ /**
219
+ * @description UI-related metadata for tools.
220
+ */
221
+ export declare const McpUiToolMetaSchema: z.ZodObject<{
222
+ resourceUri: z.ZodString;
223
+ visibility: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"model">, z.ZodLiteral<"app">]>>>;
224
+ }, z.core.$strip>;
165
225
  /**
166
226
  * @description Request to send a message to the host's chat interface.
167
227
  * @see {@link app.App.sendMessage} for the method that sends this request
@@ -355,6 +415,7 @@ export declare const McpUiToolResultNotificationSchema: z.ZodObject<{
355
415
  * @description Rich context about the host environment provided to Guest UIs.
356
416
  */
357
417
  export declare const McpUiHostContextSchema: z.ZodObject<{
418
+ /** @description Metadata of the tool call that instantiated this App. */
358
419
  toolInfo: z.ZodOptional<z.ZodObject<{
359
420
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
360
421
  tool: z.ZodObject<{
@@ -393,30 +454,47 @@ export declare const McpUiHostContextSchema: z.ZodObject<{
393
454
  title: z.ZodOptional<z.ZodString>;
394
455
  }, z.core.$strip>;
395
456
  }, z.core.$strip>>;
457
+ /** @description Current color theme preference. */
396
458
  theme: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"light">, z.ZodLiteral<"dark">]>>;
459
+ /** @description Style configuration for theming the app. */
460
+ styles: z.ZodOptional<z.ZodObject<{
461
+ variables: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>, z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>>;
462
+ css: z.ZodOptional<z.ZodObject<{
463
+ fonts: z.ZodOptional<z.ZodString>;
464
+ }, z.core.$strip>>;
465
+ }, z.core.$strip>>;
466
+ /** @description How the UI is currently displayed. */
397
467
  displayMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>>;
468
+ /** @description Display modes the host supports. */
398
469
  availableDisplayModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
470
+ /** @description Current and maximum dimensions available to the UI. */
399
471
  viewport: z.ZodOptional<z.ZodObject<{
400
472
  width: z.ZodNumber;
401
473
  height: z.ZodNumber;
402
474
  maxHeight: z.ZodOptional<z.ZodNumber>;
403
475
  maxWidth: z.ZodOptional<z.ZodNumber>;
404
476
  }, z.core.$strip>>;
477
+ /** @description User's language and region preference in BCP 47 format. */
405
478
  locale: z.ZodOptional<z.ZodString>;
479
+ /** @description User's timezone in IANA format. */
406
480
  timeZone: z.ZodOptional<z.ZodString>;
481
+ /** @description Host application identifier. */
407
482
  userAgent: z.ZodOptional<z.ZodString>;
483
+ /** @description Platform type for responsive design decisions. */
408
484
  platform: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"web">, z.ZodLiteral<"desktop">, z.ZodLiteral<"mobile">]>>;
485
+ /** @description Device input capabilities. */
409
486
  deviceCapabilities: z.ZodOptional<z.ZodObject<{
410
487
  touch: z.ZodOptional<z.ZodBoolean>;
411
488
  hover: z.ZodOptional<z.ZodBoolean>;
412
489
  }, z.core.$strip>>;
490
+ /** @description Mobile safe area boundaries in pixels. */
413
491
  safeAreaInsets: z.ZodOptional<z.ZodObject<{
414
492
  top: z.ZodNumber;
415
493
  right: z.ZodNumber;
416
494
  bottom: z.ZodNumber;
417
495
  left: z.ZodNumber;
418
496
  }, z.core.$strip>>;
419
- }, z.core.$strip>;
497
+ }, z.core.$loose>;
420
498
  /**
421
499
  * @description Notification that host context has changed (Host -> Guest UI).
422
500
  * @see {@link McpUiHostContext} for the full context structure
@@ -424,6 +502,7 @@ export declare const McpUiHostContextSchema: z.ZodObject<{
424
502
  export declare const McpUiHostContextChangedNotificationSchema: z.ZodObject<{
425
503
  method: z.ZodLiteral<"ui/notifications/host-context-changed">;
426
504
  params: z.ZodObject<{
505
+ /** @description Metadata of the tool call that instantiated this App. */
427
506
  toolInfo: z.ZodOptional<z.ZodObject<{
428
507
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
429
508
  tool: z.ZodObject<{
@@ -462,30 +541,47 @@ export declare const McpUiHostContextChangedNotificationSchema: z.ZodObject<{
462
541
  title: z.ZodOptional<z.ZodString>;
463
542
  }, z.core.$strip>;
464
543
  }, z.core.$strip>>;
544
+ /** @description Current color theme preference. */
465
545
  theme: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"light">, z.ZodLiteral<"dark">]>>;
546
+ /** @description Style configuration for theming the app. */
547
+ styles: z.ZodOptional<z.ZodObject<{
548
+ variables: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>, z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>>;
549
+ css: z.ZodOptional<z.ZodObject<{
550
+ fonts: z.ZodOptional<z.ZodString>;
551
+ }, z.core.$strip>>;
552
+ }, z.core.$strip>>;
553
+ /** @description How the UI is currently displayed. */
466
554
  displayMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>>;
555
+ /** @description Display modes the host supports. */
467
556
  availableDisplayModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
557
+ /** @description Current and maximum dimensions available to the UI. */
468
558
  viewport: z.ZodOptional<z.ZodObject<{
469
559
  width: z.ZodNumber;
470
560
  height: z.ZodNumber;
471
561
  maxHeight: z.ZodOptional<z.ZodNumber>;
472
562
  maxWidth: z.ZodOptional<z.ZodNumber>;
473
563
  }, z.core.$strip>>;
564
+ /** @description User's language and region preference in BCP 47 format. */
474
565
  locale: z.ZodOptional<z.ZodString>;
566
+ /** @description User's timezone in IANA format. */
475
567
  timeZone: z.ZodOptional<z.ZodString>;
568
+ /** @description Host application identifier. */
476
569
  userAgent: z.ZodOptional<z.ZodString>;
570
+ /** @description Platform type for responsive design decisions. */
477
571
  platform: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"web">, z.ZodLiteral<"desktop">, z.ZodLiteral<"mobile">]>>;
572
+ /** @description Device input capabilities. */
478
573
  deviceCapabilities: z.ZodOptional<z.ZodObject<{
479
574
  touch: z.ZodOptional<z.ZodBoolean>;
480
575
  hover: z.ZodOptional<z.ZodBoolean>;
481
576
  }, z.core.$strip>>;
577
+ /** @description Mobile safe area boundaries in pixels. */
482
578
  safeAreaInsets: z.ZodOptional<z.ZodObject<{
483
579
  top: z.ZodNumber;
484
580
  right: z.ZodNumber;
485
581
  bottom: z.ZodNumber;
486
582
  left: z.ZodNumber;
487
583
  }, z.core.$strip>>;
488
- }, z.core.$strip>;
584
+ }, z.core.$loose>;
489
585
  }, z.core.$strip>;
490
586
  /**
491
587
  * @description Initialization request sent from Guest UI to Host.
@@ -547,6 +643,7 @@ export declare const McpUiInitializeResultSchema: z.ZodObject<{
547
643
  }, z.core.$strip>;
548
644
  /** @description Rich context about the host environment. */
549
645
  hostContext: z.ZodObject<{
646
+ /** @description Metadata of the tool call that instantiated this App. */
550
647
  toolInfo: z.ZodOptional<z.ZodObject<{
551
648
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
552
649
  tool: z.ZodObject<{
@@ -585,28 +682,45 @@ export declare const McpUiInitializeResultSchema: z.ZodObject<{
585
682
  title: z.ZodOptional<z.ZodString>;
586
683
  }, z.core.$strip>;
587
684
  }, z.core.$strip>>;
685
+ /** @description Current color theme preference. */
588
686
  theme: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"light">, z.ZodLiteral<"dark">]>>;
687
+ /** @description Style configuration for theming the app. */
688
+ styles: z.ZodOptional<z.ZodObject<{
689
+ variables: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"--color-background-primary">, z.ZodLiteral<"--color-background-secondary">, z.ZodLiteral<"--color-background-tertiary">, z.ZodLiteral<"--color-background-inverse">, z.ZodLiteral<"--color-background-ghost">, z.ZodLiteral<"--color-background-info">, z.ZodLiteral<"--color-background-danger">, z.ZodLiteral<"--color-background-success">, z.ZodLiteral<"--color-background-warning">, z.ZodLiteral<"--color-background-disabled">, z.ZodLiteral<"--color-text-primary">, z.ZodLiteral<"--color-text-secondary">, z.ZodLiteral<"--color-text-tertiary">, z.ZodLiteral<"--color-text-inverse">, z.ZodLiteral<"--color-text-info">, z.ZodLiteral<"--color-text-danger">, z.ZodLiteral<"--color-text-success">, z.ZodLiteral<"--color-text-warning">, z.ZodLiteral<"--color-text-disabled">, z.ZodLiteral<"--color-text-ghost">, z.ZodLiteral<"--color-border-primary">, z.ZodLiteral<"--color-border-secondary">, z.ZodLiteral<"--color-border-tertiary">, z.ZodLiteral<"--color-border-inverse">, z.ZodLiteral<"--color-border-ghost">, z.ZodLiteral<"--color-border-info">, z.ZodLiteral<"--color-border-danger">, z.ZodLiteral<"--color-border-success">, z.ZodLiteral<"--color-border-warning">, z.ZodLiteral<"--color-border-disabled">, z.ZodLiteral<"--color-ring-primary">, z.ZodLiteral<"--color-ring-secondary">, z.ZodLiteral<"--color-ring-inverse">, z.ZodLiteral<"--color-ring-info">, z.ZodLiteral<"--color-ring-danger">, z.ZodLiteral<"--color-ring-success">, z.ZodLiteral<"--color-ring-warning">, z.ZodLiteral<"--font-sans">, z.ZodLiteral<"--font-mono">, z.ZodLiteral<"--font-weight-normal">, z.ZodLiteral<"--font-weight-medium">, z.ZodLiteral<"--font-weight-semibold">, z.ZodLiteral<"--font-weight-bold">, z.ZodLiteral<"--font-text-xs-size">, z.ZodLiteral<"--font-text-sm-size">, z.ZodLiteral<"--font-text-md-size">, z.ZodLiteral<"--font-text-lg-size">, z.ZodLiteral<"--font-heading-xs-size">, z.ZodLiteral<"--font-heading-sm-size">, z.ZodLiteral<"--font-heading-md-size">, z.ZodLiteral<"--font-heading-lg-size">, z.ZodLiteral<"--font-heading-xl-size">, z.ZodLiteral<"--font-heading-2xl-size">, z.ZodLiteral<"--font-heading-3xl-size">, z.ZodLiteral<"--font-text-xs-line-height">, z.ZodLiteral<"--font-text-sm-line-height">, z.ZodLiteral<"--font-text-md-line-height">, z.ZodLiteral<"--font-text-lg-line-height">, z.ZodLiteral<"--font-heading-xs-line-height">, z.ZodLiteral<"--font-heading-sm-line-height">, z.ZodLiteral<"--font-heading-md-line-height">, z.ZodLiteral<"--font-heading-lg-line-height">, z.ZodLiteral<"--font-heading-xl-line-height">, z.ZodLiteral<"--font-heading-2xl-line-height">, z.ZodLiteral<"--font-heading-3xl-line-height">, z.ZodLiteral<"--border-radius-xs">, z.ZodLiteral<"--border-radius-sm">, z.ZodLiteral<"--border-radius-md">, z.ZodLiteral<"--border-radius-lg">, z.ZodLiteral<"--border-radius-xl">, z.ZodLiteral<"--border-radius-full">, z.ZodLiteral<"--border-width-regular">, z.ZodLiteral<"--shadow-hairline">, z.ZodLiteral<"--shadow-sm">, z.ZodLiteral<"--shadow-md">, z.ZodLiteral<"--shadow-lg">]>, z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>>;
690
+ css: z.ZodOptional<z.ZodObject<{
691
+ fonts: z.ZodOptional<z.ZodString>;
692
+ }, z.core.$strip>>;
693
+ }, z.core.$strip>>;
694
+ /** @description How the UI is currently displayed. */
589
695
  displayMode: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"inline">, z.ZodLiteral<"fullscreen">, z.ZodLiteral<"pip">]>>;
696
+ /** @description Display modes the host supports. */
590
697
  availableDisplayModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
698
+ /** @description Current and maximum dimensions available to the UI. */
591
699
  viewport: z.ZodOptional<z.ZodObject<{
592
700
  width: z.ZodNumber;
593
701
  height: z.ZodNumber;
594
702
  maxHeight: z.ZodOptional<z.ZodNumber>;
595
703
  maxWidth: z.ZodOptional<z.ZodNumber>;
596
704
  }, z.core.$strip>>;
705
+ /** @description User's language and region preference in BCP 47 format. */
597
706
  locale: z.ZodOptional<z.ZodString>;
707
+ /** @description User's timezone in IANA format. */
598
708
  timeZone: z.ZodOptional<z.ZodString>;
709
+ /** @description Host application identifier. */
599
710
  userAgent: z.ZodOptional<z.ZodString>;
711
+ /** @description Platform type for responsive design decisions. */
600
712
  platform: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"web">, z.ZodLiteral<"desktop">, z.ZodLiteral<"mobile">]>>;
713
+ /** @description Device input capabilities. */
601
714
  deviceCapabilities: z.ZodOptional<z.ZodObject<{
602
715
  touch: z.ZodOptional<z.ZodBoolean>;
603
716
  hover: z.ZodOptional<z.ZodBoolean>;
604
717
  }, z.core.$strip>>;
718
+ /** @description Mobile safe area boundaries in pixels. */
605
719
  safeAreaInsets: z.ZodOptional<z.ZodObject<{
606
720
  top: z.ZodNumber;
607
721
  right: z.ZodNumber;
608
722
  bottom: z.ZodNumber;
609
723
  left: z.ZodNumber;
610
724
  }, z.core.$strip>>;
611
- }, z.core.$strip>;
725
+ }, z.core.$loose>;
612
726
  }, z.core.$loose>;
@@ -1,7 +1,9 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import * as generated from "./schema.js";
3
3
  export type McpUiThemeSchemaInferredType = z.infer<typeof generated.McpUiThemeSchema>;
4
4
  export type McpUiDisplayModeSchemaInferredType = z.infer<typeof generated.McpUiDisplayModeSchema>;
5
+ export type McpUiStyleVariableKeySchemaInferredType = z.infer<typeof generated.McpUiStyleVariableKeySchema>;
6
+ export type McpUiStylesSchemaInferredType = z.infer<typeof generated.McpUiStylesSchema>;
5
7
  export type McpUiOpenLinkRequestSchemaInferredType = z.infer<typeof generated.McpUiOpenLinkRequestSchema>;
6
8
  export type McpUiOpenLinkResultSchemaInferredType = z.infer<typeof generated.McpUiOpenLinkResultSchema>;
7
9
  export type McpUiMessageResultSchemaInferredType = z.infer<typeof generated.McpUiMessageResultSchema>;
@@ -11,6 +13,8 @@ export type McpUiSizeChangedNotificationSchemaInferredType = z.infer<typeof gene
11
13
  export type McpUiToolInputNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolInputNotificationSchema>;
12
14
  export type McpUiToolInputPartialNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolInputPartialNotificationSchema>;
13
15
  export type McpUiToolCancelledNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolCancelledNotificationSchema>;
16
+ export type McpUiHostCssSchemaInferredType = z.infer<typeof generated.McpUiHostCssSchema>;
17
+ export type McpUiHostStylesSchemaInferredType = z.infer<typeof generated.McpUiHostStylesSchema>;
14
18
  export type McpUiResourceTeardownRequestSchemaInferredType = z.infer<typeof generated.McpUiResourceTeardownRequestSchema>;
15
19
  export type McpUiResourceTeardownResultSchemaInferredType = z.infer<typeof generated.McpUiResourceTeardownResultSchema>;
16
20
  export type McpUiHostCapabilitiesSchemaInferredType = z.infer<typeof generated.McpUiHostCapabilitiesSchema>;
@@ -18,6 +22,10 @@ export type McpUiAppCapabilitiesSchemaInferredType = z.infer<typeof generated.Mc
18
22
  export type McpUiInitializedNotificationSchemaInferredType = z.infer<typeof generated.McpUiInitializedNotificationSchema>;
19
23
  export type McpUiResourceCspSchemaInferredType = z.infer<typeof generated.McpUiResourceCspSchema>;
20
24
  export type McpUiResourceMetaSchemaInferredType = z.infer<typeof generated.McpUiResourceMetaSchema>;
25
+ export type McpUiRequestDisplayModeRequestSchemaInferredType = z.infer<typeof generated.McpUiRequestDisplayModeRequestSchema>;
26
+ export type McpUiRequestDisplayModeResultSchemaInferredType = z.infer<typeof generated.McpUiRequestDisplayModeResultSchema>;
27
+ export type McpUiToolVisibilitySchemaInferredType = z.infer<typeof generated.McpUiToolVisibilitySchema>;
28
+ export type McpUiToolMetaSchemaInferredType = z.infer<typeof generated.McpUiToolMetaSchema>;
21
29
  export type McpUiMessageRequestSchemaInferredType = z.infer<typeof generated.McpUiMessageRequestSchema>;
22
30
  export type McpUiToolResultNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolResultNotificationSchema>;
23
31
  export type McpUiHostContextSchemaInferredType = z.infer<typeof generated.McpUiHostContextSchema>;
@@ -9,6 +9,9 @@
9
9
  * ## Main Exports
10
10
  *
11
11
  * - {@link useApp} - React hook to create and connect an MCP App
12
+ * - {@link useHostStyleVariables} - React hook to apply host style variables and theme
13
+ * - {@link useHostFonts} - React hook to apply host fonts
14
+ * - {@link useDocumentTheme} - React hook for reactive document theme
12
15
  * - {@link useAutoResize} - React hook for manual auto-resize control (rarely needed)
13
16
  *
14
17
  * @module @modelcontextprotocol/ext-apps/react
@@ -32,3 +35,5 @@
32
35
  */
33
36
  export * from "./useApp";
34
37
  export * from "./useAutoResize";
38
+ export * from "./useDocumentTheme";
39
+ export * from "./useHostStyles";