/semantic-site:webmcp-toolsfrom semantic-site — static semantic websites with WebMCP on every page
Adds WebMCP tools to web pages so browser-based agents can read and act on page content via document.modelContext.registerTool. Includes a dependency-free kit for registration, validation, and lifecycle management.
Ships in semantic-site — static semantic websites with WebMCP on every page. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
WebMCP lets a page hand tools to an agent running in the browser. The page keeps its session and its UI; the agent calls functions the page defines instead of guessing at the DOM.
The current spec is the W3C Web Machine Learning CG draft of 24 November 2026 (reference/spec.md has the IDL that matters):
await document.modelContext.registerTool(
{ name, title, description, inputSchema, execute(input, { signal }), annotations },
{ signal }, // abort it to unregister
);
runtime/webmcp-kit.js at the plugin root is a dependency-free ES module that
does the registration right, so pages only define tools. Copy it next to the
page's scripts.
<script type="module">
import { registerTools, fitList } from './webmcp-kit.js';
await registerTools([
{
name: 'list_orders',
title: 'List orders',
description: 'List the signed-in user\'s orders, newest first, with id, date, total and status. ' +
'Use get_order for one order\'s lines. Does not change anything.',
inputSchema: {
type: 'object',
properties: {
status: { type: 'string', enum: ['open', 'shipped', 'cancelled'], description: 'Only orders with this status.' },
limit: { type: 'integer', minimum: 1, maximum: 50, default: 10 },
},
additionalProperties: false,
},
annotations: { readOnlyHint: true, untrustedContentHint: true },
async execute({ status, limit = 10 }) {
const rows = (await app.orders({ status })).slice(0, limit);
const { items, truncated } = fitList(rows, (x) => ({ orders: x }));
return { total: rows.length, truncated, orders: items };
},
},
]);
</script>
What the kit does for you:
document.modelContext (spec), then navigator.modelContext and provideContext (older Chrome previews); a no-op without any.AbortController per tool; tools are removed on pagehide and restored when the page returns from the back/forward cache.A–Z a–z 0–9 _ - .; every tool needs a description and execute; the input is checked against the top level of inputSchema (required, types, enums, bounds, unknown keys) with messages an agent can act on.window.pageTools exposes tools, registered, describe() and call(name, input) in every browser, and a webmcp:ready event fires on document.fitList and clip keep results under RESULT_BUDGET (18,000 characters).search_products, get_order, show_results. Prefer 5–10 tools a page really needs over a mirror of every button.readOnlyHint: true. Tools that change the visible page (show_*, open_*) say so. Tools with real consequences (buy, send, delete, publish) get consequentialHint: true and the page asks the user to confirm in its own UI.untrustedContentHint: true, so the agent treats it as data, not instructions.type: "object", additionalProperties: false, enum from real values, minimum/maximum on counts, maxLength on strings, required only for what is truly needed.truncated flag. Never return HTML or whole documents.Error with what to do next ("No item "x". Use search to find ids."), not a stack trace.show_* tool changes the screen the same way the user's own controls do, and a get_current_page tool says what the user is looking at, so the agent and the person stay on the same page.<iframe allow="tools">.Add tools to every page without touching the generator: put a module in the
site's static folder and list it in site.json:
"webmcp": { "scripts": ["assets/my-tools.js"] }
// static/assets/my-tools.js — env is what the built-in tools use:
// env.site (api/index.json), env.page, env.fetchJSON(rel), env.url(rel), env.navigate(href), env.view
export default function tools(env) {
if (env.page.kind !== 'item') return [];
return [{
name: 'cite_item',
description: 'A citation for the item on screen, in APA style.',
annotations: { readOnlyHint: true },
async execute() {
const rec = await env.fetchJSON(`api/${env.page.collection}/${env.page.id}.json`);
return { citation: `${rec.title}. ${env.site.site.title}. ${env.url(rec.url)}` };
},
}];
}
await pageTools.call('tool_name', { … }) in the console, in any browser.chrome://flags/#enable-webmcp-testing, relaunch, install the Model Context Tool Inspector extension; it lists the page's tools and runs them. In that Chrome, await document.modelContext.getTools() and document.modelContext.executeTool(tool, input) are the agent's view.node <plugin-dir>/skills/site-check/scripts/check.mjs <site-dir> fails any page that registers no tools, and on semantic-site sites runs every read tool.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/semantic-siteGenerate a static website from data (CSV, JSON, JSON-LD, N-Triples, N-Quads, or anything converted to them) where every page is HTML content, schema.org JSON-LD, an entry in a static JSON API, and a set of WebMCP tools for in-browser agents. Use when someone wants a website, portal, catalogue, explorer or "semantic app" for a dataset, spreadsheet or knowledge graph, hosted as plain files (GitHub Pages, Cloudflare, Netlify, Hugging Face, any bucket) with no server and no framework./site-checkCheck a built static site before publishing — every page has a title, description, valid JSON-LD, working local links and WebMCP tools; the static JSON API (api/index.json, lists, items, search, OpenAPI) is complete and consistent; and every read-only WebMCP tool runs. Use after building a site with semantic-site, before deploying any static site that should be WebMCP ready, or when asked to verify, audit or debug such a site.npx claudepluginhub caviri/rete --plugin semantic-siteOther plugins' skills for the same job