feat: show views as the live globe in MCP Apps clients

show_on_globe replaces open_in_gods_eye_view and names an MCP Apps view, a
ui:// panel that loads the app in embed mode and posts each later view to it,
so the globe in the conversation changes without reloading. It also takes a
view another answer returned. Tools can declare a UI resource, and the MCP
adapter serves resources/list and resources/read and lists each tool's
resource in _meta.ui.resourceUri.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 60c40865e9
commit 216a75ac71
17 files changed
+417 -41

No files matched your search

+7
View File
@@ -74,6 +74,7 @@ export function defineTool({
inputSchema,
annotations = {},
requires = [],
ui = null,
run,
}) {
if (!TOOL_NAME.test(String(name)))
@@ -92,6 +93,11 @@ export function defineTool({
)
throw new TypeError(`${name}.requires must list service names`);
if (typeof run !== 'function') throw new TypeError(`${name} needs run()`);
if (
ui !== null &&
!(typeof ui?.resourceUri === 'string' && ui.resourceUri.startsWith('ui://'))
)
throw new TypeError(`${name}.ui needs a ui:// resourceUri`);
return Object.freeze({
name,
kind,
@@ -103,6 +109,7 @@ export function defineTool({
...annotations,
}),
requires: Object.freeze([...requires]),
ui: ui ? Object.freeze({ resourceUri: ui.resourceUri }) : null,
run,
});
}