Aller au contenu
Skillpedia
Connecteurs (MCP)46k · #6340

build-mcp-app

Ce qu’il fait

Il guide votre agent pour ajouter des composants d'interface interactifs à un serveur MCP, afin que ses outils puissent afficher des formulaires, des sélecteurs ou des tableaux de bord dans un chat. Il s'adresse aux développeurs de serveurs MCP qui veulent des résultats plus riches et interactifs.

Quand l’utiliser

  • ✓Quand vous voulez qu'un serveur MCP affiche un formulaire ou un sélecteur dans le chat.
  • ✓Quand vous voulez qu'un outil affiche un tableau de bord ou une boîte de confirmation directement dans le chat.
  • ✓Quand vous avez déjà un serveur MCP et voulez y ajouter des widgets interactifs.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcp-app/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Pouvez-vous ajouter un widget de formulaire à mon serveur MCP pour que les utilisateurs puissent saisir leurs informations dans le chat ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent s'appuie sur un serveur MCP standard et ajoute des ressources d'interface que l'hôte du chat affiche dans un cadre isolé. Les widgets utilisent la même couche d'outils et de protocole que le reste du serveur.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

Ai-je d'abord besoin d'un serveur MCP de base ?

Oui. La skill ajoute les widgets par-dessus un serveur MCP, et une autre skill de serveur couvre cette base.

Cela fonctionne-t-il en dehors de Claude ?

La skill indique que l'application peut fonctionner dans Claude et dans d'autres hôtes qui prennent en charge la surface apps.

Comment la tester ?

La skill suggère d'ajouter le serveur comme connecteur personnalisé dans claude.ai, en utilisant un tunnel pour le développement local.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
46k
Position au classement
#6340
Licence
Apache-2.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires