@copilotkit/mcp-apps-renderer

中文文档
1.86.0发布于 2026/11/11MITTypeScriptESM + CJS构建来源已验证近 30 天下载 101.4万

Framework-agnostic MCP Apps host for CopilotKit - the app<->host protocol (ext-apps AppBridge), sandbox proxy, and shared renderer consumed by the React, Vue, and Angular frontends

原始使用文档

@copilotkit/mcp-apps-renderer

Framework-agnostic MCP Apps host for CopilotKit: the app↔host protocol on top of @modelcontextprotocol/ext-apps (AppBridge + PostMessage transport, sandbox proxy, per-thread request queue, ui/message / ui/open-link / tools/call proxy, tool input/result forwarding, ui/request-display-mode). The React / Vue / Angular renderers consume it as thin adapters: they create the sandbox iframe and wire reactive state, while all protocol logic lives in bindMcpApp.

Entry points

ImportContentsBundle
@copilotkit/mcp-apps-rendererbindMcpApp + the full session APIESM only — it wraps the ESM-only ext-apps bridge, and is meant to be loaded lazily via a dynamic import().
@copilotkit/mcp-apps-renderer/activityMCPAppsActivityType, MCPAppsActivityContentSchema, ɵrunMcpFollowUpESM + CJS. Bridge-free: importing it to register the activity does not pull the ext-apps bundle.

The root is ESM-only on purpose: @modelcontextprotocol/ext-apps ships ESM only, so a CommonJS root would emit a require() of an ES module and fail with ERR_REQUIRE_ESM. Consume bindMcpApp via a dynamic import() (which resolves ESM from any module system), and import the bridge-free /activity surface for synchronous activity registration.

Script-tag / UMD usage

This package also ships a UMD build of the bridge-free /activity entry: dist/activity.umd.js, which defines the global CopilotKitMcpAppsRendererActivity.

@copilotkit/react-core's UMD build references that global (it externalizes @copilotkit/mcp-apps-renderer/activity to register the built-in MCP Apps activity). Script-tag consumers of react-core's UMD must therefore load activity.umd.js before @copilotkit/react-core's UMD bundle, alongside the other UMD globals it depends on (React, CopilotKitCore, CopilotKitA2UIRenderer, …):

<!-- ...React, @copilotkit/core, @copilotkit/a2ui-renderer, etc. first... -->
<script src="https://unpkg.com/@copilotkit/mcp-apps-renderer/dist/activity.umd.js"></script>
<script src="https://unpkg.com/@copilotkit/react-core/dist/index.umd.js"></script>

Only the bridge-free /activity surface has a UMD build; the ext-apps bridge itself (bindMcpApp) is loaded lazily via import() and is not part of the UMD graph, so it only loads when an MCP App is actually rendered.

版本与发布记录

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

版本发布日期距今
1.86.0latest2026/11/11今天
2.0.0-rc.40next2026/11/11今天
2.0.0-rc.392026/11/10今天
2.0.0-rc.382026/11/10今天
2.0.0-rc.372026/11/091 天前
2.0.0-rc.362026/11/064 天前

其他发布通道:canary → 1.84.2-canary.openbot-intel-fixes,next → 2.0.0-rc.40。

关于 @copilotkit/mcp-apps-renderer 的常见问题

@copilotkit/mcp-apps-renderer 是什么?

Framework-agnostic MCP Apps host for CopilotKit - the app<->host protocol (ext-apps AppBridge), sandbox proxy, and shared renderer consumed by the React, Vue, and Angular frontends

如何安装 @copilotkit/mcp-apps-renderer?

在项目目录运行 npm install @copilotkit/mcp-apps-renderer,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(>=3.25)、@ag-ui/client(>=0.0.59)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@copilotkit/mcp-apps-renderer 支持 TypeScript 吗?

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

@copilotkit/mcp-apps-renderer 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@copilotkit/mcp-apps-renderer 可以商用吗?

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

@copilotkit/mcp-apps-renderer 的下载量有多少?

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

@copilotkit/mcp-apps-renderer 还在维护吗?

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