feat: add support for 'tools' permission#691
Conversation
This change introduces the 'tools' permission to the WebMCP specification, mapping it to the Permission Policy 'tools' feature. - Updated McpUiResourcePermissions in src/spec.types.ts and generated schemas. - Added tools to the iframe allow attribute builder in src/app-bridge.ts.
|
@ochafik Please review this PR |
|
I think this PR is reasonable and looks good. However, we should talk about use cases more, since it's not totally clear how WebMCP tools inside of an MCP App should interact with so-far "official" MCP App tool calling that landed in #72. With this PR, an MCP App author has to think about two different types of tools:
The latter part of (2) is the new capability this PR brings MCP Apps. While I'm supportive, I will note that it might be confusing if we don't integrate more directly with MCP Apps tool calling. For example, is the user really expected to use a built-in browser agent (to run WebMCP tools) while also viewing a chat host that's serving MCP App? Which agent should the user talk to? If they talk to the web-based chat agent, then WebMCP tools are only useful if the agent host knows to read WebMCP tools and MCP App tools. If they talk to the built-in agent, then only WebMCP tools are useful, since the built-in agent doesn't know anything about "MCP App tools", or other interactions between View <-> Agent brokered by the MCP Apps spec. (Personally, I'd like to see MCP App tool calling be based off of WebMCP, as discussed in #35 (comment). But we should discuss it more!) |
Motivation and Context
This change adds support for the 'tools' permission from the WebMCP specification, mapping it to the Permission Policy 'tools' feature.
How Has This Been Tested?
I've tried it locally by adding this code in my files:
Then, I used WebMCP - Model Context Tool Inspector extension to verify it was properly registered. Without this PR, registration fails because of the missing
allow=toolson both iframes.Breaking Changes
Nope.
Types of changes
Checklist
Additional context