Agent skill

Add App Tool

by cyanheads in cyanheads/pubmed-mcp-server

Scaffold an MCP App tool + UI resource pair. An agent skill from cyanheads/pubmed-mcp-server.

Apache-2.0Auto-check passedAgent Workflows

Install Add App Tool

skills CLI
$ npx skills add cyanheads/pubmed-mcp-server --skill add-app-tool -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cyanheads/pubmed-mcp-server add-app-tool --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cyanheads/pubmed-mcp-server.git skills-src && mkdir -p .claude/skills && cp -r skills-src/framework-skills/add-app-tool .claude/skills/add-app-tool && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-app-tool
GitHub stars
156
Token cost
~3.2k tokens
SKILL.md length
999 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
Apache-2.0

At a glance

Scaffold an MCP App tool + UI resource pair. An agent skill from cyanheads/pubmed-mcp-server.

  • Works in 3 steps: A human will actively interact with the… → The target deployment runs in a client… → The interaction the UI enables —…
  • The user asks to add a tool with interactive UI
  • SKILL.md covers When to Use, Context, Steps and App Tool Template, plus 4 more sections
  • Calls bun; reaches unpkg.com

What it does

Add App Tool is an agent skill from cyanheads/pubmed-mcp-server. Scaffold an MCP App tool + UI resource pair. Use when the user asks to add a tool with interactive UI, create an MCP App, or build a visual/interactive tool.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers. It works with Model Context Protocol. The repository describes itself as: Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms via MCP. STDIO or Streamable HTTP. The licence is Apache-2.0.

When your agent uses it

  • The user asks to add a tool with interactive UI
  • Create an MCP App
  • Build a visual/interactive tool

Example prompts

  • “/add-app-tool”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. A human will actively interact with the result in real time — not just an LLM consuming text.
  2. The target deployment runs in a client that supports MCP Apps. Many clients (Claude Code, Cursor, most chat UIs) are tool-only and will…
  3. The interaction the UI enables — scrubbing a dense table, approving a multi-step plan, filling a structured form — is core to the…

What it can do on your machine

Read from SKILL.md and the folder at commit 5a417fb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • unpkg.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add App Tool loads about 3.2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 999 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cyanheads/pubmed-mcp-server at commit 5a417fb, republished under its Apache-2.0 licence (© cyanheads). 999 words, ~3,165 tokens.

Download SKILL.mdSave it as .claude/skills/add-app-tool/SKILL.md (or your agent's skills folder).
name
add-app-tool
description
Scaffold an MCP App tool + UI resource pair. Use when the user asks to add a tool with interactive UI, create an MCP App, or build a visual/interactive tool.
metadata.author
cyanheads
metadata.version
1.8
metadata.audience
external
metadata.type
reference

When to Use

App tools are rarely the right choice. Reach for one only when all of the following hold:

  1. A human will actively interact with the result in real time — not just an LLM consuming text.
  2. The target deployment runs in a client that supports MCP Apps. Many clients (Claude Code, Cursor, most chat UIs) are tool-only and will only ever see the format() text fallback you have to maintain anyway.
  3. The interaction the UI enables — scrubbing a dense table, approving a multi-step plan, filling a structured form — is core to the workflow, not nice-to-have rendering.

App tools cost more than standard tools: an iframe + CSP setup, app.ontoolresult / callServerTool plumbing, host-context wiring (theme, fonts, styles), and a format() text path that has to be content-complete because most clients see only that. Two surfaces to keep in sync, two failure modes per change.

Default to add-tool. This skill is the how-to once that bar is cleared — the "whether to" decision belongs in design-mcp-server.

Context

MCP Apps extend the standard tool pattern with an interactive HTML UI rendered in a sandboxed iframe by the host. Each MCP App consists of two definitions:

  1. App tool (.app-tool.ts) — uses appTool() builder, declares resourceUri pointing to the UI resource
  2. App resource (.app-resource.ts) — uses appResource() builder, serves the bundled HTML

Both builders are exported from @cyanheads/mcp-ts-core. They handle _meta.ui.resourceUri, the compat key (ui/resourceUri), and the correct MIME type (text/html;profile=mcp-app) automatically.

For the full API, Context interface, and error codes, read the framework's CLAUDE.md/AGENTS.md (loaded at session start).

Steps

  1. Confirm the three conditions in "When to Use" apply — if any is uncertain, default to add-tool instead. Then gather the tool's name, purpose, input/output shape, and what the UI should display from the user's request — ask only if genuinely absent
  2. Choose a URI — convention: ui://{{tool-name}}/app.html
  3. Create the app tool at src/mcp-server/tools/definitions/{{tool-name}}.app-tool.ts
  4. Create the app resource at src/mcp-server/resources/definitions/{{tool-name}}-ui.app-resource.ts
  5. Register both in the project's existing createApp() arrays (directly in src/index.ts for fresh scaffolds, or via barrels if the repo already has them)
  6. Run bun run devcheck — the linter validates _meta.ui and cross-checks tool/resource pairing
  7. Smoke-test with bun run rebuild && bun run start:stdio < /dev/null (or start:http) — the Core services constructed log record must list the tool in its tools field and its UI resource in resources (the message text shows only counts)

App Tool Template

typescript
/**
 * @fileoverview {{TOOL_DESCRIPTION}}
 * @module mcp-server/tools/definitions/{{TOOL_NAME}}.app-tool
 */

import { appTool, z } from '@cyanheads/mcp-ts-core';

const UI_RESOURCE_URI = 'ui://{{tool-name}}/app.html';

export const {{TOOL_EXPORT}} = appTool('{{tool_name}}', {
  resourceUri: UI_RESOURCE_URI,
  title: '{{TOOL_TITLE}}',
  description: '{{TOOL_DESCRIPTION}}',
  annotations: { readOnlyHint: true },
  input: z.object({
    // All fields need .describe(). Only JSON-Schema-serializable Zod types allowed.
  }),
  output: z.object({
    // All fields need .describe(). Only JSON-Schema-serializable Zod types allowed.
  }),
  // auth: ['tool:{{tool_name}}:read'],

  async handler(input, ctx) {
    ctx.log.info('Processing', { /* relevant input fields */ });
    return { /* output */ };
  },

  // format() serves dual purpose for app tools:
  // 1. First text block: JSON for the UI (app.ontoolresult parses it)
  // 2. Subsequent blocks: human-readable, content-complete fallback for non-app hosts and LLM context
  format(result) {
    return [
      { type: 'text', text: JSON.stringify(result) },
      { type: 'text', text: '/* human-readable summary with all LLM-needed fields */' },
    ];
  },
});

App Resource Template

typescript
/**
 * @fileoverview UI resource for {{TOOL_NAME}}.
 * @module mcp-server/resources/definitions/{{TOOL_NAME}}-ui.app-resource
 */

import { appResource, z } from '@cyanheads/mcp-ts-core';

const ParamsSchema = z.object({}).describe('No parameters. Returns the static HTML app.');

const APP_HTML = `<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>{{TOOL_TITLE}}</title>
  <style>/* your styles */</style>
</head>
<body>
  <!-- your UI markup -->

  <script type="module">
    // PROTOTYPING ONLY — replace before shipping. Bundle via Vite +
    // vite-plugin-singlefile or inline the SDK. Live CDN imports require
    // CSP whitelisting, add supply-chain risk, and break offline use.
    // See UI Notes below.
    import {
      App,
      applyDocumentTheme,
      applyHostFonts,
      applyHostStyleVariables,
    } from "https://unpkg.com/@modelcontextprotocol/ext-apps@2/app-with-deps";

    const app = new App({ name: "{{TOOL_TITLE}}", version: "1.0.0" });

    function applyHostContext(hostContext) {
      if (hostContext?.theme) {
        applyDocumentTheme(hostContext.theme);
      }
      if (hostContext?.styles?.variables) {
        applyHostStyleVariables(hostContext.styles.variables);
      }
      if (hostContext?.styles?.css?.fonts) {
        applyHostFonts(hostContext.styles.css.fonts);
      }
    }

    // Receive initial tool result from the host
    app.ontoolresult = (result) => {
      const text = result.content?.find(c => c.type === "text")?.text;
      if (!text) return;
      const data = JSON.parse(text);
      // render data into the DOM
    };
    app.onhostcontextchanged = applyHostContext;

    // Proactively call tools from the UI
    document.getElementById("action-btn").addEventListener("click", async () => {
      const result = await app.callServerTool({
        name: "{{tool_name}}",
        arguments: { /* input */ },
      });
      // handle result
    });

    app.connect().then(() => {
      const hostContext = app.getHostContext();
      if (hostContext) applyHostContext(hostContext);
    });
  </script>
</body>
</html>`;

export const {{RESOURCE_EXPORT}} = appResource('ui://{{tool-name}}/app.html', {
  name: '{{tool-name}}-ui',
  title: '{{TOOL_TITLE}} UI',
  description: 'Interactive HTML app for {{tool_name}}.',
  params: ParamsSchema,
  // auth: ['resource:{{tool-name}}-ui:read'],
  _meta: {
    ui: {
      csp: { resourceDomains: ['https://unpkg.com'] },
    },
  },

  handler(_params, ctx) {
    ctx.log.debug('Serving app UI.', { resourceUri: ctx.uri?.href });
    return APP_HTML;
  },
});

No list callback: ui://{{tool-name}}/app.html has no template variables, so it registers as a fixed resource that resources/list already reports. Registration ignores list on a variable-free URI.

UI Notes

  • Ship self-contained HTML. Author with Vite + vite-plugin-singlefile or inline the SDK. Live CDN imports in a ui:// resource are a CSP footgun (every domain has to be whitelisted on _meta.ui.csp.resourceDomains), a supply-chain footgun (third-party JS executes inside the host's iframe), and a runtime footgun (every render needs network). The unpkg line in the template is for prototyping only.

  • CSP. MCP Apps iframes run under deny-by-default CSP. With appResource(), put _meta.ui.csp.resourceDomains on the definition; the builder mirrors it into returned resources/read content items. With plain resource(), attach _meta.ui yourself in format().

  • Adopt the host's visual identity, don't impose your own. App UIs render inside the host's iframe alongside its native UI. Three host hooks layer on top of your CSS:

    • applyDocumentTheme(hostContext.theme) — sets color-scheme and a data-theme attribute on <html>
    • applyHostStyleVariables(hostContext.styles.variables) — installs host CSS custom properties on :root. The MCP Apps spec fixes the names (McpUiStyleVariableKey): --color-background-primary, --color-text-primary, --color-border-primary, --font-sans, --border-radius-md, and so on. A host may send any subset.
    • applyHostFonts(hostContext.styles.css.fonts) — installs @font-face rules for the host's font stack

    Author CSS to consume these via var(--color-background-primary, var(--bg)) — the host variable first, a local token as the fallback. Don't hardcode brand colors that fight the host.

  • Pre-connect baseline. app.connect() is async — host context arrives a frame or two after first paint. Without a baseline, the UI flashes unstyled or wrong-themed on light hosts. Ship local tokens with a light default, a prefers-color-scheme dark override, and a data-theme pin so the first frame is sensible:

    css
    :root { color-scheme: light dark; --bg: #fff; --fg: #111; }
    @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0c0d12; --fg: #ededef; } }
    :root[data-theme="dark"] { --bg: #0c0d12; --fg: #ededef; }
    body { background: var(--color-background-primary, var(--bg)); color: var(--color-text-primary, var(--fg)); }

    Once host context is applied, the host's variables win; the local tokens cover the gap before it arrives and any variable the host omits.

  • format() for app tools. The first text content block is typically JSON that the UI parses via ontoolresult. Additional blocks are the human-readable fallback that non-app hosts and LLMs consume — they must render every field the LLM needs to reason about. JSON-only payloads leave model-visible context blind.

  • App resource format(). appResource() already preserves raw HTML for the default app MIME type and mirrors definition _meta.ui into content items. Add a custom format() only when you need extra per-read metadata or non-default content shaping.

Show full SKILL.md (224 more words)Show less

Registration

typescript
// src/index.ts (fresh scaffold default)
import { createApp } from '@cyanheads/mcp-ts-core';
import { {{TOOL_EXPORT}} } from './mcp-server/tools/definitions/{{tool-name}}.app-tool.js';
import { {{RESOURCE_EXPORT}} } from './mcp-server/resources/definitions/{{tool-name}}-ui.app-resource.js';

await createApp({
  tools: [{{TOOL_EXPORT}}],
  resources: [{{RESOURCE_EXPORT}}],
  prompts: [/* existing prompts */],
});

If the repo already uses definitions/index.ts barrels, update those instead of changing the registration pattern.

Checklist

  • App tool created at src/mcp-server/tools/definitions/{{tool-name}}.app-tool.ts using appTool()
  • App resource created at src/mcp-server/resources/definitions/{{tool-name}}-ui.app-resource.ts using appResource()
  • resourceUri matches between tool and resource (ui://{{tool-name}}/app.html)
  • Zod schemas: all fields have .describe(), only JSON-Schema-serializable types
  • format() first block is JSON.stringify(result) — the full output object for the UI to parse via app.ontoolresult. Subsequent blocks are human-readable, content-complete fallback for non-app hosts and LLMs
  • App resource _meta.ui.csp.resourceDomains lists every external domain loaded by the UI
  • UI bundles or inlines the client SDK for the shipped HTML, and handles app.ontoolresult
  • UI applies host context updates via app.onhostcontextchanged
  • UI CSS reads host variables with local fallbacks (var(--color-background-primary, var(--bg))) over a light/dark baseline
  • No list callback on the fixed ui://…/app.html resource — resources/list already reports it
  • Both registered in the project's existing createApp() arrays (directly or via barrels)
  • Handler tested directly via createMockContext(), or add-test skill run to scaffold the test file
  • bun run devcheck passes (linter validates _meta.ui and tool/resource pairing)
  • Smoke-tested with bun run rebuild && bun run start:stdio < /dev/null (or start:http); the Core services constructed record lists the tool in tools and its UI resource in resources
  • View rendered in the headless MCP Apps host (mcp-ts-core app-render; field-test skill, Step 6): initialized is true, errors and cspViolations are empty, and the screenshot shows the tool result

© cyanheads, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in framework-skills/add-app-tool of cyanheads/pubmed-mcp-server.

Open the folder on GitHubat commit 5a417fb

Compare with similar skills

Add App Tool next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add App Tool compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add App Tool this skillcyanheads/pubmed-mcp-server156—~3.2kAutomated safety check: PassApache-2.0
Setting Up Papergraphlotchuazzz-crypto/papergraph-mcp285—~3.3kAutomated safety check: PassMIT
Just PRs MCPClawBio/ClawBio1.2k—~3.5kAutomated safety check: PassMIT
Patsnap Current Awarenesspatsnap/mcp113—~671Automated safety check: PassApache-2.0
Patsnap Scientific Translational Evidencepatsnap/mcp113—~728Automated safety check: PassApache-2.0
Peer Review Loophashgraph-online/awesome-codex-plugins1.3k—~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • Setting Up Papergraph

    lotchuazzz-crypto/papergraph-mcp

    A skill your agent uses when a user has cloned PaperGraph MCP and asks to install, initialize, configure, set up, or start using it with an agent or MCP client.

    285 GitHub stars~3.3k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Just PRs MCP

    ClawBio/ClawBio

    Compute evidence-aware polygenic risk scores from a local VCF or WGS file through the validated just-prs engine and a pinned local just-prs MCP server.

    1.2k GitHub stars~3.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Patsnap Current Awareness MCP for AI agents. An agent skill from patsnap/mcp.

    113 GitHub stars~671 tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Peer Review Loop

    hashgraph-online/awesome-codex-plugins

    Peer Review Ralph Loop — combines Cavekit kits with a Ralph Loop and true cross-model peer review using Codex (OpenAI).

    1.3k GitHub stars~2.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed

More from cyanheads/pubmed-mcp-server

All 30 skills in this repo
  • Add Prompt

    cyanheads/pubmed-mcp-server

    Scaffold a new MCP prompt template. An agent skill from cyanheads/pubmed-mcp-server.

    156 GitHub stars~1.6k tokensUpdated 5 days ago
    Auto-check passed
  • Add Resource

    cyanheads/pubmed-mcp-server

    Scaffold a new MCP resource definition. An agent skill from cyanheads/pubmed-mcp-server.

    156 GitHub stars~3k tokensUpdated 5 days ago
    Auto-check passed
  • Add Service

    cyanheads/pubmed-mcp-server

    Scaffold a new service integration. An agent skill from cyanheads/pubmed-mcp-server.

    156 GitHub stars~3.6k tokensUpdated 5 days ago
    Auto-check passed
  • Add Test

    cyanheads/pubmed-mcp-server

    Scaffold a test file for an existing tool, resource, or service.

    156 GitHub stars~4.1k tokensUpdated 5 days ago
    Auto-check passed
  • API Auth

    cyanheads/pubmed-mcp-server

    Authentication, authorization, and multi-tenancy patterns for @cyanheads/mcp-ts-core.

    156 GitHub stars~2.7k tokensUpdated 5 days ago
    Auto-check passed
  • API Mirror

    cyanheads/pubmed-mcp-server

    Stand up a persistent, self-refreshing local mirror of a bulk upstream dataset with the MirrorService (@cyanheads/mcp-ts-core/mirror).

    156 GitHub stars~2.5k tokensUpdated 5 days ago
    Auto-check passed

Questions about Add App Tool

What does Add App Tool do?

Scaffold an MCP App tool + UI resource pair. An agent skill from cyanheads/pubmed-mcp-server. Add App Tool is an agent skill from cyanheads/pubmed-mcp-server. Scaffold an MCP App tool + UI resource pair.

When should I use Add App Tool?

Add App Tool fits situations like: the user asks to add a tool with interactive UI; create an MCP App; build a visual/interactive tool.

How do I install Add App Tool in Claude Code?

Run `npx skills add cyanheads/pubmed-mcp-server --skill add-app-tool -a claude-code`. Or copy the skill folder (framework-skills/add-app-tool in cyanheads/pubmed-mcp-server) into .claude/skills/add-app-tool in your project. Claude Code loads it when a task matches its description.

How do I install Add App Tool in Codex?

Run `npx skills add cyanheads/pubmed-mcp-server --skill add-app-tool -a codex`. Or copy the skill folder (framework-skills/add-app-tool in cyanheads/pubmed-mcp-server) into .agents/skills/add-app-tool in your project. Codex loads it when a task matches its description.

Can I use Add App Tool in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cyanheads/pubmed-mcp-server --skill add-app-tool -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-app-tool, .gemini/skills/add-app-tool, .github/skills/add-app-tool and .opencode/skills/add-app-tool in your project.

What does Add App Tool need to run?

Going by SKILL.md and its folder, Add App Tool needs the command-line tools its instructions call (bun).

Does Add App Tool access the network?

SKILL.md names 1 domain. In commands or code: unpkg.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Add App Tool safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add App Tool use?

Add App Tool is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add App Tool use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add App Tool?

Skills that share tags, products or a category with Add App Tool: Setting Up Papergraph (lotchuazzz-crypto/papergraph-mcp, 285 stars), Just PRs MCP (ClawBio/ClawBio, 1.2k stars), Patsnap Current Awareness (patsnap/mcp, 113 stars) and Patsnap Scientific Translational Evidence (patsnap/mcp, 113 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add App Tool?

cyanheads (a GitHub user) maintains it in cyanheads/pubmed-mcp-server, which has 156 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 4, 2026.

Source: cyanheads/pubmed-mcp-server on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.