Merge pull request #422 from jonathanhefner/everything-is-external
Replace "external" with "network" in CSP documentation
This commit is contained in:
commit
2dd56c3dce
6 changed files with 21 additions and 23 deletions
|
|
@ -201,7 +201,7 @@ See the [Display Modes](https://github.com/modelcontextprotocol/ext-apps/blob/ma
|
||||||
|
|
||||||
All Views run in sandboxed iframes with no access to the Host's DOM, cookies, or storage. Communication happens only through [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage), making it auditable.
|
All Views run in sandboxed iframes with no access to the Host's DOM, cookies, or storage. Communication happens only through [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage), making it auditable.
|
||||||
|
|
||||||
Servers declare which external domains their UI needs via [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) metadata. Hosts enforce these declarations — if no domains are declared, no external connections are allowed. This "restrictive by default" approach prevents data exfiltration to undeclared servers.
|
Servers declare which network domains their UI needs via [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) metadata. Hosts enforce these declarations — if no domains are declared, no external connections are allowed. This "restrictive by default" approach prevents data exfiltration to undeclared servers.
|
||||||
|
|
||||||
See the [Security Implications](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx#security-implications) section of the specification for the threat model and mitigations.
|
See the [Security Implications](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx#security-implications) section of the specification for the threat model and mitigations.
|
||||||
|
|
||||||
|
|
|
||||||
20
src/generated/schema.json
generated
20
src/generated/schema.json
generated
|
|
@ -165,14 +165,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectDomains": {
|
"connectDomains": {
|
||||||
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no external connections (secure default)",
|
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no network connections (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resourceDomains": {
|
"resourceDomains": {
|
||||||
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no external resources (secure default)",
|
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -2511,14 +2511,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectDomains": {
|
"connectDomains": {
|
||||||
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no external connections (secure default)",
|
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no network connections (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resourceDomains": {
|
"resourceDomains": {
|
||||||
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no external resources (secure default)",
|
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -3874,14 +3874,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectDomains": {
|
"connectDomains": {
|
||||||
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no external connections (secure default)",
|
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no network connections (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resourceDomains": {
|
"resourceDomains": {
|
||||||
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no external resources (secure default)",
|
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -3913,14 +3913,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectDomains": {
|
"connectDomains": {
|
||||||
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no external connections (secure default)",
|
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no network connections (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resourceDomains": {
|
"resourceDomains": {
|
||||||
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no external resources (secure default)",
|
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -4082,14 +4082,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectDomains": {
|
"connectDomains": {
|
||||||
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no external connections (secure default)",
|
"description": "Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted → no network connections (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resourceDomains": {
|
"resourceDomains": {
|
||||||
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no external resources (secure default)",
|
"description": "Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
||||||
11
src/generated/schema.ts
generated
11
src/generated/schema.ts
generated
|
|
@ -188,8 +188,7 @@ export const McpUiSandboxProxyReadyNotificationSchema = z.object({
|
||||||
/**
|
/**
|
||||||
* @description Content Security Policy configuration for UI resources.
|
* @description Content Security Policy configuration for UI resources.
|
||||||
*
|
*
|
||||||
* Servers declare which external origins their UI needs to access.
|
* Servers declare which origins their UI requires. Hosts use this to enforce appropriate CSP headers.
|
||||||
* Hosts use this to enforce appropriate CSP headers.
|
|
||||||
*
|
*
|
||||||
* > [!IMPORTANT]
|
* > [!IMPORTANT]
|
||||||
* > MCP App HTML runs in a sandboxed iframe with no same-origin server.
|
* > MCP App HTML runs in a sandboxed iframe with no same-origin server.
|
||||||
|
|
@ -201,7 +200,7 @@ export const McpUiResourceCspSchema = z.object({
|
||||||
* @description Origins for network requests (fetch/XHR/WebSocket).
|
* @description Origins for network requests (fetch/XHR/WebSocket).
|
||||||
*
|
*
|
||||||
* - Maps to CSP `connect-src` directive
|
* - Maps to CSP `connect-src` directive
|
||||||
* - Empty or omitted → no external connections (secure default)
|
* - Empty or omitted → no network connections (secure default)
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
|
|
@ -212,14 +211,14 @@ export const McpUiResourceCspSchema = z.object({
|
||||||
.array(z.string())
|
.array(z.string())
|
||||||
.optional()
|
.optional()
|
||||||
.describe(
|
.describe(
|
||||||
"Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted \u2192 no external connections (secure default)",
|
"Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP `connect-src` directive\n- Empty or omitted \u2192 no network connections (secure default)",
|
||||||
),
|
),
|
||||||
/**
|
/**
|
||||||
* @description Origins for static resources (images, scripts, stylesheets, fonts, media).
|
* @description Origins for static resources (images, scripts, stylesheets, fonts, media).
|
||||||
*
|
*
|
||||||
* - Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives
|
* - Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives
|
||||||
* - Wildcard subdomains supported: `https://*.example.com`
|
* - Wildcard subdomains supported: `https://*.example.com`
|
||||||
* - Empty or omitted → no external resources (secure default)
|
* - Empty or omitted → no network resources (secure default)
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
|
|
@ -230,7 +229,7 @@ export const McpUiResourceCspSchema = z.object({
|
||||||
.array(z.string())
|
.array(z.string())
|
||||||
.optional()
|
.optional()
|
||||||
.describe(
|
.describe(
|
||||||
"Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no external resources (secure default)",
|
"Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)",
|
||||||
),
|
),
|
||||||
/**
|
/**
|
||||||
* @description Origins for nested iframes.
|
* @description Origins for nested iframes.
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ function registerAppResource_basicUsage(server: McpServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example: registerAppResource with CSP configuration for external domains.
|
* Example: registerAppResource with CSP configuration for network access.
|
||||||
*/
|
*/
|
||||||
function registerAppResource_withCsp(
|
function registerAppResource_withCsp(
|
||||||
server: McpServer,
|
server: McpServer,
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ export function registerAppTool<
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @example With CSP configuration for external domains
|
* @example With CSP configuration for network access
|
||||||
* ```ts source="./index.examples.ts#registerAppResource_withCsp"
|
* ```ts source="./index.examples.ts#registerAppResource_withCsp"
|
||||||
* registerAppResource(
|
* registerAppResource(
|
||||||
* server,
|
* server,
|
||||||
|
|
|
||||||
|
|
@ -539,8 +539,7 @@ export interface McpUiInitializedNotification {
|
||||||
/**
|
/**
|
||||||
* @description Content Security Policy configuration for UI resources.
|
* @description Content Security Policy configuration for UI resources.
|
||||||
*
|
*
|
||||||
* Servers declare which external origins their UI needs to access.
|
* Servers declare which origins their UI requires. Hosts use this to enforce appropriate CSP headers.
|
||||||
* Hosts use this to enforce appropriate CSP headers.
|
|
||||||
*
|
*
|
||||||
* > [!IMPORTANT]
|
* > [!IMPORTANT]
|
||||||
* > MCP App HTML runs in a sandboxed iframe with no same-origin server.
|
* > MCP App HTML runs in a sandboxed iframe with no same-origin server.
|
||||||
|
|
@ -552,7 +551,7 @@ export interface McpUiResourceCsp {
|
||||||
* @description Origins for network requests (fetch/XHR/WebSocket).
|
* @description Origins for network requests (fetch/XHR/WebSocket).
|
||||||
*
|
*
|
||||||
* - Maps to CSP `connect-src` directive
|
* - Maps to CSP `connect-src` directive
|
||||||
* - Empty or omitted → no external connections (secure default)
|
* - Empty or omitted → no network connections (secure default)
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
|
|
@ -565,7 +564,7 @@ export interface McpUiResourceCsp {
|
||||||
*
|
*
|
||||||
* - Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives
|
* - Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives
|
||||||
* - Wildcard subdomains supported: `https://*.example.com`
|
* - Wildcard subdomains supported: `https://*.example.com`
|
||||||
* - Empty or omitted → no external resources (secure default)
|
* - Empty or omitted → no network resources (secure default)
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue