Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(mcp): normalize widget resource discovery

Rahman9821d7ca96d0
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 9164649b..cc038627 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -4,6 +4,12 @@
Newest first. `docs/PROGRESS.md` is the source of truth for *why* a change was made;
this is the *what*, and it is what Settings → About shows as “What's new”.
+## 2026-09-22
+
+**Fixed**
+
+- `mcp` normalize widget resource discovery
+
## 2026-09-21
**Fixed**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 758fe3e5..92154748 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,11 @@
+## 2026-09-22 -- Match ext-apps widget discovery after ChatGPT ecosystem 404
+
+A browser-console capture finally exposed the host failure that ordinary MCP logs could not see. ChatGPT correctly selected the registered MSO app, exact action name and ui:// template pointer, but its internal /backend-api/ecosystem/widget request returned HTTP 404 for the Native probe, Block, List, Page and integration_setup_open. At the same time MSO's own telemetry showed successful resources/read for the product resources, proving that public HTTPS, OAuth, resource bytes and MCP MIME delivery were not the failing boundary. A private equality check also proved the stored OpenAI App binding matches the ChatGPT connector ID exactly, without printing the App ID.
+
+The remaining MSO compatibility gap was in registration/discovery normalization. MSO already emitted canonical _meta.ui.resourceUri, but unlike the official ext-apps helper it did not mirror that URI into the compatibility _meta["ui/resourceUri"] field, and resources/list discarded each resource's _meta.ui even though the helper keeps listing-level UI metadata for host indexing. All five resource-bound tools now publish both URI forms while keeping _meta.ui.resourceUri authoritative; resources/list preserves bounded resource _meta; Block retains its older openai/outputTemplate fallback and the other tools do not gain it.
+
+Because the failing ChatGPT widget URLs are cache/index keys, all four canonical resources were also advanced to fresh URIs: native-probe-v2, block-v5, list-v3 and page-v16. The immediately previous canonical URIs remain read-only aliases so already-scanned clients do not break, but are not advertised. Regression now locks flat/nested descriptor parity, listing-level resource metadata and previous-URI aliases. MCP server/toolset identity advances to 1.15.3 / 2026.09.22.2. Final visual acceptance still requires a fresh ChatGPT Scan Tools snapshot and a new app-selected conversation; success means the internal widget request no longer returns 404, the component is visibly mounted, and a real component action round-trip succeeds.
+
## 2026-09-22 — Negotiate MCP Apps UI and expose host-boundary telemetry
The Native UI probe proved that MSO's tool descriptor, `ui://` resource, MCP App MIME and static HTML were valid, yet direct host acceptance still returned the structured fallback. The missing server-side contract was capability negotiation: MSO advertised its Skills extension but never declared `io.modelcontextprotocol/ui` during either legacy `initialize` or modern `server/discover`. A host could therefore execute the tool successfully without having a negotiated MCP Apps presentation channel.
diff --git a/docs/generated/MCP-CATALOG.md b/docs/generated/MCP-CATALOG.md
index 32c43acd..d5e07c2c 100644
--- a/docs/generated/MCP-CATALOG.md
+++ b/docs/generated/MCP-CATALOG.md
@@ -4,13 +4,13 @@
## Full MSO catalog
-<!-- mcp-toolset: server=1.15.2 version=2026.09.22.1 tools=114 read=56 write=35 exec=23 -->
+<!-- mcp-toolset: server=1.15.3 version=2026.09.22.2 tools=114 read=56 write=35 exec=23 -->
| Fact | Current source value |
|---|---:|
-| MCP server | `1.15.2` |
-| Toolset | `2026.09.22.1` |
-| Toolset changed at | `2026-09-22T06:29:53+07:00` |
+| MCP server | `1.15.3` |
+| Toolset | `2026.09.22.2` |
+| Toolset changed at | `2026-09-22T10:30:00+07:00` |
| Transport tools | **116** |
| Model/operator tools | **114** |
| Read | **56** |
@@ -148,7 +148,7 @@
## ChatGPT model profile
-<!-- mcp-chatgpt-profile: server=1.15.2 version=2026.09.22.1 tools=114 read=56 write=35 exec=23 app-only=2 total=116 -->
+<!-- mcp-chatgpt-profile: server=1.15.3 version=2026.09.22.2 tools=114 read=56 write=35 exec=23 app-only=2 total=116 -->
The ChatGPT profile automatically projects the complete MSO-owned generic model/operator catalog. OAuth scope is still enforced independently; app-only compatibility bridges stay app-only, and project-owned MCP tool names remain dynamic data behind the generic project bridge.
diff --git a/docs/integrations/CHATGPT-UI.md b/docs/integrations/CHATGPT-UI.md
index bd00b50e..ba7c7cf4 100644
--- a/docs/integrations/CHATGPT-UI.md
+++ b/docs/integrations/CHATGPT-UI.md
@@ -6,10 +6,10 @@ chooses List, Block or Page as a separate render step. The probe exists only to
| Surface | Entry tool | Resource | Purpose |
| --- | --- | --- | --- |
-| List | `render_mso_list` | `ui://mso/list-v2.html` | Searchable compact collections and item actions |
-| Block | `render_mso_block` | `ui://mso/block-v4.html` | Validation, actions, bounded CRUD input/output |
-| Page | `render_mso_page`, `integration_setup_open` | `ui://mso/page-v15.html` | Native workspaces, session assets and reviewed project previews |
-| Native probe | `mso_native_ui_probe` | `ui://mso/native-probe-v1.html` | Static diagnostic text only; no bridge, iframe, fetch, router or external dependency |
+| List | `render_mso_list` | `ui://mso/list-v3.html` | Searchable compact collections and item actions |
+| Block | `render_mso_block` | `ui://mso/block-v5.html` | Validation, actions, bounded CRUD input/output |
+| Page | `render_mso_page`, `integration_setup_open` | `ui://mso/page-v16.html` | Native workspaces, session assets and reviewed project previews |
+| Native probe | `mso_native_ui_probe` | `ui://mso/native-probe-v2.html` | Static diagnostic text only; no bridge, iframe, fetch, router or external dependency |
## Layout and identity
@@ -92,14 +92,13 @@ Page initializes MCP Apps protocol `2026-01-26`, then sends
notifications and legacy wrapped `window.openai.toolOutput` use the same route validator.
Unchanged outputs do not remount views; teardown clears active forms and observers.
-List, Block and Page use the standards-first MCP Apps bridge (`ui/initialize`, tool-result notifications and `ui/message`/`tools/call` where applicable). Their render tools advertise standard `ui.resourceUri`; Block additionally retains its existing `openai/outputTemplate` compatibility binding for older ChatGPT hosts. The Native UI probe intentionally advertises only standard `ui.resourceUri` and renders static HTML so a failure cannot be attributed to the Page shell, bridge, iframe, network access or legacy output-template compatibility. Every ChatGPT tool has an output schema;
+List, Block and Page use the standards-first MCP Apps bridge (ui/initialize, tool-result notifications and ui/message/tools/call where applicable). Their render tools keep _meta.ui.resourceUri as the canonical MCP Apps binding and also mirror it into the compatibility _meta["ui/resourceUri"] key used by the official ext-apps registration helper. resources/list preserves each canonical resource's _meta.ui listing metadata instead of stripping it, so hosts can index the same UI contract before resources/read. Block additionally retains its existing ChatGPT openai/outputTemplate compatibility binding; the other surfaces do not. The Native UI probe remains dependency-free static HTML, but now uses the same descriptor compatibility normalization as the product surfaces. Every ChatGPT tool has an output schema;
exact tools, counts and scopes are generated in [the catalog](../generated/MCP-CATALOG.md).
Resource CSP is explicit: Block allows no nested frames; Page includes only exact reviewed iframe origins and permits its MSO origin for private setup requests. OpenAI requires stricter review for `frameDomains`; this is an official review boundary, not a blanket iframe ban. `OS_MCP_UI_ORIGIN` controls the widget origin, otherwise
the configured public origin derives it. Legacy redirect metadata supports Open in MSO.
-The three product resources and the isolated Native UI diagnostic probe are listed. Older List/Block/Page URIs remain read aliases for current bytes, including List v1, Block v3/v2 and Page v14. `workflow_status` and `render_mso_surface`
-remain app-only compatibility tools. `workflow_start` has no UI binding.
+The three product resources and the isolated Native UI diagnostic probe are listed. Immediately previous canonical URIs remain read aliases after a cache-busting release (list-v2, block-v4, page-v15, native-probe-v1), together with the older compatibility aliases. Only the newest canonical URIs are advertised by resources/list. `workflow_status` and `render_mso_surface` remain app-only compatibility tools. `workflow_start` has no UI binding.
## Verification and deployment
@@ -110,10 +109,7 @@ Add MCP, native sessions/assets/monitor, host design tokens, interactive sandbox
provider search and 320–1920 px reflow. Production release journeys verify authorization,
real server handlers and provider revocation using synthetic stores.
-After shipping, compare live discovery/version/hash against `lib/mcp/toolset.ts` and the
-generated catalog, verify the three product resource URIs plus `ui://mso/native-probe-v1.html`, call `mso_native_ui_probe` from a directly selected registered app context, render a List, and reopen the Page. Hosts cache tool
-and resource descriptors: a development-app rescan/reconnect may still be needed.
-The server cannot replace an already mounted document in an old conversation.
+After shipping, compare live discovery/version/hash against lib/mcp/toolset.ts and the generated catalog, verify the three product resource URIs plus ui://mso/native-probe-v2.html, call mso_native_ui_probe from a directly selected registered app context, render a List, and reopen the Page. Also inspect the browser network request to /backend-api/ecosystem/widget: success requires that ChatGPT resolves the current template_pointer instead of returning 404. Hosts cache tool and resource descriptors, so a development-app Scan Tools/Refresh and a new conversation are required after a canonical URI/toolset change. The server cannot replace an already mounted document in an old conversation.
Official references:
- [MCP Apps host dimensions](https://apps.extensions.modelcontextprotocol.io/api/interfaces/app.McpUiHostContext.html)
diff --git a/lib/mcp/chatgpt-profile.test.ts b/lib/mcp/chatgpt-profile.test.ts
index acbf0dc0..772b51e1 100644
--- a/lib/mcp/chatgpt-profile.test.ts
+++ b/lib/mcp/chatgpt-profile.test.ts
@@ -45,8 +45,11 @@ describe("ChatGPT full generic MCP profile", () => {
expect(tools.some((tool) => tool.name === "tool_forge_promote")).toBe(true);
expect(tools.some((tool) => tool.name === "a2a_handoff")).toBe(true);
expect(tools.some((tool) => tool.name === "project_memory_upsert")).toBe(true);
- const nativeProbe = tools.find((tool) => tool.name === "mso_native_ui_probe") as { _meta?: { ui?: { resourceUri?: string; visibility?: string[] } } } | undefined;
+ const nativeProbe = tools.find((tool) => tool.name === "mso_native_ui_probe") as {
+ _meta?: { ui?: { resourceUri?: string; visibility?: string[] }; "ui/resourceUri"?: string };
+ } | undefined;
expect(nativeProbe?._meta?.ui).toEqual({ resourceUri: MSO_NATIVE_UI_PROBE_URI, visibility: ["model", "app"] });
+ expect(nativeProbe?._meta?.["ui/resourceUri"]).toBe(MSO_NATIVE_UI_PROBE_URI);
const probeCall = await dispatch({ id: 3, method: "tools/call", params: { name: "mso_native_ui_probe", arguments: {} } }, "read", "mcp:native-ui-probe", context);
expect(probeCall.error).toBeUndefined();
expect(JSON.stringify(probeCall.result)).toContain("MSO NATIVE UI WORKS");
diff --git a/lib/mcp/integration-setup.test.ts b/lib/mcp/integration-setup.test.ts
index 3f109138..866d81cc 100644
--- a/lib/mcp/integration-setup.test.ts
+++ b/lib/mcp/integration-setup.test.ts
@@ -20,7 +20,8 @@ describe("MCP integration setup privacy", () => {
it("requires write scope, accepts no credential parameters, and uses the existing Page", async () => {
const tool = SURFACE_TOOLS.find(t => t.name === "integration_setup_open")!;
expect(tool.scope).toBe("write"); expect(Object.keys(tool.inputSchema.properties)).toEqual(["user", "connection", "provider", "method"]);
- expect((tool.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v15\.html$/);
+ expect((tool.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v16\.html$/);
+ expect(tool.meta?.["ui/resourceUri"]).toBe((tool.meta?.ui as { resourceUri?: string }).resourceUri);
expect(tool.meta?.["openai/outputTemplate"]).toBeUndefined();
expect((await resolveSurfaceRoute("/integrations")).kind).toBe("integrations");
const script = await msoSurfaceScript();
diff --git a/lib/mcp/tools-block.test.ts b/lib/mcp/tools-block.test.ts
index bcdb972a..4366c882 100644
--- a/lib/mcp/tools-block.test.ts
+++ b/lib/mcp/tools-block.test.ts
@@ -41,6 +41,7 @@ describe("MSO Block MCP tool", () => {
expect(tool.inputSchema.properties).not.toHaveProperty("tool");
expect(tool.meta).toMatchObject({
ui: { resourceUri: MSO_BLOCK_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_BLOCK_URI,
"openai/outputTemplate": MSO_BLOCK_URI,
});
expect(JSON.stringify(tool.inputSchema)).toContain("Follow-up instruction");
diff --git a/lib/mcp/tools-block.ts b/lib/mcp/tools-block.ts
index 7f906ed5..74c9a9fe 100644
--- a/lib/mcp/tools-block.ts
+++ b/lib/mcp/tools-block.ts
@@ -157,6 +157,7 @@ export const BLOCK_TOOLS: McpTool[] = [
outputSchema: BLOCK_OUTPUT_SCHEMA,
meta: {
ui: { resourceUri: MSO_BLOCK_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_BLOCK_URI,
"openai/outputTemplate": MSO_BLOCK_URI,
"openai/toolInvocation/invoking": "Preparing interaction…",
"openai/toolInvocation/invoked": "Interaction ready",
diff --git a/lib/mcp/tools-list.test.ts b/lib/mcp/tools-list.test.ts
index 95d5270e..7a8f9a3c 100644
--- a/lib/mcp/tools-list.test.ts
+++ b/lib/mcp/tools-list.test.ts
@@ -8,6 +8,7 @@ describe("render_mso_list", () => {
it("is a read-only explicit render tool bound only to the List resource", () => {
expect(tool.scope).toBe("read");
expect(tool.meta).toMatchObject({ ui: { resourceUri: MSO_LIST_URI, visibility: ["model", "app"] } });
+ expect(tool.meta?.["ui/resourceUri"]).toBe(MSO_LIST_URI);
expect(tool.meta?.["openai/outputTemplate"]).toBeUndefined();
});
diff --git a/lib/mcp/tools-list.ts b/lib/mcp/tools-list.ts
index 2db3d495..58076629 100644
--- a/lib/mcp/tools-list.ts
+++ b/lib/mcp/tools-list.ts
@@ -22,6 +22,6 @@ export const LIST_TOOLS:McpTool[]=[{
scope:"read",annotations:READ_ONLY,
inputSchema:S({title:{type:"string",minLength:1,maxLength:240},description:{type:"string",maxLength:1000},layout:{type:"string",enum:["list","grid"]},searchable:{type:"boolean"},emptyMessage:{type:"string",maxLength:240},items:{type:"array",maxItems:40,items:ITEM_SCHEMA},actions:{type:"array",maxItems:3,items:ACTION_SCHEMA}},["title","items"]),
outputSchema:LIST_OUTPUT_SCHEMA,
- meta:{ui:{resourceUri:MSO_LIST_URI,visibility:["model","app"]},"openai/toolInvocation/invoking":"Preparing list…","openai/toolInvocation/invoked":"List ready","openai/widgetAccessible":true},
+ meta:{ui:{resourceUri:MSO_LIST_URI,visibility:["model","app"]},"ui/resourceUri":MSO_LIST_URI,"openai/toolInvocation/invoking":"Preparing list…","openai/toolInvocation/invoked":"List ready","openai/widgetAccessible":true},
run:async input=>normalizeList({...input,title:str(input,"title")}),
}];
diff --git a/lib/mcp/tools-native-probe.ts b/lib/mcp/tools-native-probe.ts
index e8871f83..635ed17d 100644
--- a/lib/mcp/tools-native-probe.ts
+++ b/lib/mcp/tools-native-probe.ts
@@ -22,6 +22,7 @@ export const NATIVE_UI_PROBE_TOOLS: McpTool[] = [{
outputSchema: NATIVE_UI_PROBE_OUTPUT_SCHEMA,
meta: {
ui: { resourceUri: MSO_NATIVE_UI_PROBE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_NATIVE_UI_PROBE_URI,
},
run: async () => ({ ok: true, message: "MSO NATIVE UI WORKS" }),
}];
diff --git a/lib/mcp/tools-surface.test.ts b/lib/mcp/tools-surface.test.ts
index f3422c25..cbd6e5c5 100644
--- a/lib/mcp/tools-surface.test.ts
+++ b/lib/mcp/tools-surface.test.ts
@@ -39,7 +39,8 @@ describe("MSO Page MCP tools", () => {
url: "https://demo.example.test/embed",
});
expect(result.app).not.toHaveProperty("sandbox");
- expect((render.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v15\.html$/);
+ expect((render.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v16\.html$/);
+ expect(render.meta?.["ui/resourceUri"]).toBe((render.meta?.ui as { resourceUri?: string }).resourceUri);
expect(render.meta?.["openai/outputTemplate"]).toBeUndefined();
});
@@ -58,7 +59,8 @@ describe("MSO Page MCP tools", () => {
it("uses only the standard resource binding for Page tools", () => {
for (const name of ["render_mso_page", "integration_setup_open"] as const) {
const value = tool(name);
- expect((value.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v15\.html$/);
+ expect((value.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v16\.html$/);
+ expect(value.meta?.["ui/resourceUri"]).toBe((value.meta?.ui as { resourceUri?: string }).resourceUri);
expect(value.meta?.["openai/outputTemplate"]).toBeUndefined();
}
});
diff --git a/lib/mcp/tools-surface.ts b/lib/mcp/tools-surface.ts
index fec71e9e..a21be65f 100644
--- a/lib/mcp/tools-surface.ts
+++ b/lib/mcp/tools-surface.ts
@@ -64,6 +64,7 @@ export const SURFACE_TOOLS: McpTool[] = [
outputSchema: PAGE_OUTPUT,
meta: {
ui: { resourceUri: MSO_PAGE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_PAGE_URI,
"openai/widgetAccessible": true,
"openai/toolInvocation/invoking": "Opening secure integration setup…",
"openai/toolInvocation/invoked": "Secure setup form opened",
@@ -96,6 +97,7 @@ export const SURFACE_TOOLS: McpTool[] = [
outputSchema: PAGE_OUTPUT,
meta: {
ui: { resourceUri: MSO_PAGE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_PAGE_URI,
"openai/toolInvocation/invoking": "Opening MSO Page…",
"openai/toolInvocation/invoked": "MSO Page opened",
"openai/widgetAccessible": true,
diff --git a/lib/mcp/toolset.ts b/lib/mcp/toolset.ts
index cf62f2a5..4c1726cf 100644
--- a/lib/mcp/toolset.ts
+++ b/lib/mcp/toolset.ts
@@ -3,9 +3,9 @@ import type { Scope } from "./scope";
import type { McpTool } from "./tool-kit";
import { toolDescriptor, type McpToolProfile } from "./tool-contract";
-export const MCP_SERVER_VERSION = "1.15.2";
-export const MCP_TOOLSET_VERSION = "2026.09.22.1";
-export const MCP_TOOLSET_CHANGED_AT = "2026-09-22T06:29:53+07:00";
+export const MCP_SERVER_VERSION = "1.15.3";
+export const MCP_TOOLSET_VERSION = "2026.09.22.2";
+export const MCP_TOOLSET_CHANGED_AT = "2026-09-22T10:30:00+07:00";
export type McpToolsetInfo = {
serverVersion: string;
diff --git a/lib/mcp/ui-block.ts b/lib/mcp/ui-block.ts
index 652a249e..de848ff2 100644
--- a/lib/mcp/ui-block.ts
+++ b/lib/mcp/ui-block.ts
@@ -3,7 +3,7 @@ import { widgetResourceMeta } from "./ui-config";
import { compactUiBridgeScript } from "./ui-compact-bridge";
import { MSO_WIDGET_THEME_SCRIPT, MSO_WIDGET_TOKENS } from "./ui-widget-tokens";
-export const MSO_BLOCK_URI = "ui://mso/block-v4.html";
+export const MSO_BLOCK_URI = "ui://mso/block-v5.html";
const MIME = "text/html;profile=mcp-app";
const html = String.raw`<meta charset="utf-8"><main class="mso-block" aria-live="polite">
diff --git a/lib/mcp/ui-list.ts b/lib/mcp/ui-list.ts
index 5d98257d..77632d1a 100644
--- a/lib/mcp/ui-list.ts
+++ b/lib/mcp/ui-list.ts
@@ -3,7 +3,7 @@ import { widgetResourceMeta } from "./ui-config";
import { compactUiBridgeScript } from "./ui-compact-bridge";
import { MSO_WIDGET_THEME_SCRIPT, MSO_WIDGET_TOKENS } from "./ui-widget-tokens";
-export const MSO_LIST_URI = "ui://mso/list-v2.html";
+export const MSO_LIST_URI = "ui://mso/list-v3.html";
const MIME = "text/html;profile=mcp-app";
const html = String.raw`<meta charset="utf-8"><main class="mso-list" aria-live="polite">
diff --git a/lib/mcp/ui-native-probe.ts b/lib/mcp/ui-native-probe.ts
index cd4959f2..b526404b 100644
--- a/lib/mcp/ui-native-probe.ts
+++ b/lib/mcp/ui-native-probe.ts
@@ -1,4 +1,4 @@
-export const MSO_NATIVE_UI_PROBE_URI = "ui://mso/native-probe-v1.html";
+export const MSO_NATIVE_UI_PROBE_URI = "ui://mso/native-probe-v2.html";
const MIME = "text/html;profile=mcp-app";
const html = String.raw`<!doctype html><meta charset="utf-8"><title>MSO Native UI Probe</title><main style="box-sizing:border-box;padding:16px;font:600 16px/1.4 system-ui,sans-serif">MSO NATIVE UI WORKS</main>`;
diff --git a/lib/mcp/ui-resource-discovery.test.ts b/lib/mcp/ui-resource-discovery.test.ts
new file mode 100644
index 00000000..3cadf1bf
--- /dev/null
+++ b/lib/mcp/ui-resource-discovery.test.ts
@@ -0,0 +1,52 @@
+import { afterAll, describe, expect, it, vi } from "vitest";
+
+vi.mock("server-only", () => ({}));
+vi.stubEnv("OS_PUBLIC_ORIGIN", "https://mso.example.test");
+vi.stubEnv("OS_MCP_UI_ORIGIN", "");
+vi.stubEnv("MSO_SURFACE_APPS_JSON", "");
+afterAll(() => vi.unstubAllEnvs());
+
+const { dispatch } = await import("./dispatch");
+const {
+ MCP_APP_MIME_TYPE,
+ MSO_BLOCK_URI,
+ MSO_LIST_URI,
+ MSO_NATIVE_UI_PROBE_URI,
+ MSO_PAGE_URI,
+} = await import("./ui-resources");
+
+describe("MCP App resource discovery", () => {
+ it("advertises the three product resources plus the isolated Native UI diagnostic probe", async () => {
+ const listed = await dispatch({ id: 1, method: "resources/list" }, "read", "mcp:ui-resource");
+ const resources = (listed.result as {
+ resources: Array<{ uri: string; name: string; mimeType: string; _meta?: Record<string, any> }>;
+ }).resources;
+ expect(resources).toEqual([
+ expect.objectContaining({ uri: MSO_LIST_URI, name: "MSO List", mimeType: MCP_APP_MIME_TYPE }),
+ expect.objectContaining({ uri: MSO_BLOCK_URI, name: "MSO Block", mimeType: MCP_APP_MIME_TYPE }),
+ expect.objectContaining({ uri: MSO_PAGE_URI, name: "MSO Page", mimeType: MCP_APP_MIME_TYPE }),
+ expect.objectContaining({ uri: MSO_NATIVE_UI_PROBE_URI, name: "MSO Native UI Probe", mimeType: MCP_APP_MIME_TYPE }),
+ ]);
+ for (const resource of resources) {
+ expect(resource._meta?.ui, resource.uri).toBeDefined();
+ }
+ });
+
+ it("serves the Native UI probe as static dependency-free HTML", async () => {
+ const read = await dispatch({ id: 31, method: "resources/read", params: { uri: MSO_NATIVE_UI_PROBE_URI } }, "read", "mcp:ui-native-probe");
+ const content = (read.result as { contents: Array<{ uri: string; mimeType: string; text: string; _meta: Record<string, any> }> }).contents[0];
+ expect(content.uri).toBe(MSO_NATIVE_UI_PROBE_URI);
+ expect(content.mimeType).toBe(MCP_APP_MIME_TYPE);
+ expect(content.text).toContain("MSO NATIVE UI WORKS");
+ expect(content.text).not.toContain("<script");
+ expect(content.text).not.toContain("fetch(");
+ expect(content.text).not.toContain("iframe");
+ expect(content._meta).toEqual({
+ ui: {
+ prefersBorder: true,
+ csp: { connectDomains: [], resourceDomains: [] },
+ },
+ });
+ });
+
+});
diff --git a/lib/mcp/ui-resource-state.test.ts b/lib/mcp/ui-resource-state.test.ts
index ddd0d8ce..f0e78e15 100644
--- a/lib/mcp/ui-resource-state.test.ts
+++ b/lib/mcp/ui-resource-state.test.ts
@@ -11,10 +11,14 @@ const {
MSO_BLOCK_URI,
MSO_LIST_URI,
MSO_PAGE_URI,
+ LEGACY_LIST_V2_URI,
LEGACY_LIST_V1_URI,
+ LEGACY_BLOCK_V4_URI,
LEGACY_BLOCK_V3_URI,
LEGACY_BLOCK_V1_URI,
+ LEGACY_PAGE_V15_URI,
LEGACY_PAGE_V1_URI,
+ LEGACY_NATIVE_UI_PROBE_V1_URI,
LEGACY_WORKFLOW_PROGRESS_URI,
LEGACY_SURFACE_URI,
readUiResource,
@@ -76,25 +80,37 @@ describe("MCP Apps List, Block and Page contract", () => {
const canonicalList = await readUiResource(MSO_LIST_URI);
const canonicalBlock = await readUiResource(MSO_BLOCK_URI);
const canonicalPage = await readUiResource(MSO_PAGE_URI);
+ const listV2 = await readUiResource(LEGACY_LIST_V2_URI);
const listV1 = await readUiResource(LEGACY_LIST_V1_URI);
+ const blockV4 = await readUiResource(LEGACY_BLOCK_V4_URI);
const blockV3 = await readUiResource(LEGACY_BLOCK_V3_URI);
const blockV1 = await readUiResource(LEGACY_BLOCK_V1_URI);
+ const pageV15 = await readUiResource(LEGACY_PAGE_V15_URI);
const pageV1 = await readUiResource(LEGACY_PAGE_V1_URI);
+ const probeV1 = await readUiResource(LEGACY_NATIVE_UI_PROBE_V1_URI);
const legacyBlock = await readUiResource(LEGACY_WORKFLOW_PROGRESS_URI);
const legacyPage = await readUiResource(LEGACY_SURFACE_URI);
+ expect(listV2).toMatchObject({ uri: LEGACY_LIST_V2_URI, text: canonicalList?.text });
expect(listV1).toMatchObject({ uri: LEGACY_LIST_V1_URI, text: canonicalList?.text });
+ expect(blockV4).toMatchObject({ uri: LEGACY_BLOCK_V4_URI, text: canonicalBlock?.text });
expect(blockV3).toMatchObject({ uri: LEGACY_BLOCK_V3_URI, text: canonicalBlock?.text });
expect(blockV1).toMatchObject({ uri: LEGACY_BLOCK_V1_URI, text: canonicalBlock?.text });
+ expect(pageV15).toMatchObject({ uri: LEGACY_PAGE_V15_URI, text: canonicalPage?.text });
expect(pageV1).toMatchObject({ uri: LEGACY_PAGE_V1_URI, text: canonicalPage?.text });
+ expect(probeV1?.text).toContain("MSO NATIVE UI WORKS");
expect(legacyBlock).toMatchObject({ uri: LEGACY_WORKFLOW_PROGRESS_URI, text: canonicalBlock?.text });
expect(legacyPage).toMatchObject({ uri: LEGACY_SURFACE_URI, text: canonicalPage?.text });
const listed = await dispatch({ id: 31, method: "resources/list" }, "read", "mcp:ui-alias");
const serialized = JSON.stringify(listed.result);
+ expect(serialized).not.toContain(LEGACY_LIST_V2_URI);
expect(serialized).not.toContain(LEGACY_LIST_V1_URI);
+ expect(serialized).not.toContain(LEGACY_BLOCK_V4_URI);
expect(serialized).not.toContain(LEGACY_BLOCK_V3_URI);
expect(serialized).not.toContain(LEGACY_BLOCK_V1_URI);
+ expect(serialized).not.toContain(LEGACY_PAGE_V15_URI);
expect(serialized).not.toContain(LEGACY_PAGE_V1_URI);
+ expect(serialized).not.toContain(LEGACY_NATIVE_UI_PROBE_V1_URI);
expect(serialized).not.toContain(LEGACY_WORKFLOW_PROGRESS_URI);
expect(serialized).not.toContain(LEGACY_SURFACE_URI);
});
diff --git a/lib/mcp/ui-resources.test.ts b/lib/mcp/ui-resources.test.ts
index 1a5817d9..25ce9951 100644
--- a/lib/mcp/ui-resources.test.ts
+++ b/lib/mcp/ui-resources.test.ts
@@ -45,6 +45,7 @@ describe("MCP Apps List, Block and Page contract", () => {
expect(list?.outputSchema).toBeDefined();
expect(list?._meta).toMatchObject({
ui: { resourceUri: MSO_LIST_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_LIST_URI,
"openai/widgetAccessible": true,
});
expect(list?._meta?.["openai/outputTemplate"]).toBeUndefined();
@@ -53,6 +54,7 @@ describe("MCP Apps List, Block and Page contract", () => {
expect(block?.outputSchema).toBeDefined();
expect(block?._meta).toMatchObject({
ui: { resourceUri: MSO_BLOCK_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_BLOCK_URI,
"openai/outputTemplate": MSO_BLOCK_URI,
"openai/widgetAccessible": true,
});
@@ -61,6 +63,7 @@ describe("MCP Apps List, Block and Page contract", () => {
expect(page?.outputSchema).toBeDefined();
expect(page?._meta).toMatchObject({
ui: { resourceUri: MSO_PAGE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_PAGE_URI,
"openai/widgetAccessible": true,
});
expect(page?._meta?.["openai/outputTemplate"]).toBeUndefined();
@@ -68,6 +71,7 @@ describe("MCP Apps List, Block and Page contract", () => {
const setup = tools.find((tool) => tool.name === "integration_setup_open");
expect(setup?._meta).toMatchObject({
ui: { resourceUri: MSO_PAGE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_PAGE_URI,
"openai/widgetAccessible": true,
});
expect(setup?._meta?.["openai/outputTemplate"]).toBeUndefined();
@@ -76,6 +80,7 @@ describe("MCP Apps List, Block and Page contract", () => {
expect(probe?.outputSchema).toBeDefined();
expect(probe?._meta).toMatchObject({
ui: { resourceUri: MSO_NATIVE_UI_PROBE_URI, visibility: ["model", "app"] },
+ "ui/resourceUri": MSO_NATIVE_UI_PROBE_URI,
});
expect(probe?._meta?.["openai/outputTemplate"]).toBeUndefined();
expect(probe?._meta?.["openai/widgetAccessible"]).toBeUndefined();
@@ -107,34 +112,6 @@ describe("MCP Apps List, Block and Page contract", () => {
}
});
- it("advertises the three product resources plus the isolated Native UI diagnostic probe", async () => {
- const listed = await dispatch({ id: 1, method: "resources/list" }, "read", "mcp:ui-resource");
- const resources = (listed.result as { resources: Array<{ uri: string; name: string; mimeType: string }> }).resources;
- expect(resources).toEqual([
- expect.objectContaining({ uri: MSO_LIST_URI, name: "MSO List", mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: MSO_BLOCK_URI, name: "MSO Block", mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: MSO_PAGE_URI, name: "MSO Page", mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: MSO_NATIVE_UI_PROBE_URI, name: "MSO Native UI Probe", mimeType: MCP_APP_MIME_TYPE }),
- ]);
- });
-
- it("serves the Native UI probe as static dependency-free HTML", async () => {
- const read = await dispatch({ id: 31, method: "resources/read", params: { uri: MSO_NATIVE_UI_PROBE_URI } }, "read", "mcp:ui-native-probe");
- const content = (read.result as { contents: Array<{ uri: string; mimeType: string; text: string; _meta: Record<string, any> }> }).contents[0];
- expect(content.uri).toBe(MSO_NATIVE_UI_PROBE_URI);
- expect(content.mimeType).toBe(MCP_APP_MIME_TYPE);
- expect(content.text).toContain("MSO NATIVE UI WORKS");
- expect(content.text).not.toContain("<script");
- expect(content.text).not.toContain("fetch(");
- expect(content.text).not.toContain("iframe");
- expect(content._meta).toEqual({
- ui: {
- prefersBorder: true,
- csp: { connectDomains: [], resourceDomains: [] },
- },
- });
- });
-
it("serves a self-contained searchable List whose actions only return follow-ups", async () => {
const read = await dispatch({ id: 29, method: "resources/read", params: { uri: MSO_LIST_URI } }, "read", "mcp:ui-list");
const content = (read.result as { contents: Array<{ uri: string; mimeType: string; text: string; _meta: Record<string, any> }> }).contents[0];
@@ -186,7 +163,7 @@ describe("MCP Apps List, Block and Page contract", () => {
});
expect(content._meta.ui.csp.frameDomains).toBeUndefined();
expect(content._meta["openai/widgetCSP"]).toEqual({ redirect_domains: [MSO_ORIGIN] });
- expect(MSO_BLOCK_URI).toContain("block-v4.html");
+ expect(MSO_BLOCK_URI).toContain("block-v5.html");
});
it("serves the full Page without external frame domains by default", async () => {
@@ -211,7 +188,7 @@ describe("MCP Apps List, Block and Page contract", () => {
});
expect(content._meta.ui.csp.frameDomains).toBeUndefined();
expect(content._meta["openai/widgetCSP"]).toEqual({ connect_domains: [MSO_ORIGIN], redirect_domains: [MSO_ORIGIN] });
- expect(MSO_PAGE_URI).toContain("page-v15.html");
+ expect(MSO_PAGE_URI).toContain("page-v16.html");
expect(content.text).not.toContain("createElement(\"iframe\")");
expect(content.text).not.toContain("mountReviewedFrame");
});
diff --git a/lib/mcp/ui-resources.ts b/lib/mcp/ui-resources.ts
index 38b3e220..f8ebb9c6 100644
--- a/lib/mcp/ui-resources.ts
+++ b/lib/mcp/ui-resources.ts
@@ -11,9 +11,12 @@ export const MCP_UI_EXTENSION_CAPABILITY = { mimeTypes: [MCP_APP_MIME_TYPE] } as
// Read-only aliases keep already-cached ChatGPT action descriptors functional
// across the UI-contract migration. They are intentionally not advertised by
// resources/list advertises the three product presentation levels plus the isolated Native UI diagnostic probe.
+export const LEGACY_LIST_V2_URI = "ui://mso/list-v2.html";
export const LEGACY_LIST_V1_URI = "ui://mso/list-v1.html";
+export const LEGACY_BLOCK_V4_URI = "ui://mso/block-v4.html";
export const LEGACY_BLOCK_V3_URI = "ui://mso/block-v3.html";
export const LEGACY_BLOCK_V2_URI = "ui://mso/block-v2.html";
+export const LEGACY_PAGE_V15_URI = "ui://mso/page-v15.html";
export const LEGACY_PAGE_V14_URI = "ui://mso/page-v14.html";
export const LEGACY_PAGE_V13_URI = "ui://mso/page-v13.html";
export const LEGACY_BLOCK_V1_URI = "ui://mso/block-v1.html";
@@ -31,6 +34,7 @@ export const LEGACY_PAGE_V2_URI = "ui://mso/page-v2.html";
export const LEGACY_PAGE_V1_URI = "ui://mso/page-v1.html";
export const LEGACY_WORKFLOW_PROGRESS_URI = "ui://mso/workflow-progress-v3.html";
export const LEGACY_SURFACE_URI = "ui://mso/surface-v5.html";
+export const LEGACY_NATIVE_UI_PROBE_V1_URI = "ui://mso/native-probe-v1.html";
export type McpUiResource = {
uri: string;
@@ -42,6 +46,7 @@ export type McpUiResource = {
};
const LEGACY_PAGE_URIS = new Set([
+ LEGACY_PAGE_V15_URI,
LEGACY_PAGE_V14_URI,
LEGACY_PAGE_V13_URI,
LEGACY_PAGE_V12_URI,
@@ -59,18 +64,21 @@ const LEGACY_PAGE_URIS = new Set([
LEGACY_SURFACE_URI,
]);
-export async function listUiResources(): Promise<Array<{ uri: string; name: string; description: string; mimeType: string }>> {
+export async function listUiResources(): Promise<Array<{ uri: string; name: string; description: string; mimeType: string; _meta: Record<string, unknown> }>> {
const page = await msoPageResource();
- return [MSO_LIST_RESOURCE, MSO_BLOCK_RESOURCE, page, MSO_NATIVE_UI_PROBE_RESOURCE].map(({ uri, name, description, mimeType }) => ({ uri, name, description, mimeType }));
+ return [MSO_LIST_RESOURCE, MSO_BLOCK_RESOURCE, page, MSO_NATIVE_UI_PROBE_RESOURCE].map(
+ ({ uri, name, description, mimeType, _meta }) => ({ uri, name, description, mimeType, _meta }),
+ );
}
export async function readUiResource(uri: string): Promise<McpUiResource | undefined> {
if (uri === MSO_LIST_URI) return MSO_LIST_RESOURCE;
- if (uri === LEGACY_LIST_V1_URI) return { ...MSO_LIST_RESOURCE, uri };
+ if (uri === LEGACY_LIST_V2_URI || uri === LEGACY_LIST_V1_URI) return { ...MSO_LIST_RESOURCE, uri };
if (uri === MSO_BLOCK_URI) return MSO_BLOCK_RESOURCE;
if (uri === MSO_PAGE_URI) return msoPageResource();
if (uri === MSO_NATIVE_UI_PROBE_URI) return MSO_NATIVE_UI_PROBE_RESOURCE;
- if (uri === LEGACY_BLOCK_V3_URI || uri === LEGACY_BLOCK_V2_URI || uri === LEGACY_BLOCK_V1_URI || uri === LEGACY_WORKFLOW_PROGRESS_URI) return { ...MSO_BLOCK_RESOURCE, uri };
+ if (uri === LEGACY_NATIVE_UI_PROBE_V1_URI) return { ...MSO_NATIVE_UI_PROBE_RESOURCE, uri };
+ if (uri === LEGACY_BLOCK_V4_URI || uri === LEGACY_BLOCK_V3_URI || uri === LEGACY_BLOCK_V2_URI || uri === LEGACY_BLOCK_V1_URI || uri === LEGACY_WORKFLOW_PROGRESS_URI) return { ...MSO_BLOCK_RESOURCE, uri };
if (LEGACY_PAGE_URIS.has(uri)) return { ...(await msoPageResource()), uri };
return undefined;
}
diff --git a/lib/mcp/ui-surface.ts b/lib/mcp/ui-surface.ts
index 1df6ac30..bab7f845 100644
--- a/lib/mcp/ui-surface.ts
+++ b/lib/mcp/ui-surface.ts
@@ -7,7 +7,7 @@ import { OPEN_IN_MSO_SCRIPT, openInMsoControls } from "./ui-navigation";
import { msoSurfaceScript } from "./ui-surface-script";
import { MSO_SURFACE_STYLE } from "./ui-surface-style";
-export const MSO_PAGE_URI = "ui://mso/page-v15.html";
+export const MSO_PAGE_URI = "ui://mso/page-v16.html";
const MIME = "text/html;profile=mcp-app";
async function pageHtml(apps: readonly SurfaceApp[]): Promise<string> {
diff --git a/scripts/e2e/mcp-page.mjs b/scripts/e2e/mcp-page.mjs
index 5a184342..c8166d69 100644
--- a/scripts/e2e/mcp-page.mjs
+++ b/scripts/e2e/mcp-page.mjs
@@ -48,10 +48,10 @@ const output = {
},
};
-assert.equal(listResource.uri, "ui://mso/list-v2.html");
+assert.equal(listResource.uri, "ui://mso/list-v3.html");
assert.deepEqual(listResource._meta.ui.csp.connectDomains, []);
assert.deepEqual(listResource._meta.ui.csp.resourceDomains, []);
-assert.equal(resource.uri, "ui://mso/page-v15.html");
+assert.equal(resource.uri, "ui://mso/page-v16.html");
assert.deepEqual(resource._meta.ui.csp.frameDomains, [registry[0].origin]);
assert.deepEqual(resource._meta["openai/widgetCSP"].frame_domains, [registry[0].origin]);
assert(resource.text.includes('el("iframe","preview-frame")'));