@guuey/mcp-apps-host

中文文档
0.36.0发布于 2026/11/15MITTypeScriptES Module构建来源已验证近 30 天下载 8836

The MCP Apps (SEP-1865) Host role for guuey's chat surfaces — view-mount narrowing across UI channels, ui:// locator rehydration by resources/read, and the sandbox-trust channel contract. Vendor-neutral: any spec-following MCP App mounts through it.

原始使用文档

@guuey/mcp-apps-host

The Host role of MCP Apps (SEP-1865) for guuey's chat surfaces — and for any host that mounts MCP Apps views.

The spec's constant refrain is "Host MUST …". This package implements that role's client-side narrowing and mount contract:

  • View-mount dispatch (toolResultViewMount, snapshotViewMount): one narrowing that answers "what, if anything, does this block mount?" across the UI channels a transcript carries — an inline ui:// resource payload, or a bare ui:// locator (from uiData.resourceUri, else structuredContent.resourceUri). Every ui:// producer, ggui's ggui_render included, is a locator producer: the ggui vendor fast-path retired 2026-08-16 (guuey#209) once the pod's live read door and ggui's read-time mint made the spec's read path strictly fresher than any inlined bootstrap. Its helpers stay exported one minor as @deprecated.
  • Locator rehydration: a persisted ui:// locator remounts by a fresh, authenticated resources/read of the uri — the spec-consistent template fetch (the spec itself defers persistence/restoration; a full remount additionally owes the View ui/notifications/tool-input + its tool result) — never by replaying stored mount material. The read transport is injected (UiResourceReader); the host owns auth and user-ownership enforcement, and a deny is byte-identical to a miss.
  • Generic reader assembly (createMcpUiResourceReader): hand it one host-owned resources/read callable (a raw MCP client, an authenticated proxy — no SDK dependency imposed) and get a UiResourceReader back, with the trust rules built in: deny == miss == placeholder, and the sandbox channel derives from the requested locator uri, never the response (uiResourceChannel). @guuey/agent-client's createUiResourceReader is this assembly over guuey's platform proxy.
  • Sandbox-trust channels (ViewMountChannel): which sandbox host page a payload may mount in, until per-resource declared-CSP construction lands.
  • The host itself (attachViewHost, and <GuueyView> from @guuey/mcp-apps-host/react): a spec-following view opens with the ui/initialize App handshake and blocks on it — mount material alone renders a blank frame forever. attachViewHost(iframe, config) answers that handshake for any embedder (framework-agnostic, one call); the React component additionally owns iframe creation, lifecycle, and the safe sandbox default (allow-scripts without allow-same-origin — with it, agent-generated HTML would run as your origin — plus allow="clipboard-write" so generated copy buttons work). Configurable where a host genuinely varies: hostCapabilities (default {} — advertise only what you implement), an optional tools/call relay hook (privilege boundary, default off; pair with createMcpUiActionRelay), hostContext, and the negotiation timeout. While a frame negotiates, the state is labeled (negotiating / connected / no-handshake), never a blank page.
  • Resolved-only mount walk (resolveViewMount): chain it off toolResultViewMount/snapshotViewMount with your reader and render only ResolvedViewMounts — the locator round-trip is folded in.

Vendor-neutral by principle: ggui's MCP Apps run on any spec-following host (claude.ai, chatgpt.com, guuey) precisely because they follow the spec; this package is guuey's OSS host-side support for the same spec.

Conformance status and roadmap: docs/development/mcp-apps-host-conformance.md in the guuey monorepo (guuey#123).

Support

Questions and help: the guuey community on Discord — https://guuey.com/discord. Bugs and feature requests: https://github.com/withguuey/guuey-sdks/issues.

版本与发布记录

@guuey/mcp-apps-host 共发布 72 个版本,首次发布于 2026/08/08;过去 12 个月发布了 72 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.36.0latest2026/11/152 天前
0.35.02026/11/116 天前
0.34.02026/11/0610 天前
0.33.02026/11/0610 天前
0.32.02026/11/0610 天前
0.31.12026/09/291 个月前

其他发布通道:next → 0.16.15。

关于 @guuey/mcp-apps-host 的常见问题

@guuey/mcp-apps-host 是什么?

The MCP Apps (SEP-1865) Host role for guuey's chat surfaces — view-mount narrowing across UI channels, ui:// locator rehydration by resources/read, and the sandbox-trust channel contract. Vendor-neutral: any spec-following MCP App mounts through it.

如何安装 @guuey/mcp-apps-host?

在项目目录运行 npm install @guuey/mcp-apps-host,或使用 pnpm add / yarn add / bun add。

@guuey/mcp-apps-host 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@guuey/mcp-apps-host 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@guuey/mcp-apps-host 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@guuey/mcp-apps-host 可以商用吗?

@guuey/mcp-apps-host 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@guuey/mcp-apps-host 的下载量有多少?

根据 npm 官方下载统计,@guuey/mcp-apps-host 在 2026/10/17 – 2026/11/15 这 30 天内被下载 8,836 次,日均约 295 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@guuey/mcp-apps-host 还在维护吗?

最新版本 0.36.0 发布于 2026/11/15(2 天前);至今共发布 72 个版本,其中过去 12 个月发布了 72 个;首次发布于 2026/08/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。