webmcp-gen Converts TypeScript Interfaces Into Chrome WebMCP Tool Definitions
A new open-source CLI tool called webmcp-gen allows developers to generate spec-compliant Chrome WebMCP tool definitions directly from existing TypeScript interfaces, eliminating the need to manually rewrite them as Zod schemas. Chrome 149 introduced WebMCP, a browser-native API that enables web pages to expose structured tools to AI agents. webmcp-gen uses ts-morph to parse TypeScript, maps types to JSON Schema, and produces both a .webmcp.json definition and a handler stub with security best practices included. The tool incorporates Google's recommended human-in-the-loop guidance, adding requestUserInteraction() reminders and input sanitisation warnings to generated stubs by default. Released as v1.2.0 under the MIT license, the package underwent a four-agent security audit that identified and resolved ten issues before public release.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in