webmcp-add-tool

webmcp-add-tool is a skill for Claude Code, Codex from agentcathq/webmcp-react. It costs 73 tokens per session (1,593 once invoked), scanned A, original, MIT.

A scaffolding command for adding a function that an AI can call in a WebMCP React application. It creates the input validation, execution handler, registration code, and provider wiring.

In plain words
What is it for?
Use it to create headless or visible tools with Zod input schemas, execution-state handling, annotations, and registration under a WebMCPProvider.
Why use it?
It removes repetitive setup when exposing an application action to AI systems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/agentcathq/webmcp-react/webmcp-add-tool
Any agent
npx skills add agentcathq/webmcp-react --skill webmcp-add-tool
Clone the repo
git clone --depth 1 https://github.com/agentcathq/webmcp-react

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for webmcp-add-tool

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentcathq/webmcp-react/webmcp-add-tool.svg)](https://agentmods.dev/skills/agentcathq/webmcp-react/webmcp-add-tool)
Your own site
<a href="https://agentmods.dev/skills/agentcathq/webmcp-react/webmcp-add-tool"><img src="https://agentmods.dev/badge/skills/agentcathq/webmcp-react/webmcp-add-tool.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,593 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00073 $0.01593
Opus 5 $0.00036 $0.00796
Sonnet 5 $0.00015 $0.00319
Haiku 4.5 $0.00007 $0.00159

Measured today against content hash b3b0315c30ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

webmcp-add-tool scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/webmcp-add-tool/SKILL.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a WebMCP Tool

Overview

Each tool is a React component that calls useMcpTool. It registers on mount, unregisters on unmount. Tools can be headless (return null) or render UI showing execution state.

Workflow

  1. Determine the tool's name, description, input schema, and what the handler does
  2. Choose headless vs UI tool
  3. Scaffold using the appropriate template below
  4. Set annotations based on tool behavior
  5. Wire the component into the <WebMCPProvider> tree

Template: Headless tool

For tools that do work without rendering anything visible:

import { useMcpTool } from "webmcp-react";
import { z } from "zod";

export function MyTool() {
  useMcpTool({
    name: "my_tool",
    description: "One-line description of what this tool does",
    input: z.object({
      // Define each input field with .describe() for AI context
      query: z.string().describe("The search query"),
    }),
    handler: async ({ query }, { signal }) => {
      // signal aborts if the agent cancels — forward it to cancellable work
      const result = await doSomething(query, { signal });
      return {
        content: [{ type: "text", text: JSON.stringify(result) }],
      };
    },
  });
  return null;
}

Template: Tool with execution state UI

For tools that show loading, results, or errors:

import { useMcpTool } from "webmcp-react";
import { z } from "zod";

export function MyTool() {
  const { state, execute, reset } = useMcpTool({
    name: "my_tool",
    description: "One-line description of what this tool does",
    input: z.object({
      text: z.string().describe("Input text to process"),
    }),
    handler: async ({ text }) => {
      const result = await process(text);
      return { content: [{ type: "text", text: result }] };
    },
    onSuccess: (result) => {
      // Optional: analytics, toast, etc.
    },
    onError: (error) => {
      // Optional: error reporting
    },
  });

  return (
    <div>
      <button onClick={() => execute({ text: "hello" })} disabled={state.isExecuting}>
        {state.isExecuting ? "Processing..." : "Run"}
      </button>
      {state.lastResult && <p>{state.lastResult.content[0].text}</p>}
      {state.error && <p className="error">{state.error.message}</p>}
      <span>Executions: {state.executionCount}</span>
    </div>
  );
}

Read the full file on GitHub · 214 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed b3b0315c30ae
  2. 4d ago First seen · 214 lines · 73 tokens per session scan A a3c7de658f0e

Subscribe to this mod's changes

webmcp-add-tool is a skill published in the GitHub repository agentcathq/webmcp-react (47 stars, last pushed today), licensed MIT. It adds 73 tokens to every session and 1,593 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.