# `AshAi.McpUiResource`
[🔗](https://github.com/ash-project/ash_ai/blob/v0.6.1/lib/ash_ai.ex#L122)

A UI resource for MCP Apps (Model Context Protocol Apps extension).

UI resources serve static HTML files that are rendered in sandboxed iframes by MCP hosts
(like Claude Desktop). They are linked to tools via `_meta.ui.resourceUri` and provide
interactive interfaces for tool results.

## Example

    mcp_resources do
      mcp_ui_resource :estimates_list, "ui://estimates/list.html",
        html_path: "priv/mcp_apps/estimates.html"

      mcp_ui_resource :dashboard, "ui://dashboard.html",
        html_path: "priv/mcp_apps/dashboard.html",
        csp: [connect_domains: ["api.example.com"]],
        permissions: [camera: true]
    end

The HTML file at `html_path` is read at request time and returned with MIME type
`text/html;profile=mcp-app`.

See [MCP Apps spec](https://modelcontextprotocol.io/specification/2025-11-25).

# `t`

```elixir
@type t() :: %AshAi.McpUiResource{
  __spark_metadata__: term(),
  csp: keyword() | nil,
  description: String.t() | nil,
  domain: :auto | String.t() | nil,
  html_path: String.t(),
  name: atom(),
  permissions: keyword() | nil,
  prefers_border: boolean() | nil,
  title: String.t() | nil,
  uri: String.t()
}
```

# `mime_type`

Returns the fixed MIME type for MCP App UI resources.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
