Connect with WebMCP
The WebMCP connection is a Run-scoped MCP server. It lets an AI agent
discover and call tools exposed by the active webpage, such as search,
add_to_cart, or book_appointment.
BCTRL returns a credentialed webMcpUrl when the browser Runtime starts. Pass
that URL to any MCP client that supports Streamable HTTP.
Complete example
Install the BCTRL SDK and the official TypeScript MCP SDK:
This example creates a browser Runtime, opens a WebMCP-enabled store, connects
an MCP client, discovers the page tools, and calls search_catalog.
Replace the example URL, tool name, and arguments with those exposed by the site you want to automate.
The MCP client can access only the tools declared by the active webpage. It does not receive CDP access or general control of the browser.
Get the WebMCP URL
An ephemeral Runtime starts during creation:
For a reusable profile-backed Runtime, start it when you need a new session:
The connection fields are:
The URL remains stable while the Run is active and stops working when the Run ends. Treat it as a credential: do not log it, persist it, or expose it to page code.
Open a WebMCP-enabled page
WebMCP exposes tools from the current webpage. Navigate the browser to a site that supports WebMCP before listing tools.
You can use a hosted browser Tool:
You can also navigate with CDP, WebDriver, or a hosted Agent.
Connect an MCP client
Connect using the Runtime’s webMcpUrl:
List and call page tools
List the tools exposed by the active page:
Call a tool by name with the arguments defined by its input schema:
Tool names and arguments are defined by the website. If the active page does
not expose WebMCP tools, tools/list returns an empty list. Navigating to
another page can change the available tools, so list them again after
navigation.
Close the connection
Close the MCP client when the agent is finished, then stop the Runtime:
Stopping the Runtime ends the active Run and invalidates its WebMCP URL. Use
runId with Runs to inspect the recording, trace, events, usage,
and files from the session.
Page requirements and safety
The active page must register tools with the browser’s native WebMCP API. During the browser rollout, a site may also need to meet Chromium’s feature-availability or origin-trial requirements.
Tool descriptions, schemas, and results come from the webpage. Treat them as untrusted input and keep approval checks for tools that purchase items, submit forms, or change account state.
The WebMCP URL grants access only to page-declared tools. It does not grant raw CDP or WebDriver access.
Next
- Connect with CDP — attach Playwright or Puppeteer
- Connect with WebDriver — attach Selenium
- Runtimes — configure and manage browsers
- Runs — inspect activity and recordings

