mcp-app-demo

v0.3.1
@instush/mcp-app-demo Checked 1 day ago Published 4 months ago

Demo MCP App: verifies that a local stdio MCP server gets its ui:// card rendered, and what works inside it, per host.

A throwaway MCP App whose only job is to answer two questions before we touch the real @instush/mcp bridge: 1. Does a host render a ui:// view served by a local stdio server at all? 2. Inside that view, what actually works — server tool calls, pushing a chat message, opening links, display modes, clipboard, auto-height, theming? No WebSocket, no editor, no pairing, no network.

Summary extracted from the README.

mcp-app-demo

A throwaway MCP App whose only job is to answer two questions before we touch the real @instush/mcp bridge:

  1. Does a host render a ui:// view served by a local stdio server at all?
  2. Inside that view, what actually works — server tool calls, pushing a chat message, opening links, display modes, clipboard, auto-height, theming?

No WebSocket, no editor, no pairing, no network. It is built like instush-mcp on purpose (plain ESM, low-level Server + StdioServerTransport, capability and _meta written by hand — no McpServer, no registerAppTool) so the findings transfer to the real bridge unchanged.

Build

npm install
npm run build     # bundles ui/ into ONE self-contained dist/card.html
npm test          # server-side self-check — run this before blaming a host

npm test asserts the three things that make a plain MCP server an App: the io.modelcontextprotocol/ui capability, _meta.ui.resourceUri on the tool, and a text/html;profile=mcp-app resource that reads back self-contained. If it passes and a host still shows no UI, the gap is on the host side.

Install it

Add an entry pointing at the published package. Claude — in ~/Library/Application Support/Claude/claude_desktop_config.json (NOT user scope: measured 2026-07-29, Claude renders ui:// cards only from the Desktop config; a ~/.claude.json install lists the tools and renders nothing):

"mcp-app-demo": { "command": "npx", "args": ["-y", "@instush/mcp-app-demo"] }

Codex / ChatGPT desktop — in ~/.codex/config.toml:

[mcp_servers.mcp-app-demo]
command = "npx"
args = ["-y", "@instush/mcp-app-demo"]

Register in exactly ONE file. Two entries mean two server processes with identical tool names, and a card that resolves a parked call then breaks silently — the click and the wait can land in different processes. (Claude Desktop already starts two processes per entry on its own.)

Claude Desktop chat can write neither file — no shell, no file tools. Use the </> Code tab (when it is a local session, not a cloud sandbox), another local agent, a terminal, or Settings → Developer → Edit Config.

Restart the host, then ask it: "call demo_panel" (the category loop) or "call demo_card" (the capability diagnostic).

The server logs every request it receives to stderr with timings, so you can also see whether the host reads the UI resource, and when (before the tool call = preloading, after = lazy, never = it ignored the extension).

What to look for

The card reports, in one screen:

Section Question it answers
Pairing-code lookalike How will the real 6-digit code read in this host? Does Copy work in a sandboxed iframe?
Server round-trip Can the view call demo_status on the server — with and without a user gesture?
Buttons sendMessage (push a message into the chat), openLink, updateModelContext, requestDisplayMode(fullscreen), grow/shrink (does the iframe follow the content height?)
What this host says it supports The host's own hostCapabilities from ui/initialize — the ground truth for feature-detection in the real views
Host context theme, display mode, container dimensions, how many style variables the host supplied
structuredContent Proves the view can render purely from the tool result (the portable path — ChatGPT gates view-initiated tool calls behind a user approval panel)
Probe log Per-probe pass/fail with the host's error text

Record per host

renders y/n · callServerTool y/n · unprompted call y/n · sendMessage y/n · openLink y/n · requestDisplayMode y/n · clipboard y/n · auto-height y/n · theme variables supplied y/n

Files

  • server.js — the MCP server (capability + tool _meta + ui:// resource, all by hand)
  • ui/card.html, ui/app.js — the view (uses App from @modelcontextprotocol/ext-apps)
  • build.mjs — esbuild bundle inlined into dist/card.html
  • selftest.mjs — the server-side assertions