Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

webmcp

БесплатноБез исполняемых скриптовНе проверен

Exposes a web page's functionality to AI agents as callable tools with WebMCP, a draft browser API (document.modelContext) from the W3C Web Machine Learning…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

WebMCP

Overview

WebMCP is a proposed web platform API that lets a web page expose its own functionality as "tools": JavaScript functions with a natural-language description and a JSON Schema for their input. A browser-based AI agent discovers those tools and calls them directly instead of clicking through the UI or scraping the DOM.

Key facts, verified against the repository and spec:

  • Runs client-side in the page, in the user's own authenticated browser session. There is no separate server; the tool's execute function is ordinary page JavaScript.
  • Status: draft. It is a Draft Community Group Report of the W3C Web Machine Learning Community Group, "not a W3C Standard nor on the W3C Standards Track". The repository marks it experimental and says the draft has changed significantly since August 2025. Editors are from Google and Microsoft.
  • Browser support: Chrome has an origin trial (Chrome 149) plus the about:flags#enable-webmcp-testing flag for local development; Edge has an origin trial (Edge 150). Safari and Firefox list no implementation, only standards-position issues. Treat it as progressive enhancement.
  • Only the imperative API (registerTool) is defined by the spec. A declarative, form-based API is being explored but is not part of it.

The core surface is document.modelContext (a ModelContext object, SecureContext only):

Member Purpose
registerTool(tool, { signal, exposedTo }) Register a tool; aborting signal unregisters it. Returns a Promise.
getTools({ fromOrigins }) List registered tools (same-origin by default). Used by agents.
executeTool(tool, args, { signal }) Run a discovered tool; resolves to a JSON string.
toolchange event (ontoolchange) Fires when tools are added, removed or updated.

Instructions

1. Enable it for development

Open Chrome with about:flags#enable-webmcp-testing enabled, or register for the origin trial (links in the Chrome docs at developer.chrome.com/docs/ai/webmcp). Serve the page over HTTPS or from localhost.

2. Add types (optional)

npm install --save-dev webmcp-types

The webmcp-types package provides TypeScript definitions for the API.

3. Feature-detect and register a tool

if ('modelContext' in document) {
  const controller = new AbortController();
  await document.modelContext.registerTool(
    {
      name: 'add_task',
      title: 'Add task',
      description: 'Adds a task to the signed-in user\'s to-do list.',
      inputSchema: {
        type: 'object',
        properties: {
          title: { type: 'string', description: 'Task text' },
          due: { type: 'string', description: 'Due date, YYYY-MM-DD' }
        },
        required: ['title']
      },
      annotations: { readOnlyHint: false },
      async execute({ title, due }, { signal }) {
        const task = await todoStore.add({ title, due }, { signal });
        return { id: task.id, title: task.title, due: task.due };
      }
    },
    { signal: controller.signal }
  );
  // later: controller.abort() unregisters the tool
}

Tool fields: name and description and execute are required; title, inputSchema and annotations are optional. execute(input, { signal }) returns a value that is serialized to a JSON string; the signal reports cancellation. If the value cannot be serialized, the call rejects.

4. Annotate the tool

annotations takes readOnlyHint (tool does not change state), untrustedContentHint (output contains user-generated or external data) and consequentialHint (high-stakes or irreversible, so the agent or browser can ask the user first). All default to false.

5. Register by page state

Register tools when they are useful for the current view and unregister them with the AbortController when the view changes. Register statically by default rather than building tool lists dynamically.

6. Inspect and test

An agent (or your test code) can enumerate and call tools:

const tools = await document.modelContext.getTools();
const add = tools.find(t => t.name === 'add_task');
const result = await document.modelContext.executeTool(add, { title: 'Renew passport' });
document.modelContext.addEventListener('toolchange', () => console.log('tools changed'));

getTools() returns RegisteredTool entries with name, title, description, inputSchema, window, origin, annotations.

7. Cross-origin access

By default, other sites and cross-origin iframes cannot see your tools. Share a tool with exposedTo: ['https://partner.shop'] (each entry must be a potentially trustworthy origin, else SecurityError). A cross-origin iframe needs the allow="tools" permission policy, or registerTool() rejects with NotAllowedError.

Errors

Platform failures reject with a DOMException (NotFoundError, DataError, OperationError, AbortError). Return descriptive errors from execute so the model can retry wi

Полный SKILL.md на GitHub

Установить webmcp в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл webmcp?

Exposes a web page's functionality to AI agents as callable tools with WebMCP, a draft browser API (document.modelContext) from the W3C Web Machine Learning Community Group. Use when a user asks to "make my web app agent-ready", "let AI agents add items or search on my site", "register tools in the browser", "use document.modelContext.registerTool", or "test WebMCP in Chrome".

Как установить скилл webmcp?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл webmcp запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить webmcp с