Files
browser-automation-botGitHubrelease-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4d7b677d1d chore: release main (#15201)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2026-07-27 14:29:23 +02:00

1.4 KiB

sidebar_label
sidebar_label
WebMCP

WebMCP class

The experimental WebMCP class provides an API for the WebMCP API.

See the WebMCP guide for more details.

Signature

export declare class WebMCP extends EventEmitter<{
    toolsadded: WebMCPToolsAddedEvent;
    toolsremoved: WebMCPToolsRemovedEvent;
    toolinvoked: WebMCPToolCall;
    toolresponded: WebMCPToolCallResult;
}>

Extends: EventEmitter<{ toolsadded: WebMCPToolsAddedEvent; toolsremoved: WebMCPToolsRemovedEvent; toolinvoked: WebMCPToolCall; toolresponded: WebMCPToolCallResult; }>

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the WebMCP class.

Example

await page.goto('https://www.example.com');
const tools = page.webmcp.tools();
for (const tool of tools) {
  console.log(`Tool found: ${tool.name} - ${tool.description}`);
}

Methods

Method

Modifiers

Description

tools()

Gets all WebMCP tools defined by the page.