Skip to main content
In this tutorial, we will enable Chrome’s native WebMCP preview, open a live GoogleChromeLabs demo, and inspect its tools with the Model Context Tool Inspector linked from Chrome’s WebMCP documentation. By the end, you will have used document.modelContext in Chrome without installing an MCP-B runtime.
WebMCP is an experimental browser preview. The flag name and API can change between Chrome releases. Follow Chrome’s imperative API guide for the current native surface. For production use, follow the polyfill path in Build your first tool.

Prerequisites

  • A current Chrome channel that exposes the WebMCP testing flag
  • The ability to install a Chrome extension

What we will use

1

Enable the WebMCP flag

  1. Open Chrome and navigate to chrome://flags/#enable-webmcp-testing
  2. Set WebMCP for testing to Enabled
  3. Click Relaunch
Chrome restarts with the native WebMCP preview enabled.
2

Install the Model Context Tool Inspector

  1. Open the Model Context Tool Inspector in the Chrome Web Store
  2. Click Add to Chrome
  3. Pin the extension so you can open it quickly
Chrome’s WebMCP documentation links to this extension for inspecting native WebMCP pages.
3

Open the demo

  1. Open the pizza-maker demo
  2. Wait for the page to finish loading
  3. Open DevTools and switch to the console
You are now on a page that registers tools through Chrome’s native preview.
4

Verify the native APIs are available

Run:
Check the WebMCP surface
You should see:
Expected console output
5

List the demo tools

Run:
List registered tools
You should see tool metadata from the demo. On the pizza demo, the list includes tools such as set_pizza_size, set_pizza_style, toggle_layer, and add_topping.
6

Inspect the same tools in the extension

  1. Click the Model Context Tool Inspector while the demo tab is active
  2. Open its panel
  3. Confirm that the same tool list appears there
The extension and document.modelContext.getTools() are now showing the same native tool surface.
7

Execute a tool

Run this in the console:
Execute add_topping
You should see the pizza update in the page, and the console should show the tool result. Now execute the same tool from the extension panel and compare the output.

What you learned

  • Chrome can expose document.modelContext locally behind the chrome://flags/#enable-webmcp-testing flag
  • document.modelContext.getTools() discovers tools, and Chrome’s feature-detected executeTool() extension executes a discovered tool
  • Chrome’s WebMCP documentation recommends the Model Context Tool Inspector for inspecting native tools
  • The GoogleChromeLabs demos provide a convenient view of current native behavior

Next steps