# mcp_apps

URL: /milo-cli/api/milo/mcp_apps/
Section: milo
Description: Typed contracts for the stable MCP Apps UI extension.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Open LLM text
(/milo-cli/api/milo/mcp_apps/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fmcp_apps%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fmcp_apps%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fmcp_apps%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fmcp_apps%2Findex.txt)

Module

#
`mcp_apps`

Typed contracts for the stable MCP Apps UI extension.

5Classes2Functions

## Classes

`MCPAppCSP`

5

▼

Origins requested by an MCP App resource's Content Security Policy.

Origins requested by an MCP App resource's Content Security Policy.

#### Attributes

Name
Type
Description

`connect_domains`

`tuple[str, ...]`

—

`resource_domains`

`tuple[str, ...]`

—

`frame_domains`

`tuple[str, ...]`

—

`base_uri_domains`

`tuple[str, ...]`

—

#### Methods

Internal Methods
1

▼

`__init__`

4

▼

`def __init__(self, connect_domains: tuple[str, ...] | list[str] = (), resource_domains: tuple[str, ...] | list[str] = (), frame_domains: tuple[str, ...] | list[str] = (), base_uri_domains: tuple[str, ...] | list[str] = ()) -> None`

##### Parameters

Name
Type
Description

`connect_domains`
`—`

Default:`()`

`resource_domains`
`—`

Default:`()`

`frame_domains`
`—`

Default:`()`

`base_uri_domains`
`—`

Default:`()`

`MCPAppPermissions`

4

▼

Browser capabilities requested by an MCP App resource.

Browser capabilities requested by an MCP App resource.

#### Attributes

Name
Type
Description

`camera`

`bool`

—

`microphone`

`bool`

—

`geolocation`

`bool`

—

`clipboard_write`

`bool`

—

`MCPAppResourceMeta`

4

▼

Security and presentation metadata attached to an MCP App resource.

Security and presentation metadata attached to an MCP App resource.

#### Attributes

Name
Type
Description

`csp`

`MCPAppCSP | None`

—

`permissions`

`MCPAppPermissions | None`

—

`domain`

`str`

—

`prefers_border`

`bool | None`

—

`MCPAppToolMeta`

3

▼

Link an MCP tool to a UI resource and declare its visibility.

Link an MCP tool to a UI resource and declare its visibility.

#### Attributes

Name
Type
Description

`resource_uri`

`str`

—

`visibility`

`tuple[MCPAppVisibility, ...]`

—

#### Methods

Internal Methods
1

▼

`__init__`

2

▼

`def __init__(self, resource_uri: str, visibility: tuple[MCPAppVisibility, ...] | list[MCPAppVisibility] = ('model', 'app')) -> None`

##### Parameters

Name
Type
Description

`resource_uri`
`—`

`visibility`
`—`

Default:`('model', 'app')`

`MCPAppResourceDef`

7

▼

A registered HTML resource for the MCP Apps extension.

A registered HTML resource for the MCP Apps extension.

#### Attributes

Name
Type
Description

`uri`

`str`

—

`name`

`str`

—

`description`

`str`

—

`handler`

`Callable[..., str | bytes]`

—

`meta`

`MCPAppResourceMeta`

—

`mime_type`

`str`

—

#### Methods

Internal Methods
1

▼

`__post_init__`

0

▼

`def __post_init__(self) -> None`

## Functions

`_resource_meta_to_protocol`

1

`dict[str, Any]`

▼

Serialize immutable resource metadata with stable MCP field names.

`def _resource_meta_to_protocol(meta: MCPAppResourceMeta) -> dict[str, Any]`

##### Parameters

Name
Type
Description

`meta`
`MCPAppResourceMeta`

##### Returns

`dict[str, Any]`

`_tool_meta_to_protocol`

1

`dict[str, Any]`

▼

Serialize a tool-to-resource link using the stable nested shape.

`def _tool_meta_to_protocol(meta: MCPAppToolMeta) -> dict[str, Any]`

##### Parameters

Name
Type
Description

`meta`
`MCPAppToolMeta`

##### Returns

`dict[str, Any]`
