Agent skill · Frontend

mcp-tool-resource-pattern

Implements the core MCP Apps architectural pattern where a Tool declares _meta.ui.resourceUri referencing a registered Resource. Covers registerAppTool, registerAppResource, text fallback, structuredContent, and app-only helper tools.

a5c-aigithub.com/a5c-aiGitHub ↗
claude-codecodexcan modify filesMIT
Install
npx skills add a5c-ai/babysitter --skill mcp-tool-resource-pattern --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 10 KB
Bundled scripts: none
Allowed tools: ReadWriteEditBashGlobGrep
Path: library/specializations/ai-agents-conversational/skills/mcp-tool-resource-pattern/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 1,642
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# mcp-tool-resource-pattern Implement the foundational Tool + Resource pattern that every MCP App requires: a Tool that returns data and references a Resource that serves the interactive UI. ## Overview Every MCP App is built on the Tool + Resource pattern: 1. **Tool** (registered via `registerAppTool`): Called by the LLM/host, returns data. Its `_meta.ui.resourceUri` tells the host which Resource provides the UI. 2. **Resource** (registered via `registerAppResource`): Serves a bundled HTML file that renders the interactive UI in a sandboxed iframe. 3. The tool passes data to the UI via `structuredContent` (available in `ontoolresult` handler). 4. The tool MUST also return a `content` array with text fallback for non-UI hosts. ## Capabilities ### registerAppTool Implementation - Register tools with `_meta.ui.resourceUri` linking to a resource - Pass data via `structuredContent` for rich UI rendering - Always include `content` array with text fallback - Configure tool input schemas via Zod ### registerAppResource Implementation - Register HTML resources with `RESOURCE_MIME_TYPE` - Serve single-file bundled HTML - Configure CSP domains in `contents[]` return - Support multiple tools

What's inside
Steps it walks through
  1. Overview
  2. Capabilities
  3. registerAppTool Implementation
  4. registerAppResource Implementation
  5. App-Only Helper Tools
  6. Graceful Degradation
  7. Usage
  8. Basic Tool + Resource Pattern
  9. Client-Side: Calling App-Only Tools
  10. Multiple Tools Sharing One Resource
  11. Critical Rules
  12. Verification Checklist
  13. Task Definition
  14. Applicable Processes
Ships with 1 file
  • README.md
More from babysitter
All skills →
About this skill
What does the mcp-tool-resource-pattern skill do?

Implements the core MCP Apps architectural pattern where a Tool declares _meta.ui.resourceUri referencing a registered Resource. Covers registerAppTool, registerAppResource, text fallback, structuredContent, and app-only helper tools.

How do I install it?

Run `npx skills add a5c-ai/babysitter --skill mcp-tool-resource-pattern --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From a5c-ai/babysitter, a repository with 1,642 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going