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://localhostis 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
Serve Template Builder over HTTPS. See Pilot Data Server Settings, or use an HTTPS reverse proxy. In the browser console,
isSecureContextmust returntrue.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.Enable the feature in Template Builder with the
featuresURL parameter (comma-separated;allenables every feature):https://pds-host:<https-port>/app/templatebuilder/TemplateBuilder.html?features=webmcp,template-apiwebmcpregisters the tools;template-apiis needed only for the Template Builder API.Connect an agent in the same tab. It should list tools such as
get_editor_state,get_documentationandedit_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,outand 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.templateBuilderawait 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 |
|---|---|
| All operations, with descriptions, read-only flags and input schemas. |
| The built-in guides; |
| 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 |
|
| The |
Changes refused with | Resume agent changes in the Agent activity panel. |
Changes refused with | Close open dialogs, switch to design mode, or save or discard changes. |