360 Secure SkillHub
360 安全技能中心

Mcp App Builder

核心功能是按规范完成带React可视化UI的MCP App全流程开发,涵盖需求梳理、项目脚手架搭建、服务端与UI实现、构建测试,严格遵循依赖版本与代码规范。典型场景:为ChatGPT/Claude开发带可视化工具的MCP服务器,或迁移标准MCP服务器到带Vite单文件UI的MCP App。输入为开发需求,输出可运行的MCP App项目及构建产物。

hollaugo
hollaugo
热度 76.03
最近更新 2026-05-11 17:27:36
分类:开发依赖:代码执行 / 读写文件 / MCP 服务应用场景:代码生成 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add mcp-app-builder
Metadata
name
mcp-app-builder
description
Build new MCP Apps (MCP servers with React UI output) using @modelcontextprotocol/ext-apps and the MCP SDK. Use when asked to scaffold or implement MCP App servers, add UI-rendering tools/resources, or migrate a standard MCP server to an MCP App with Vite single-file UI bundles.

MCP App Builder

Overview

Create MCP Apps that expose tools with visual React UIs for ChatGPT or Claude. Follow the exact dependency versions and server/UI patterns in references/mcp-app-spec.md.

Workflow

  1. Clarify requirements: what data to visualize, UI pattern (card, table, chart, dashboard, form), data source, and how many tools (start with 1-2).
  2. Design tools and UI mapping: define tool names, zod input schemas, output shape, and UI resource URIs (ui://.../app.html). Map each tool to one React entrypoint and one HTML file.
  3. Scaffold the project: start from assets/mcp-app-template/ when possible, then customize tool names, schemas, and UI. Ensure package.json uses the exact versions, plus tsconfig.json, vite.config.ts, Tailwind + PostCSS, and per-tool build scripts.
  4. Implement the server: use registerAppTool/registerAppResource, zod schemas directly, createServer() factory per request, and createMcpExpressApp with app.all("/mcp", ...).
  5. Implement the UI: use useApp + useHostStyles, parse tool results, handle loading/error/empty states, and apply safe-area insets.
  6. Build and test: run npm run build, then npm run serve, then verify via a tunnel if needed.

Hard Requirements

  • Use the exact dependency versions listed in references/mcp-app-spec.md.
  • Use registerAppTool/registerAppResource and zod schemas directly (not JSON Schema objects).
  • Create a new McpServer instance per request via createServer().
  • Use createMcpExpressApp and app.all("/mcp", ...).
  • Bundle UI into single-file HTML via vite-plugin-singlefile.
  • Use host CSS variables for theme compatibility.

References

  • references/mcp-app-spec.md (authoritative spec, patterns, code templates, gotchas)

Assets

  • assets/mcp-app-template/ (ready-to-copy MCP App skeleton with one tool + UI)