assimilate-popular-wor…
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research…
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.
$ npx -y skills add a5c-ai/babysitter --skill mcp-tool-resource-pattern --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mcp-tool-resource-patternContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: mcp-tool-resource-pattern description: 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. allowed-tools: Read, Write, Edit, Bash, Glob, Grep graph: domains: [domain:software-engineering] specializations: [specialization:ai-agents-conversational] skillAreas: [skill-area:mcp-tool-design, skill-area:mcp-resource-design] roles: [role:backend-engineer, role:fullstack-engineer] workflows: [workflow:feature-development] topics: [topic:api-design, topic:design-patterns]
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.
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.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import {
registerAppTool,
registerAppResource,
RESOURCE_MIME_TYPE,
} from '@modelcontextprotocol/ext-apps';
import { z } from 'zod';
import fs from 'fs';
import path from 'path';
const server = new McpServer({ name: 'my-app', version: '1.0.0' });
// Read the bundled HTML (built by vite-plugin-singlefile)
const bundledHtml = fs.readFileSync(
path.join(__dirname, '../dist/mcp-app.html'),
'utf-8'
);
// 1. Register the Resource (serves the UI)
registerAppResource(server, {
uri: 'app:///my-app',
name: 'My App UI',
mimeType: RESOURCE_MIME_TYPE,
async read() {
return {
contents: [{
uri: 'app:///my-app',
mimeType: RESOURCE_MIME_TYPE,
text: bundledHtml,
// CSP domains (if needed)
// resourceDomains: ['https://cdn.example.com'],
// connectDomains: ['https://api.example.com'],
}],
};
},
});
// 2. Register the Tool (returns data, references the resource)
registerAppTool(server, {
name: 'show_dashboard',
description: 'Show an interactive dashboard',
inputSchema: {
type: 'object' as const,
properties: {
query: { type: 'string', description: 'Search query' },
},
required: ['query'],
},
// _meta.ui.resourceUri is set automatically by registerAppTool
resourceUri: 'app:///my-app',
async handler(args) {
const data = await fetchDashboardData(args.query);
return {
// Text fallback for non-UI hosts (REQUIRED)
content: [
{
type: 'text' as const,
text: `Dashboard results for "${args.query}":\n${formatAsText(data)}`,
},
],
// Rich data for the UI (available in ontoolresult handler)
structuredContent: {
query: args.query,
results: data.results,
metadata: data.metadata,
},
};
},
});// This tool is ONLY callable from the UI iframe via app.callServerTool()
// The LLM/host cannot call it directly
registerAppTool(server, {
name: 'load_page',
description: 'Load a specific page of results',
visibility: ['app'], // App-only: not visible to LLM
inputSchema: {
type: 'object' as const,
properties: {
page: { type: 'number' },
pageSize: { type: 'number' },
},
required: ['page'],
},
resourceUri: 'app:///my-app',
async handler(args) {
const data = await fetchPage(args.page, args.pageSize || 20);
return {
content: [{ type: 'text' as const, text: JSON.stringify(data) }],
structuredContent: data,
};
},
});import { App, PostMessageTransport } from '@modelcontextprotocol/ext-apps';
const app = new App({ transport: new PostMessageTransport() });
// Call an app-only tool from the UI
async function loadNextPage(page: number) {
const result = await app.callServerTool('load_page', {
page,
pageSize: 20,
});
renderResults(result.structuredContent);
}// Both tools reference the same resource URI
// The UI handles both by checking which tool triggered
registerAppTool(server, {
name: 'search_products',
description: 'Search for products',
resourceUri: 'app:///product-viewer',
// ...
});
registerAppTool(server, {
name: 'show_product_details',
description: 'Show details for a specific product',
resourceUri: 'app:///product-viewer', // Same resource
// ...
});
// In the UI, distinguish via ontoolinput handlEnforce obedience on agentic workforces. Manage extremely complex workflows through deterministic, hallucination-free self-orchestration.
Repo: a5c-ai/babysitter
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research…
This skill should be used when the user asks to "babysit issues", "work on assigned issues", "check a5c-agent issues", "process babysitter issues", or wants to…
Discover public GitHub repositories that import defineTask from @a5c-ai/babysitter-sdk and maintain a deduplicated catalog of those repositories in…
This skill should be used when the user asks to "fix pipelines", "fix CI", "check staging pipelines", "fix failing workflows", "fix failing actions", or wants…
Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to…
For a repository in the babysitter-users catalog, locate its babysitter processes and any committed runs (.a5c/runs/<runId>/) and perform a retrospective on a…