Skip to content

Repository files navigation

WebMCP FormKit

Turn ordinary HTML forms into declarative WebMCP tool surfaces.

简体中文

Chrome's experimental Lighthouse Agentic Browsing audits have started treating form usability for agents as a first-class web quality signal. The practical path for many sites is simple: add declarative WebMCP metadata to the forms users already submit.

webmcp-formkit helps you do that locally.

It scans static HTML, infers useful WebMCP attributes, reports what is missing, and can inject:

  • toolname
  • tooldescription
  • toolparamdescription

No API keys. No browser automation. No model call.

Why This Exists

Most sites already have valuable forms: signup, search, contact, quote requests, booking, lead capture, support, checkout steps, admin actions.

Humans can infer what those forms mean from labels and context. Agents need a more stable contract. Chrome's WebMCP direction makes this visible: a form can be ordinary HTML for users and a declared tool for agents.

This project is deliberately narrow. It is not a general accessibility scanner, visual checker, MCP server test runner, or SEO suite. It does one thing: make forms easier for agents to understand.

30 Second Demo

npx github:maxi-maxima/webmcp-formkit demo

The demo creates a tiny site, injects WebMCP metadata, and writes:

reports/demo/site/index.html
reports/demo/webmcp-formkit.json
reports/demo/webmcp-formkit.md

Scan A Site

npx github:maxi-maxima/webmcp-formkit scan ./dist --out reports/webmcp

Print JSON:

npx github:maxi-maxima/webmcp-formkit scan ./dist --json

Inject Attributes

npx github:maxi-maxima/webmcp-formkit inject ./dist --out reports/webmcp

inject updates HTML files in place. Use it on generated output or a branch, then review the diff.

Example output:

<form action="/signup" method="post"
  toolname="submit_signup"
  tooldescription="Submit signup form">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required
    toolparamdescription="Email">
</form>

What It Checks

Finding Severity Meaning
missing-toolname warning A form has no declared WebMCP tool name.
missing-tooldescription warning A form has no agent-readable description.
field-missing-name error A field cannot be submitted reliably by an agent.

Inference Rules

webmcp-formkit uses conservative local hints:

  • form toolname if already present
  • form id
  • form action
  • submit button text
  • field labels, aria-label, and placeholders
  • existing toolparamdescription

It does not send your HTML anywhere.

Commands

webmcp-formkit demo [--out reports/demo]
webmcp-formkit scan <path> [--out reports/webmcp-formkit] [--json]
webmcp-formkit inject <path> [--out reports/webmcp-formkit]

Exit Codes

The current release focuses on report generation and returns non-zero only for CLI/runtime errors. CI failure thresholds are planned for a later release.

Research Notes

This tool was built after reviewing the emerging Chrome/WebMCP agentic browsing surface, especially the direction around declarative form metadata and Lighthouse Agentic Browsing audits. The bet is not that every website becomes an MCP server. The bet is that forms are the smallest useful bridge between today's web and agent-readable actions.

Development

npm install
npm run check
node dist/cli.js demo --out reports/demo
npm pack --dry-run --ignore-scripts

License

MIT

About

Turn ordinary HTML forms into declarative WebMCP tool surfaces.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages