McpUiHostContext | MCP Apps
https://apps.extensions.modelcontextprotocol.io/api/interfaces/app.McpUiHostContext.html • 65 KB fetched Open original page
McpUiHostContext | MCP Apps
MCP Apps GitHub Specification
Preparing search index...
* app
* McpUiHostContext
Interface McpUiHostContext
Description
Rich context about the host environment provided to views.
interface McpUiHostContext {
availableDisplayModes ?: McpUiDisplayMode [] ;
containerDimensions ?: ({ height: number; } | { maxHeight?: number | undefined; }) & ({ width: number; } | { maxWidth?: number | undefined; }) ;
deviceCapabilities ?: { hover ?: boolean ; touch ?: boolean } ;
displayMode ?: McpUiDisplayMode ;
locale ?: string ;
platform ?: "web" | "desktop" | "mobile" ;
safeAreaInsets ?: {
bottom : number ;
left : number ;
right : number ;
top : number ;
} ;
styles ?: McpUiHostStyles ;
theme ?: McpUiTheme ;
timeZone ?: string ;
toolInfo ?: {
id ?: RequestId ;
tool : {
_meta ?: { [ key : string ]: unknown } ;
annotations ?: {
destructiveHint ?: boolean ;
idempotentHint ?: boolean ;
openWorldHint ?: boolean ;
readOnlyHint ?: boolean ;
title ?: string ;
} ;
description ?: string ;
execution ?: { taskSupport ?: "optional"
| "required"
| "forbidden" } ;
icons ?: {
mimeType ?: string ;
sizes ?: string [] ;
src : string ;
theme ?: "light" | "dark" ;
} [] ;
inputSchema : {
properties ?: {
[ key : string ]: | string
| number
| boolean
| {
[ key : string ]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null ;
}
| (
string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null
) []
| null ;
} ;
required ?: string [] ;
type : "object" ;
[ key : string ]: unknown ;
} ;
name : string ;
outputSchema ?: { $schema ?: string ; [ key : string ]: unknown } ;
title ?: string ;
} ;
} ;
userAgent ?: string ;
[ key : string ]: unknown ;
}
Indexable
* [ key : string ]: unknown
Description
Allow additional properties for forward compatibility.
* Defined in src/spec.types.ts:340
Index
Properties
available Display Modes?
container Dimensions?
device Capabilities?
display Mode?
locale?
platform?
safe Area Insets?
styles?
theme?
time Zone?
tool Info?
user Agent?
Properties
Optional available Display Modes
availableDisplayModes ?: McpUiDisplayMode []
Description
Display modes the host supports.
* Defined in src/spec.types.ts:357
Optional container Dimensions
containerDimensions ?: ({ height: number; } | { maxHeight?: number | undefined; }) & ({ width: number; } | { maxWidth?: number | undefined; })
Description
Container dimensions. Represents the dimensions of the iframe or other
container holding the app. Specify either width or maxWidth, and either height or maxHeight.
* Defined in src/spec.types.ts:362
Optional device Capabilities
deviceCapabilities ?: { hover ?: boolean ; touch ?: boolean }
Type Declaration
* Optional hover ?: boolean
Description
Whether the device supports hover interactions.
* Optional touch ?: boolean
Description
Whether the device supports touch input.
Description
Device input capabilities.
* Defined in src/spec.types.ts:391
Optional display Mode
displayMode ?: McpUiDisplayMode
Description
How the UI is currently displayed.
* Defined in src/spec.types.ts:355
Optional locale
locale ?: string
Description
User's language and region preference in BCP 47 format.
* Defined in src/spec.types.ts:383
Optional platform
platform ?: "web" | "desktop" | "mobile"
Description
Platform type for responsive design decisions.
* Defined in src/spec.types.ts:389
Optional safe Area Insets
safeAreaInsets ?: { bottom : number ; left : number ; right : number ; top : number }
Type Declaration
* bottom : number
Description
Bottom safe area inset in pixels.
* left : number
Description
Left safe area inset in pixels.
* right : number
Description
Right safe area inset in pixels.
* top : number
Description
Top safe area inset in pixels.
Description
Mobile safe area boundaries in pixels.
* Defined in src/spec.types.ts:398
Optional styles
styles ?: McpUiHostStyles
Description
Style configuration for theming the app.
* Defined in src/spec.types.ts:353
Optional theme
theme ?: McpUiTheme
Description
Current color theme preference.
* Defined in src/spec.types.ts:351
Optional time Zone
timeZone ?: string
Description
User's timezone in IANA format.
* Defined in src/spec.types.ts:385
Optional tool Info
toolInfo ?: {
id ?: RequestId ;
tool : {
_meta ?: { [ key : string ]: unknown } ;
annotations ?: {
destructiveHint ?: boolean ;
idempotentHint ?: boolean ;
openWorldHint ?: boolean ;
readOnlyHint ?: boolean ;
title ?: string ;
} ;
description ?: string ;
execution ?: { taskSupport ?: "optional"
| "required"
| "forbidden" } ;
icons ?: {
mimeType ?: string ;
sizes ?: string [] ;
src : string ;
theme ?: "light" | "dark" ;
} [] ;
inputSchema : {
properties ?: {
[ key : string ]: | string
| number
| boolean
| {
[ key : string ]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null ;
}
| (
string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null
) []
| null ;
} ;
required ?: string [] ;
type : "object" ;
[ key : string ]: unknown ;
} ;
name : string ;
outputSchema ?: { $schema ?: string ; [ key : string ]: unknown } ;
title ?: string ;
} ;
}
Type Declaration
* Optional id ?: RequestId
Description
JSON-RPC id of the tools/call request.
* tool : {
_meta ?: { [ key : string ]: unknown } ;
annotations ?: {
destructiveHint ?: boolean ;
idempotentHint ?: boolean ;
openWorldHint ?: boolean ;
readOnlyHint ?: boolean ;
title ?: string ;
} ;
description ?: string ;
execution ?: { taskSupport ?: "optional"
| "required"
| "forbidden" } ;
icons ?: {
mimeType ?: string ;
sizes ?: string [] ;
src : string ;
theme ?: "light" | "dark" ;
} [] ;
inputSchema : {
properties ?: {
[ key : string ]: | string
| number
| boolean
| {
[ key : string ]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null ;
}
| (
string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null
) []
| null ;
} ;
required ?: string [] ;
type : "object" ;
[ key : string ]: unknown ;
} ;
name : string ;
outputSchema ?: { $schema ?: string ; [ key : string ]: unknown } ;
title ?: string ;
}
Description
Tool definition including name, inputSchema, etc.
Description
Metadata of the tool call that instantiated this App.
* Defined in src/spec.types.ts:344
Optional user Agent
userAgent ?: string
Description
Host application identifier.
* Defined in src/spec.types.ts:387
Settings
Member Visibility
* Protected
* Inherited
* External
Theme OS Light Dark
On This Page
Properties available Display Modes container Dimensions device Capabilities display Mode locale platform safe Area Insets styles theme time Zone tool Info user Agent
GitHub Specification MCP Apps
* Loading...
Generated using TypeDoc with typedoc-github-theme
Links found on this page
- MCP Apps [direct]
- GitHub [direct]
- Specification [direct]
- app [direct]
- McpUiHostContext [direct]
- McpUiDisplayMode [direct]
- McpUiHostStyles [direct]
- McpUiTheme [direct]
- src/spec.types.ts:340 [direct]
- MCP Apps [direct]
- TypeDoc [direct]
- typedoc-github-theme [direct]
|
|