webmcp
Skill1 starsChanged 31 days agoMITView on GitHub
WebMCP: expose web page tools to AI agents via document.modelContext, following the W3C Web Machine Learning Community Group draft. Use when adding, reviewing or testing in-page agent tools in a website or web app: registerTool with name, title, description, inputSchema (JSON Schema) and execute, tool annotations (readOnlyHint, untrustedContentHint, consequentialHint, debugging), unregistering with an AbortSignal, getTools and executeTool for in-page agents, toolchange, toolactivated and toolcancel events, cross-origin exposure with exposedTo and fromOrigins, the tools Permissions-Policy and the iframe allow attribute, and the security and privacy risks (tool poisoning, output injection, misrepresentation of intent, over-parameterization). Triggers: webmcp, web mcp, modelContext, navigator.modelContext, document.modelContext, browser agent tools, agent-ready website, Chrome WebMCP origin trial.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Register tools: Call document.modelContext.registerTool(tool, { signal }) after feature detection, inside a secure context.
- Very specific: line 55
Review security and privacy: Check tool metadata, inputs and outputs against the draft's risk list.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebMCP
WebMCP is a JavaScript API, incubated as a Draft Community Group Report in the W3C Web Machine Learning Community Group, that lets a web page register tools (functions with natural language descriptions and JSON Schema inputs) for agents, browser agents and assistive technologies to call. With this skill the agent registers, scopes, annotates and unregisters page tools, and reviews them against the draft's security and privacy considerations.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites (§ names refer to the WebMCP draft). When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Draft posture: build, pinned to the Draft Community Group Report of 30 September 2026, commit d61d0e6d297ddb6bff3510b1330dbb215c6ef43c. The API can change without notice; feature-detect it and keep tool logic behind a thin registration layer.
Inputs (fill in, or ask before starting)
- Role: tool owner (a page that registers tools), in-page agent (a page or iframe that discovers and executes tools), or reviewer.
- Embedding: top-level only, or same-origin or cross-origin iframes that register or consume tools.
- Revision: the pinned commit in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources, compare the repository's latest commit and the published report date with the pin, check the implementation status page, and update the pins.
Invariants
- The entry point is
document.modelContext(§ Extensions to Document). Earlier drafts usednavigator.modelContext; the getter moved toDocumentin pull request #184. Feature-detect with"modelContext" in document. - Secure contexts only.
modelContext,ModelContextand the event interfaces are[SecureContext](WebIDL in § API). - Tool names are unique per document, 1 to 128 characters of ASCII alphanumerics,
_,-or., anddescriptionis non-empty; otherwiseregisterTool()rejects withInvalidStateError(§ ModelContext Interface, registerTool steps). inputSchemamust serialize to JSON; serialization errors reject registration (registerTool steps). The schema is a JSON Schema object (§ ModelContextTool Dictionary).- Unregister by aborting the
signalpassed at registration (§ ModelContextRegisterToolOptions). Unregistering does not cancel an execution already in progress (§ unregister a tool, note). - Results must be JSON-serializable. The
executepromise's value is serialized to a JSON string; a value that cannot be serialized fails the call (§ imperative execute steps). - Access is gated by the
toolspolicy-controlled feature with default allowlist'self'(§ Permissions policy integration). Cross-origin iframes needallow="tools";Permissions-Policy: tools=()disables WebMCP for a document and all its descendants (§ Mitigations). - Tools are not exposed cross-origin unless listed in
exposedTo, which only accepts potentially trustworthy origins (registerTool steps; Chrome imperative API guide). - Hints are hints. Annotations do not enforce anything; the tool's
executecallback must still validate inputs, authorization and preconditions (explainer, Best Practices).
Workflow
- Decide which tools to expose. One well-defined function per tool, few tools per page state, names and descriptions that say what the tool does.
->
references/api.md✓ Every tool has a valid unique name, a description, and an input schema with adescriptionon each property. - Register tools. Call
document.modelContext.registerTool(tool, { signal })after feature detection, inside a secure context. ->references/api.md✓ Registration resolves; anAbortControllerper tool or per page state controls its lifetime. - Annotate. Set
readOnlyHint,untrustedContentHintandconsequentialHintfrom what the tool actually does. ->references/api.md,references/security.md✓ Read-only tools say so; tools that return user-generated or external content setuntrustedContentHint; purchases, transfers and deletions setconsequentialHint. - Handle execution. Validate inputs, check authorization against current state, honor
options.signal, return JSON-serializable results and clear error messages, and update the visible UI. ->references/api.md✓ Calls with stale or invalid arguments fail with an actionable message instead of acting. - Scope embedding. Set
Permissions-Policyand iframeallowattributes; useexposedToandfromOriginsonly for origins you trust. ->references/security.md✓ Documents that should not register tools sendPermissions-Policy: tools=(); no tool is exposed to an origin you would not share the data with. - Review security and privacy. Check tool metadata, inputs and outputs against the draft's risk list.
->
references/security.md✓ No tool asks for parameters it does not need, and no tool path skips checks the UI path performs.
Verify before done
- Code uses
document.modelContext, notnavigator.modelContext, and does nothing when the API is absent. - Every tool name matches
^[A-Za-z0-9_.-]{1,128}$and is unique in its document. - Each
registerTool()call either passes asignalor is meant to live for the whole document. executereturns JSON-serializable values and handlesoptions.signal.- Annotations match behavior: no
readOnlyHint: trueon a tool that changes state. - The
toolsPermissions-Policy and iframeallowattributes match where tools should run. - Tool inputs are validated and authorized in
execute, as for any other client-side entry point.
Reference index
references/api.md: the WebIDL, every dictionary member, registration and unregistration rules, execution, discovery, events, and examples. Load for steps 1 to 4.references/security.md: Permissions-Policy, cross-origin exposure, annotations as mitigations, and the draft's prompt injection, misrepresentation, over-parameterization and private browsing risks. Load for steps 3, 5 and 6.
Related skills
mcp-authorizationfor authorization of server-side MCP tools, which WebMCP mirrors in the browser:npx skills add ScaleDockHQ/scaledock-skills --skill mcp-authorization.owasp-agenticfor reviewing tool misuse, goal hijack and human-in-the-loop controls:npx skills add ScaleDockHQ/scaledock-skills --skill owasp-agentic.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- WebMCP (published report): Draft Community Group Report (W3C Web Machine Learning CG), 30 September 2026, checked 2026-10-02. Draft posture: build.
- WebMCP spec source, index.bs: Draft Community Group Report, commit d61d0e6 (2026-09-30), checked 2026-10-02. Draft posture: build.
- WebMCP explainer, README.md: Explainer (non-normative), commit d61d0e6 (2026-09-30), checked 2026-10-02.
- WebMCP implementation status: Informative, commit d61d0e6 (2026-09-30), checked 2026-10-02.
- WebMCP pull request #184: Move the modelContext getter to Document: Merged change, commit c7b5c70 (2026-05-27), checked 2026-10-02.
- Chrome for Developers: WebMCP: Origin trial documentation, last updated 2026-10-01, checked 2026-10-02.
- Chrome for Developers: WebMCP Imperative API: Origin trial documentation, last updated 2026-09-21, checked 2026-10-02.
- Chrome for Developers: WebMCP tool security: Origin trial documentation, last updated 2026-09-01, checked 2026-10-02.
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- BuilderIO/skills★ 4.6ksame name
- qdhenry/Claude-Command-Suite★ 1.3ksame name
- webmaxru/web-ai-agent-skills★ 52same name
- AgriciDaniel/web-mcp★ 12same name
- malinskibeniamin/skills★ 4same name
- webmaxru/webmcp-access-review-workbench★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- a2aSkill
- ag-uiSkill
- ap2Skill
- asyncapiSkill
- authzenSkill
- cedarSkill
- cloudeventsSkill
- eu-ai-actSkill
- fapiSkill
- gnapSkill
- jwtSkill
- mcp-authorizationSkill
- oauthSkill
- ocsfSkill
- openapi-arazzoSkill
- openapi-overlaySkill
- openapiSkill
- openfeatureSkill
- openid4vcSkill
- openid-connectSkill
- openid-federationSkill
- openidSkill
- opentelemetry-genaiSkill
- owasp-agenticSkill
- problem-detailsSkill
- ratelimit-headersSkill
- scaledock-agent-permissionsSkill
- scaledock-enterprise-identitySkill
- scaledock-http-apiSkill
- scaledock-mcp-serverSkill
- scaledock-repo-standardSkill
- scimSkill
- shared-signalsSkill
- spiffeSkill
- standard-schemaSkill
- typespecSkill
- web-bot-authSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

