WebMCP (Web Model Context Protocol) is a proposed browser API that lets a web page offer tools to AI agents running in the browser. With WebMCP enabled, Template Builder registers tools for reading and editing the open template: fields, tabs, layout, script, scenes, test runs and saving. An agent calls these tools with the user's session and rights in Pilot Data Server, and its changes appear in the editor as they are made. The same operations are available to JavaScript code through the Template Builder API.

Experimental. WebMCP is a draft web standard, available only in Google Chrome behind an origin trial or a browser flag. The Template Builder tools and API are experimental (version 0.x), and may change between releases without notice.

Requirements

  • HTTPS. Browsers expose WebMCP (document.modelContext) only in secure contexts. Over plain HTTP the tools are not registered (http://localhost is the only exception). A self-signed certificate works once it is accepted in the Chrome profile; a new profile must accept it first.

  • Google Chrome with WebMCP enabled.

  • A WebMCP-capable agent in the same browser, for example a browser extension.

Set up WebMCP

  1. Serve Template Builder over HTTPS. See Pilot Data Server Settings, or use an HTTPS reverse proxy. In the browser console, isSecureContext must return true.

  2. Enable WebMCP in Chrome. Open chrome://flags/#enable-webmcp-testing, set it to Enabled and relaunch Chrome. The flag name may change in later Chrome versions.

  3. Enable the feature in Template Builder with the features URL parameter (comma-separated; all enables every feature):

    https://pds-host:<https-port>/app/templatebuilder/TemplateBuilder.html?features=webmcp,template-api

    webmcp registers the tools; template-api is needed only for the Template Builder API.

  4. Connect an agent in the same tab. It should list tools such as get_editor_state, get_documentation and edit_field. A developer extension such as Google's Model Context Tool Inspector lists the registered tools and can call them directly.

Use WebMCP

The tools carry their own descriptions, and get_documentation returns guides on building templates, so the agent needs no further instructions. The tools cover reading the editor state, template, logs and documentation; editing fields, UI items, tabs, layout and template settings; setting and running the script, switching between design and run mode and setting test data; and finding scenes, setting up concepts, and listing, opening, creating, saving and closing templates.

Agent activity and safeguards

After the first agent call, an Agent activity panel appears in the footer:

  • Agent activity opens a log of the last 20 agent calls and their results.

  • The status text shows whether an agent session is active (an agent has made changes since the last save or load) or paused.

  • Pause refuses agent changes until resumed. Agents can still read.

  • Stop cancels the agent calls in progress. Changes already made remain.

In addition:

  • Each agent change is one undo step.

  • If an agent changed the template script or script units, every save first asks the user to review the script. Declining cancels the save.

  • Changes are refused while a dialog is open or a save or mode change is in progress, and design changes are refused in run mode. Opening, creating or closing a template is refused while the open template has unsaved changes.

What agents can do

  • A script written by an agent runs with full access when tested: take, update, out and Viz commands reach the Media Sequencer the script names. Do not test against an on-air system.

  • An agent can save to Pilot Data Server without a prompt, apart from the script review. Undo after a save does not change the saved template.

  • Some changes apply in Pilot Data Server at once, for example new tags.

  • An agent can set any URL for iframe items, HTML panels and field options.

Template Builder API

With the template-api feature, the same operations are available to JavaScript on the Template Builder page as window.vizrt.templateBuilder. Each method takes one input object (snake_case keys) and returns a promise. API calls are not agent calls: they do not appear in the Agent activity panel and cannot be paused or stopped. Enable template-api only where the page's code is trusted.

const tb = window.vizrt.templateBuilder
await tb.fields.add({ name: "headline", type: "single_line", label: "Headline" })
await tb.templates.save()

List the methods and tools

The operations change while the feature is experimental, so list them from the browser console:

Call

Returns

window.vizrt.templateBuilder.describe()

All operations, with descriptions, read-only flags and input schemas.

await window.vizrt.templateBuilder.help()

The built-in guides; help({ topic: "scripting" }) reads one. Agents get the same guides from get_documentation.

await window.vizrt.templateBuilder.state()

The editor state: open template, unsaved changes, run mode.

The WebMCP tools group these operations. To see the tools as agents see them, use the agent's tool list, a WebMCP inspector extension, or await document.modelContext.getTools() in the console.

Troubleshoot

Problem

Check

The agent finds no tools

  • isSecureContext returns true in the console.

  • "modelContext" in document returns true. If not, enable WebMCP in Chrome.

  • The address contains features=webmcp or features=all.

  • The agent runs in the same tab.

  • For Claude Code, see Use with Claude Code above.

window.vizrt.templateBuilder is undefined

The features parameter contains template-api or all, and Template Builder has finished loading.

Changes refused with paused_by_user

Resume agent changes in the Agent activity panel.

Changes refused with busy, design_mode_required or unsaved_changes

Close open dialogs, switch to design mode, or save or discard changes.