Skip to content

Remove ext-apps SDK-v1 shims when the package ships a v2 peer (ext-apps#702) #1745

Description

@cliffhall

Follow-up from the #1633 Extensions stack (Phases #1738 / #1739 / #1740). Tracks removing the throwaway shims the Inspector carries because @modelcontextprotocol/ext-apps still peers on TS SDK v1 while the Inspector runs SDK v2 (2.0.0-beta.x).

Trigger

Close this when @modelcontextprotocol/ext-apps publishes a release whose peer is SDK v2 (upstream ext-apps#702). Installed today: @modelcontextprotocol/ext-apps@1.7.4 (peers @modelcontextprotocol/sdk: ^1.29.0).

Shim sites to remove (verified 2026-07-22)

Each is tagged in-source with TODO: drop when ext-apps#702 ships a v2 peer. This should be closeable by a single sweep:

  1. core/mcp/apps.ts:27tool as Parameters<typeof getToolUiResourceUri>[0] (v1 Tool vs v2 Tool at the getToolUiResourceUri boundary).
  2. core/mcp/apps.ts:78 — the UiMetaShape structural interface standing in for ext-apps' McpUiToolMeta / McpUiResourceMeta, which aren't importable under NodeNext because of an extensionless re-export in the package's .d.ts. Switch to the named types once upstream fixes that re-export.
  3. clients/web/src/components/elements/AppRenderer/createAppBridgeFactory.ts:~218client as unknown as ConstructorParameters<typeof AppBridge>[0] and the Implementation cast (ext-apps' AppBridge peers on SDK v1's Client/Implementation).
  4. core/mcp/inspectorClient.ts:~1698 (getAppRendererClient() Proxy) — translates ext-apps' v1 schema-first setNotificationHandler(schema, handler) into SDK v2's method-string form.

NOT added by Phase 3 (#1740)

The io.modelcontextprotocol/ui advertisement added in #1740 needed no ext-apps cast — ClientCapabilities.extensions is typed { [key: string]: object }, so { mimeTypes: [...] } is assignable directly. The extension id / MIME-type constants are mirrored locally in core/mcp/extensions.ts (UI_EXTENSION_KEY / MCP_APP_MIME_TYPE) rather than imported, for the same NodeNext//server-subpath reasons — those can optionally switch to importing ext-apps' EXTENSION_ID / RESOURCE_MIME_TYPE once the v2-peer release lands, but they are stable spec strings so it's low priority.

Acceptance

  • Bump @modelcontextprotocol/ext-apps to the v2-peer release.
  • Remove shims 1–4 above; replace UiMetaShape with the named ext-apps types.
  • Optionally source UI_EXTENSION_KEY / MCP_APP_MIME_TYPE from ext-apps.
  • npm run ci green.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions