Langsung ke konten
Skillpedia
Konektor (MCP)46k Β· #6340

build-mcp-app

Fungsinya

Skill ini memandu agent Anda menambahkan komponen UI interaktif ke server MCP, sehingga alat-alatnya dapat menampilkan formulir, pemilih, atau dasbor di dalam chat. Skill ini ditujukan untuk developer yang membangun server MCP dan menginginkan hasil yang lebih kaya dan interaktif.

Kapan dipakai

  • βœ“Saat Anda ingin server MCP menampilkan formulir atau pemilih di dalam chat.
  • βœ“Saat Anda ingin sebuah alat menampilkan dasbor atau dialog konfirmasi secara sebaris.
  • βœ“Saat Anda sudah punya server MCP dan ingin menambahkan widget interaktif.

Link skill

https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcp-app/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcp-app/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda menambahkan widget formulir ke server MCP saya agar pengguna bisa mengisi detail langsung di dalam chat?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent membangun di atas server MCP standar dan menambahkan resource UI yang ditampilkan host chat dalam frame tersandbox. Widget memakai lapisan alat dan protokol yang sama dengan bagian server lainnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Build an MCP App (Interactive UI Widgets)

An MCP app is a standard MCP server that also serves UI resources β€” interactive components rendered inline in the chat surface. Build once, runs in Claude and ChatGPT and any other host that implements the apps surface.

The UI layer is additive. Under the hood it's still tools, resources, and the same wire protocol. If you haven't built a plain MCP server before, the build-mcp-server skill covers the base layer. This skill adds widgets on top.

Testing in Claude: Add the server as a custom connector in claude.ai (via a Cloudflare tunnel for local dev) β€” this exercises the real iframe sandbox and hostContext. See https://claude.com/docs/connectors/building/testing.

Claude host specifics

_meta.ui.* key Where Effect
resourceUri tool Which ui:// resource the host renders for this tool's results.
visibility: ["app"] tool Hide a widget-only helper tool (e.g. geometry/image fetcher called via callServerTool) from Claude's tool list.
prefersBorder: false resource Drop the host's outer card border (mobile).
csp.{connectDomains, resourceDomains, baseUriDomains} resource Declare external origins; default is block-all. frameDomains is currently restricted in Claude.
  • hostContext.safeAreaInsets: {top, right, bottom, left} (px) β€” honor these for notches and the composer overlay.
  • Directory submission requires OAuth or authless (none) β€” static bearer is private-deploy only and blocks listing β€” plus tool annotations and 3–5 PNG screenshots; see references/directory-checklist.md.

When a widget beats plain text

Don't add UI for its own sake β€” most tools are fine returning text or JSON. Add a widget when one of these is true:

Signal Widget type
Tool needs structured input Claude can't reliably infer Form
User must pick from a list Claude can't rank (files, contacts, records) Picker / table
Destructive or billable action needs explicit confirmation Confirm dialog
Output is spatial or visual (charts, maps, diffs, previews) Display widget
Long-running job the user wants to watch Progress / live status

If none apply, skip the widget. Text is faster to build and faster for the user.


Widgets vs Elicitation β€” route correctly

Before building a widget, check if elicitation covers it. Elicitation is spec-native, zero UI code, works in any compliant host.

Need Elicitation Widget
Confirm yes/no βœ… overkill
Pick from short enum βœ… overkill
Fill a flat form (name, email, date) βœ… overkill
Pick from a large/searchable list ❌ (no scroll/search) βœ…
Visual preview before choosing ❌ βœ…
Chart / map / diff view ❌ βœ…
Live-updating progress ❌ βœ…

If elicitation covers it, use it. See ../build-mcp-server/references/elicitation.md.


Architecture: two deployment shapes

Remote MCP app (most common)

Hosted streamable-HTTP server. Widget templates are served as resources; tool results reference them. The host fetches the resource, renders it in an iframe sandbox, and brokers messages between the widget and Claude.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  tools/call   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude  │─────────────> β”‚ MCP server β”‚
β”‚   host   β”‚<── result ────│  (remote)  β”‚
β”‚          β”‚  + widget ref β”‚            β”‚
β”‚          β”‚               β”‚            β”‚
β”‚          β”‚ resources/readβ”‚            β”‚
β”‚          │─────────────> β”‚  widget    β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β” β”‚<── template ──│  HTML/JS   β”‚
β”‚ β”‚iframeβ”‚ β”‚               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚widgetβ”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

MCPB-packaged MCP app (local + UI)

Same widget mechanism, but the server runs locally inside an MCPB bundle. Use this when the widget needs to drive a local application β€” e.g., a file picker that browses the actual local disk, a dialog that controls a desktop app.

For MCPB packaging mechanics, defer to the build-mcpb skill. Everything below applies to both shapes.


How widgets attach to tools

A widget-enabled tool has two separate registrations:

  1. The tool declares a UI resource via _meta.ui.resourceUri. Its handler returns plain text/JSON β€” NOT the HTML.
  2. The resource is registered separately and serves the HTML.

When Claude calls the tool, the host sees _meta.ui.resourceUri, fetches that resource, renders it in an iframe, and pipes the tool's return value into the iframe via

Pertanyaan umum

Apakah saya perlu server MCP dasar dulu?

Ya. Skill ini menambahkan widget di atas server MCP, dan skill server terpisah membahas lapisan dasarnya.

Apakah bisa dipakai di luar Claude?

Skill ini menyebutkan aplikasi dapat berjalan di Claude dan host lain yang mendukung permukaan apps.

Bagaimana cara mengujinya?

Skill ini menyarankan menambahkan server sebagai connector kustom di claude.ai, dengan tunnel untuk pengembangan lokal.

Detail

Deskripsi asli dari pembuat

This skill should be used when the user wants to build an "MCP app", add "interactive UI" or "widgets" to an MCP server, "render components in chat", build "MCP UI resources", make a tool that shows a "form", "picker", "dashboard" or "confirmation dialog" inline in the conversation, or mentions "apps SDK" in the context of MCP. Use AFTER the build-mcp-server skill has settled the deployment model, or when the user already knows they want UI widgets.

repo: anthropics/claude-plugins-official

Popularitas

Bintang GitHub
46k
Peringkat
#6340
Lisensi
Apache-2.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa