WebMCP TypeScript API

193 views
Skip to first unread message

Alex McManus

unread,
Feb 26, 2026, 6:31:15 AMFeb 26
to Chrome Built-in AI Early Preview Program Discussions
Are there official TypeScript types and docs for the WebMCP API, as implemented in the Chrome preview?

I've been looking at `@mcp-b/webmcp-types` (https://github.com/WebMCP-org/npm-packages/tree/main/packages/webmcp-types), but it doesn't look like your `react-flightsearch` demo complies with those type definitions.

In particular, where you define an `outputSchema`, your `execute` function returns a matching value directly. Whereas in `@mcp-b/webmcp-types`, it expects the `execute` function to return an envelope around the response with `content` and `structuredContent` properties, where `structuredContent` matches the output schema. This seems to align with the original MCP API for tools.

Is this an error in your demo, or are you working to a different version of the API?

Thanks, Alex.

Alex Nahas

unread,
Feb 26, 2026, 12:47:43 PMFeb 26
to Chrome Built-in AI Early Preview Program Discussions, Alex McManus
Hi Alex,

Maintainer of the @mcp-b/webmcp-types package here.

To answer directly: the demo is correct. The @mcp-b/webmcp-types package is stricter than the spec requires, the W3C WebMCP IDL defines ToolExecuteCallback as returning Promise<any>, not CallToolResult.

You're also right that outputSchema is on track to be in the spec, but for now neither input nor output schemas are validated; they exist only as semantic hints (tracked in webmachinelearning/webmcp#92).

I've opened an issue to make the types more permissive and align with the actual IDL. Any thoughts on the proposed changes are welcome.

Cheers,
Alex

Alex McManus

unread,
Mar 2, 2026, 12:14:24 PMMar 2
to Chrome Built-in AI Early Preview Program Discussions, Alex Nahas, Alex McManus
Appreciate your help, thanks very much!

Alex

François Beaufort

unread,
May 28, 2026, 5:01:50 AMMay 28
to Alex McManus, Chrome Built-in AI Early Preview Program Discussions, Alex Nahas
FYI I've just filed an issue to track hosting official TypeScript types for WebMCP: https://github.com/webmachinelearning/webmcp/issues/190

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/570f54b4-cbda-4b74-800c-16ee997b7386n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages