Skip to content

Commit 605142a

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 e9e434d commit 605142a

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
@@ -248,9 +248,9 @@ interface McpUiToolMeta {
248248
/** URI of UI resource for rendering tool results */
249249
resourceUri?: string;
250250
/**
251-
* Who can access this tool. Default: ["model"]
251+
* Who can access this tool. Default: ["model", "apps"]
252252
* - "model": Tool visible to and callable by the agent
253-
* - "apps": Tool callable by ui apps from this server
253+
* - "apps": Tool callable by apps from this server only
254254
*/
255255
visibility?: Array<"model" | "apps">;
256256
}
@@ -261,10 +261,14 @@ interface Tool {
261261
inputSchema: object;
262262
_meta?: {
263263
ui?: McpUiToolMeta;
264+
/** @deprecated Use `ui.resourceUri` instead. Will be removed before GA. */
265+
"ui/resourceUri"?: string;
264266
};
265267
}
266268
```
267269

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

270274
```json
@@ -313,11 +317,11 @@ Example (app-only tool, hidden from model):
313317

314318
#### Visibility:
315319

316-
- `visibility` defaults to `["model"]` if omitted (standard MCP behavior)
320+
- `visibility` defaults to `["model", "apps"]` if omitted
317321
- `"model"`: Tool is visible to and callable by the agent
318322
- `"apps"`: Tool is callable by apps from the same server connection only
319-
- Host MUST NOT include tools with `visibility: ["apps"]` in the agent's tool list
320-
- Host MUST reject `tools/call` requests from apps for tools that don't include `"apps"` in visibility
323+
- **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"]`)
324+
- **tools/call behavior:** Host MUST reject `tools/call` requests from apps for tools that don't include `"apps"` in visibility
321325
- Cross-server tool calls are always blocked for app-only tools
322326

323327
#### Benefits:
@@ -1092,7 +1096,7 @@ This proposal synthesizes feedback from the UI CWG and MCP-UI community, host im
10921096

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

src/spec.types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,22 @@ export interface McpUiResourceMeta {
356356
/** @description Visual boundary preference - true if UI prefers a visible border. */
357357
prefersBorder?: boolean;
358358
}
359+
360+
/**
361+
* @description Tool visibility scope - who can access the tool.
362+
*/
363+
export type McpUiToolVisibility = "model" | "apps";
364+
365+
/**
366+
* @description UI-related metadata for tools.
367+
*/
368+
export interface McpUiToolMeta {
369+
/** @description URI of UI resource for rendering tool results. */
370+
resourceUri?: string;
371+
/**
372+
* @description Who can access this tool. Default: ["model", "apps"]
373+
* - "model": Tool visible to and callable by the agent
374+
* - "apps": Tool callable by apps from this server only
375+
*/
376+
visibility?: McpUiToolVisibility[];
377+
}

0 commit comments

Comments
 (0)