<form> is instantly callable by AI agents.Add one script tag to any page (ServiceNow, HubSpot, Zendesk, React apps, plain HTML) and every form on that page becomes invocable by an AI agent. No modifications to your existing forms, no backend changes, no build pipeline. Invisible to regular users until an agent is present.
<script src="https://unpkg.com/auto-webmcp@0.3.24"></script>
npm install auto-webmcp@0.3.24
Works with any web platform
auto-webmcp runs entirely in the browser. No server changes, no build pipeline required.
Discovers all <form> elements on page load and watches for new ones via MutationObserver. Reads native toolname and tooldescription attributes when present, and enhances forms that are missing descriptions.
Maps each HTML input type to a JSON Schema property. Text → string, number → number, checkbox → boolean, radio groups → enum. Labels, placeholders, and required attributes become schema metadata.
Calls navigator.modelContext.registerTool() per form with the inferred name, description, and input schema. Fills fields and triggers submission when an AI agent invokes the tool.
When navigator.modelContext is absent (any browser other than Chrome 146+ with the flag enabled), auto-webmcp silently no-ops. Your page is unaffected for regular users.
Chrome 146+ ships WebMCP with two paths. auto-webmcp is a polyfill + enhancement layer that works with both.
toolname to each <form> manually#enable-webmcp-testing flagtoolname/tooldescription when presenttoolname attribute and skips them automatically. No conflicts, no duplicates.
Override the auto-inferred values with data-webmcp-* attributes or the JavaScript API.
import { autoWebMCP } from 'auto-webmcp';
autoWebMCP({
// Override tool name globally
toolName: (form) => form.id || 'my-form',
// Custom description
description: (form) => form.title || 'Submit this form',
// Auto-submit after agent fills fields
autoSubmit: true,
});
<!-- Custom name + description per form -->
<form
data-webmcp-name="search-products"
data-webmcp-description="Search the product catalog"
data-webmcp-autosubmit="true"
>
<input type="search" name="q" placeholder="Search...">
</form>
<!-- Exclude a form entirely -->
<form data-no-webmcp>
<input type="password" name="token">
</form>
Enable chrome://flags/#enable-webmcp-testing in Chrome 146+ and install the
Model Context Tool Inspector Chrome Extension to inspect and invoke your
registered tools in real time. auto-webmcp registers your forms as first-class tools
visible directly in the inspector.
chrome://flags/#enable-webmcp-testing in Chrome 146+. For regular users without the flag, auto-webmcp silently does nothing. Your page is completely unaffected. Once Chrome ships WebMCP to stable, it will activate automatically for all users.
required attributes). Optionally, add data-webmcp-name and data-webmcp-description attributes to any form to sharpen the descriptions visible to agents.
MutationObserver to watch for forms that are dynamically added to the DOM. Forms rendered by any frontend framework (React, Vue, Angular, Svelte) are picked up automatically after they mount.
password, file, and hidden inputs are never included in the tool schema exposed to agents. You can also add data-no-webmcp to any form to exclude it entirely from agent access.