Skip to content

Commit c9bc26b

Browse files
antonpk1claude
andcommitted
address PR review comments
- Change default visibility to ["model", "apps"] - Add deprecation notice for flat ui/resourceUri format - Add McpUiToolMeta and McpUiToolVisibility to spec.types.ts - Improve tools/list and tools/call behavior wording 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e548370 commit c9bc26b

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

specification/draft/apps.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ interface McpUiToolMeta {
251251
/** URI of UI resource for rendering tool results */
252252
resourceUri?: string;
253253
/**
254-
* Who can access this tool. Default: ["model"]
254+
* Who can access this tool. Default: ["model", "apps"]
255255
* - "model": Tool visible to and callable by the agent
256-
* - "apps": Tool callable by ui apps from this server
256+
* - "apps": Tool callable by apps from this server only
257257
*/
258258
visibility?: Array<"model" | "apps">;
259259
}
@@ -264,10 +264,14 @@ interface Tool {
264264
inputSchema: object;
265265
_meta?: {
266266
ui?: McpUiToolMeta;
267+
/** @deprecated Use `ui.resourceUri` instead. Will be removed before GA. */
268+
"ui/resourceUri"?: string;
267269
};
268270
}
269271
```
270272

273+
> **Deprecation notice:** The flat `_meta["ui/resourceUri"]` format is deprecated. Use `_meta.ui.resourceUri` instead. The deprecated format will be removed before GA.
274+
271275
Example (tool visible to both model and apps):
272276

273277
```json
@@ -316,11 +320,11 @@ Example (app-only tool, hidden from model):
316320

317321
#### Visibility:
318322

319-
- `visibility` defaults to `["model"]` if omitted (standard MCP behavior)
323+
- `visibility` defaults to `["model", "apps"]` if omitted
320324
- `"model"`: Tool is visible to and callable by the agent
321325
- `"apps"`: Tool is callable by apps from the same server connection only
322-
- Host MUST NOT include tools with `visibility: ["apps"]` in the agent's tool list
323-
- Host MUST reject `tools/call` requests from apps for tools that don't include `"apps"` in visibility
326+
- **tools/list behavior:** Host MUST NOT include tools in the agent's tool list when their visibility does not include `"model"` (e.g., `visibility: ["apps"]`)
327+
- **tools/call behavior:** Host MUST reject `tools/call` requests from apps for tools that don't include `"apps"` in visibility
324328
- Cross-server tool calls are always blocked for app-only tools
325329

326330
#### Benefits:
@@ -1096,7 +1100,7 @@ This proposal synthesizes feedback from the UI CWG and MCP-UI community, host im
10961100

10971101
- Nested `_meta.ui` structure groups all UI-related metadata cleanly
10981102
- Array format (`["model", "apps"]`) allows flexible combinations
1099-
- Default `["model"]` preserves standard MCP behavior for existing tools
1103+
- Default `["model", "apps"]` allows both agent and apps to access tools
11001104
- `"apps"` scope is per-server, preventing cross-server tool calls
11011105
- Cleaner than OpenAI's two-field approach (`widgetAccessible` + `visibility`)
11021106

src/spec.types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,22 @@ export interface McpUiResourceMeta {
371371
/** @description Visual boundary preference - true if UI prefers a visible border. */
372372
prefersBorder?: boolean;
373373
}
374+
375+
/**
376+
* @description Tool visibility scope - who can access the tool.
377+
*/
378+
export type McpUiToolVisibility = "model" | "apps";
379+
380+
/**
381+
* @description UI-related metadata for tools.
382+
*/
383+
export interface McpUiToolMeta {
384+
/** @description URI of UI resource for rendering tool results. */
385+
resourceUri?: string;
386+
/**
387+
* @description Who can access this tool. Default: ["model", "apps"]
388+
* - "model": Tool visible to and callable by the agent
389+
* - "apps": Tool callable by apps from this server only
390+
*/
391+
visibility?: McpUiToolVisibility[];
392+
}

0 commit comments

Comments
 (0)