Skip to content

Commit 729caac

Browse files
committed
feat: update McpUiAppToolConfig to support both _meta.ui and flat formats
1 parent 19a0fcb commit 729caac

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/generated/schema.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/generated/schema.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import {
88
RESOURCE_URI_META_KEY as _RESOURCE_URI_META_KEY,
99
McpUiResourceMeta,
10+
McpUiToolMeta,
1011
RESOURCE_MIME_TYPE,
1112
} from "../app.js";
1213
import type {
@@ -41,17 +42,18 @@ export interface ToolConfig {
4142
*/
4243
export interface McpUiAppToolConfig extends ToolConfig {
4344
_meta: {
44-
// Soon: `ui: McpUiToolMeta;` (https://github.com/modelcontextprotocol/ext-apps/pull/131)
45-
45+
[key: string]: unknown;
46+
} & ({
47+
ui: McpUiToolMeta;
48+
} | {
4649
/**
4750
* URI of the UI resource to display for this tool.
4851
* This is converted to `_meta["ui/resourceUri"]`.
4952
*
5053
* @example "ui://weather/widget.html"
5154
*/
5255
[RESOURCE_URI_META_KEY]?: string;
53-
[key: string]: unknown;
54-
};
56+
});
5557
}
5658

5759
/**

src/spec.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export type McpUiToolVisibility = "model" | "app";
524524
*/
525525
export interface McpUiToolMeta {
526526
/** @description URI of UI resource for rendering tool results. */
527-
resourceUri?: string;
527+
resourceUri: string;
528528
/**
529529
* @description Who can access this tool. Default: ["model", "app"]
530530
* - "model": Tool visible to and callable by the agent

0 commit comments

Comments
 (0)