You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -416,9 +467,11 @@ If the Host is a web page, it MUST wrap the Guest UI and communicate with it thr
416
467
4. Once the Sandbox is ready, the Host MUST send the raw HTML resource to load in a `ui/notifications/sandbox-resource-ready` notification.
417
468
5. The Sandbox MUST load the raw HTML of the Guest UI with CSP settings that:
418
469
- Enforce the domains declared in `ui.csp` metadata
419
-
- Prevent nested iframes (`frame-src 'none'`)
420
-
- Block dangerous features (`object-src 'none'`, `base-uri 'self'`)
470
+
- If `frameDomains` is provided, allow nested iframes from declared origins; otherwise use `frame-src 'none'`
471
+
- If `baseUriDomains` is provided, allow base URIs from declared origins; otherwise use `base-uri 'self'`
472
+
- Block dangerous features (`object-src 'none'`)
421
473
- Apply restrictive defaults if no CSP metadata is provided
474
+
- If `permissions` is declared, the Sandbox MAY set the inner iframe's `allow` attribute accordingly
422
475
6. The Sandbox MUST forward messages sent by the Host to the Guest UI, and vice versa, for any method that doesn’t start with `ui/notifications/sandbox-`. This includes lifecycle messages, e.g., `ui/initialize` request & `ui/notifications/initialized` notification both sent by the Guest UI. The Host MUST NOT send any request or notification to the Guest UI before it receives an `initialized` notification.
423
476
7. The Sandbox SHOULD NOT create/send any requests to the Host or to the Guest UI (this would require synthesizing new request ids).
424
477
8. The Host MAY forward any message from the Guest UI (coming via the Sandbox) to the MCP Apps server, for any method that doesn’t start with `ui/`. While the Host SHOULD ensure the Guest UI’s MCP connection is spec-compliant, it MAY decide to block some messages or subject them to further user approval.
@@ -535,6 +588,53 @@ Example:
535
588
}
536
589
```
537
590
591
+
### Host Capabilities
592
+
593
+
`HostCapabilities` are sent to the Guest UI as part of the response to `ui/initialize` (inside `McpUiInitializeResult`).
594
+
They describe the features and capabilities that the Host supports.
595
+
596
+
```typescript
597
+
interfaceHostCapabilities {
598
+
/** Experimental features (structure TBD). */
599
+
experimental?: {};
600
+
/** Host supports opening external URLs. */
601
+
openLinks?: {};
602
+
/** Host can proxy tool calls to the MCP server. */
sandbox: string// Optional override for inner iframe `sandbox` attribute
1131
+
sandbox?:string, // Optional override for inner iframe `sandbox` attribute
1132
+
csp?: { // CSP configuration from resource metadata
1133
+
connectDomains?: string[],
1134
+
resourceDomains?: string[],
1135
+
frameDomains?: string[],
1136
+
baseUriDomains?: string[],
1137
+
},
1138
+
permissions?: { // Sandbox permissions from resource metadata
1139
+
camera?: boolean,
1140
+
microphone?: boolean,
1141
+
geolocation?: boolean,
1142
+
clipboardWrite?: boolean,
1143
+
}
1032
1144
}
1033
1145
}
1034
1146
```
1035
1147
1036
-
These messages facilitate the communication between the outer sandbox proxy iframe and the host, enabling secure loading of untrusted HTML content.
1148
+
These messages facilitate the communication between the outer sandbox proxy iframe and the host, enabling secure loading of untrusted HTML content. The `permissions` field maps to the inner iframe's `allow` attribute for Permission Policy features.
1037
1149
1038
1150
### Lifecycle
1039
1151
@@ -1489,6 +1601,7 @@ Hosts MUST enforce Content Security Policies based on resource metadata.
0 commit comments