Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计提醒

build-mcp-use-apps-widgets构建 MCP USE apps widgets

Agent Skill

build-mcp-use-apps-widgets 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

349

周安装

14

GitHub Stars

5

下载量

113
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:build-mcp-use-apps-widgets(构建 MCP USE apps widgets)
来源仓库:https://github.com/yigitkonur/skills-by-yigitkonur
仓库路径:skills/build-mcp-use-apps-widgets
安装命令:
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill build-mcp-use-apps-widgets
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill build-mcp-use-apps-widgets

简介

用于构建或修复返回 React 组件的 mcp-use 应用,适用于 ChatGPT Plus 及 Claude、Goose 等平台。

  • 适合创建新 widget 应用、添加组件到现有服务,或修复 useWidget、widgetMetadata 等关键行为。
  • 通过 npx skills add 命令从 GitHub 安装,建议结合仓库 README 查看具体用例和边界条件。
  • 注意权限范围和维护状态,避免触发不必要的联网、命令执行或文件读写操作。
  • build-mcp-use-apps-widgets 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Build MCP Apps & Widgets

Build or repair mcp-use apps that return React widgets from resources/ and run in ChatGPT plus MCP Apps hosts such as Claude and Goose.

Not building UI? Use build-mcp-use-server. Building a client that connects to MCP servers? Use build-mcp-use-client.

Trigger boundary

Use this skill when the task is about:

  • creating a new mcp-use widget app from scratch
  • adding widgets to an existing mcp-use server
  • fixing useWidget, useCallTool, widget(), widgetMetadata, CSP, theme, streaming, or display-mode behavior
  • shipping the same widget flow to ChatGPT and MCP Apps-compatible clients

Do not use this skill when:

  • the task is a plain MCP server with no widgets
  • the task is an MCP client app that connects to existing servers
  • the user only needs a raw non-widget transport or SDK explanation

Operating defaults

  • Node 18+ is supported. Prefer Node 22 LTS when you want the closest match to current examples.
  • Install zod explicitly alongside mcp-use.
  • mcp-use is HTTP-first here: server.listen() serves /mcp; this workflow does not assume stdio transport.
  • Default layout: root index.ts, resources/<widget-name>/widget.tsx, shared code in src/lib/.
  • Keep .mcp-use/**/* in tsconfig.json so generated tool types are available to widget code.

Workflow

1. Detect the starting point

  • Inspect the current working tree first.
  • Look for an existing widget app: mcp-use dependency, resources/ folders with widget.tsx, widgetMetadata exports, mcp-use/react imports, and tools with widget: {name:...}.
  • Branch early:

- Existing app present: audit and fix it in place. - No widget app present: gather only the missing product decisions, then scaffold the smallest working slice.

2. If an app already exists, audit it across four passes

  • Cover these areas even if you do the work sequentially:

- Server bindings and schemas: tool definitions, widget() responses, output/message, Zod descriptions, baseUrl, middleware, auth. - Widget lifecycle and host integration: useWidget, isPending, isStreaming, theming, McpUseProvider, Image, widgetMetadata. - Widget-to-tool flows: useCallTool, callTool, persistent state, follow-up messages, display modes, subscriptions or notifications if present. - Deployment and verification: Inspector flow, CSP, transport, production config, common failure cases.

  • If the runtime supports safe parallel delegation, you can split those passes. If it does not, do them one by one. Do not depend on delegation.
  • Prioritize fixes in this order:

- broken install or build - widget does not render or crashes on pending state - tool and widget folder are mis-bound - widget has no useful text fallback for non-widget clients - CSP, baseUrl, or host-specific compatibility gaps - deployment and hardening gaps

  • Apply fixes directly. Do not stop at a review list unless the user explicitly asked for review-only output.

3. If no widget app exists, build the smallest working baseline first

  • Ask only the questions needed to define one working vertical slice. Stop once these are clear:

- what the first widget shows - whether the widget must call another tool from inside the UI - whether external APIs, auth, or deployment constraints are already required

  • For a greenfield app, prefer the scaffolded path:

- npx create-mcp-use-app <name> --template mcp-apps --no-skills

  • Run the first build gate immediately after scaffolding:

- npm install - npm run build - npx mcp-use generate-types

  • Do not add product features on top of a failing template.
  • If the generated demo widget or demo tool blocks the build on current dependencies, replace or remove that demo before adding custom logic.

4. Use the minimal architecture that proves the flow

  • Start with one widget-bound tool and one plain follow-up tool callable from the widget.
  • Put shared business logic and validation in src/lib/.
  • From a root index.ts entrypoint, import files under src/ with Node ESM relative .js paths such as ./src/lib/math.js.
  • Keep widgets in resources/<widget-name>/widget.tsx; the folder name must match tool.widget.name.
  • Use minimal-interactive-widget.md when the user needs the smallest calculator/form-style pattern that edits local state and calls a non-widget tool from the UI.
  • Only add extra widgets, auth, subscriptions, or deployment-specific complexity after the baseline flow works.

5. Verify before stopping

  • Run npm run build.
  • Run npx mcp-use generate-types.
  • Run npx mcp-use dev.
  • Open the Inspector at http://localhost:3000/inspector and exercise at least one widget-bound tool.
  • If a host-specific feature could not be verified in the current environment, say exactly what was not tested.

Critical rules

  1. tool.widget.name must match resources/<name>/widget.tsx exactly.
  2. Always give the LLM and text-only clients a useful message or output; props alone is not enough.
  3. Always guard widget rendering with isPending before you trust props.
  4. Treat streaming preview as optional. ChatGPT does not expose partialToolInput, so the widget must still work with only isPending.
  5. Use useCallTool() or useWidget().callTool() for widget-to-tool calls. Do not use raw fetch() against MCP endpoints.
  6. Wrap the widget root in McpUseProvider. If the widget uses React Router, add BrowserRouter manually inside that provider.
  7. Declare every external domain in widgetMetadata.metadata.csp. Missing domains fail silently in hosted widget iframes.
  8. Set baseUrl or MCP_URL for deployed builds so widget assets and CSP resolve correctly.
  9. Use Image for files from public/ instead of raw <img>.
  10. Keep secrets, tokens, and other sensitive data out of widget props and widget state.
  11. Prefer type: "mcpApps" for dual-protocol compatibility; do not start new work with type: "appsSdk".
  12. Keep shared code browser-safe if you import it into widget bundles; otherwise keep it server-only in src/lib/.

Reference routing

Load the smallest relevant set for the branch you are in.

Start here

SituationRead
Fastest greenfield path, scaffold verification, or first-run build gatereferences/guides/quick-start.md, references/examples/project-templates.md, references/examples/minimal-interactive-widget.md
Need a larger end-to-end server or widget example after the baseline worksreferences/examples/server-recipes.md, references/examples/widget-recipes.md

Server and build surface

SituationRead
Tool definitions, Zod schemas, annotations, widget configreferences/guides/tools-and-schemas.md
widget(), text(), object(), mix(), MIME behaviorreferences/guides/response-helpers.md
Server config, baseUrl, CORS, middleware, env varsreferences/guides/server-configuration.md
Resources, prompts, or uiResource() decisionsreferences/guides/resources-and-prompts.md
Session stores or stream managersreferences/guides/session-management.md
OAuth or ctx.authreferences/guides/authentication.md
HTTP vs serverless transport, proxying, /mcp behaviorreferences/guides/transports.md
CLI commands, generate-types, dev, build, deployreferences/guides/cli-reference.md
Capability checks, proxy patterns, advanced server featuresreferences/guides/advanced-features.md

Widget surface

SituationRead
Core widget lifecycle, host context, useWidget, useCallToolreferences/guides/widgets-and-ui.md
McpUseProvider, Image, ErrorBoundary, WidgetMetadatareferences/guides/widget-components.md
Streaming preview, partialToolInput, three-phase renderingreferences/guides/streaming-and-preview.md
ChatGPT compatibility, metadata mapping, migration from appsSdkreferences/guides/chatgpt-apps-flow.md

Interaction and orchestration

SituationRead
ctx.elicit() or ctx.sample() inside toolsreferences/guides/elicitation-and-sampling.md
Notifications, progress, resource subscriptions, rootsreferences/guides/notifications-and-subscriptions.md
Multi-widget composition, follow-up patterns, widget state patternsreferences/patterns/mcp-apps-patterns.md

Testing, deployment, and failure recovery

SituationRead
Inspector workflow, curl checks, widget debuggingreferences/guides/testing-and-debugging.md
Deployment targets and production environment choicesreferences/patterns/deployment.md
Production reliability, caching, rate limiting, distributed Redis patternsreferences/patterns/production-patterns.md
Common implementation mistakes to avoidreferences/patterns/anti-patterns.md
Exact error messages and concrete fixesreferences/troubleshooting/common-errors.md

Guardrails

  • Do not assume delegation or subagents exist.
  • Do not keep a broken scaffold and pile custom code on top of it.
  • Do not return a widget response with no meaningful text fallback.
  • Do not access window.openai directly; use the mcp-use/react hooks.
  • Do not skip npm run build and npx mcp-use generate-types.
  • Do not use fetch() from the widget to talk to your own MCP server when a tool call is the right abstraction.
  • Do not store secrets or privileged backend-only data in widget state.
  • Do not default to server.uiResource() when resources/<name>/widget.tsx plus a custom tool gives a cleaner result.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.69%
按下载量换算41

Claude

31.26%
按下载量换算35

Cursor

20.26%
按下载量换算23

Gemini CLI

9.59%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills