Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions specification/draft/apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ interface UIResourceMeta {
* Maps to Permission Policy `clipboard-write` feature
*/
clipboardWrite?: {},
/**
* Request WebMCP tools access
*
* Maps to Permission Policy `tools` feature
*/
tools?: {},
},
/**
* Dedicated origin for view
Expand Down Expand Up @@ -251,6 +257,7 @@ The resource content is returned via `resources/read`:
microphone?: {}; // Request microphone access
geolocation?: {}; // Request geolocation access
clipboardWrite?: {}; // Request clipboard write access
tools?: {}; // Request WebMCP tools access
};
domain?: string;
prefersBorder?: boolean;
Expand Down Expand Up @@ -694,6 +701,7 @@ interface HostCapabilities {
microphone?: {};
geolocation?: {};
clipboardWrite?: {};
tools?: {};
};
/** CSP domains approved by the host. */
csp?: {
Expand Down Expand Up @@ -1480,6 +1488,7 @@ These messages are reserved for web-based hosts that implement the recommended d
microphone?: {},
geolocation?: {},
clipboardWrite?: {},
tools?: {},
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/app-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2817,6 +2817,10 @@ describe("buildAllowAttribute", () => {
"clipboard-write",
);
});

it("when only tools is set", () => {
expect(buildAllowAttribute({ tools: {} })).toBe("tools");
});
});

describe("returns multiple directives joined with '; '", () => {
Expand All @@ -2833,8 +2837,9 @@ describe("buildAllowAttribute", () => {
microphone: {},
geolocation: {},
clipboardWrite: {},
tools: {},
}),
).toBe("camera; microphone; geolocation; clipboard-write");
).toBe("camera; microphone; geolocation; clipboard-write; tools");
});
});
});
1 change: 1 addition & 0 deletions src/app-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export function buildAllowAttribute(
if (permissions.microphone) allowList.push("microphone");
if (permissions.geolocation) allowList.push("geolocation");
if (permissions.clipboardWrite) allowList.push("clipboard-write");
if (permissions.tools) allowList.push("tools");

return allowList.join("; ");
}
Expand Down
30 changes: 30 additions & 0 deletions src/generated/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/generated/schema.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/spec.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,12 @@ export interface McpUiResourcePermissions {
* Maps to Permission Policy `clipboard-write` feature.
*/
clipboardWrite?: {};
/**
* @description Request WebMCP tools access.
*
* Maps to Permission Policy `tools` feature.
*/
tools?: {};
}

/**
Expand Down