◈OpenTree DashboardSign in

$ document.modelContext

A browsing agent can publish from this page

This site declares its own actions as tools on document.modelContext. An agent in a supported browser reads them and calls them — no screenshots, no guessing which button is the button. The headline tool publishes a live page with no sign-in.

What WebMCP is

The web was built for eyes. A browsing agent normally has to screenshot the surface, infer what is clickable, and hope the layout has not shifted since it last looked. WebMCP inverts that: the document declares its actions as named tools with typed inputs, and the agent calls a function instead of aiming a click.

It is the same idea as the MCP server, moved into the page. Browsers expose it as document.modelContext (some builds put it on navigator), currently behind a Chrome origin trial, so it is live for real visitors in supported versions of Chrome and inert everywhere else.

What this site registers

Three tools, on the marketing surface and in the dashboard:

ToolWhat it does
opentree_publish_htmlTakes a complete HTML document, returns a live unlisted URL. No account.
opentree_open_dashboardNavigates to the dashboard to manage pages, keys and domains.
opentree_read_docsReturns the machine-readable API contract.

The publish tool's inputs

ParameterTypeRequiredNotes
htmlstringyesA complete HTML document.
filenamestringnoDefaults to index.html.
passwordstringnoGate the page behind a passcode.
expiry_hoursnumbernoAuto-delete after N hours. The anonymous default is 24.

How it is registered

No framework, no build step — a descriptor and an execute function:

const mc = document.modelContext || navigator.modelContext;
if (mc && typeof mc.registerTool === 'function') {
  const controller = new AbortController();
  mc.registerTool({
    name: 'opentree_publish_html',
    description: 'Publish an HTML page and get a live, shareable URL. No sign-in.',
    inputSchema: {
      type: 'object',
      properties: { html: { type: 'string' } },
      required: ['html']
    },
    async execute(args) {
      const res = await fetch('/api/sites/anonymous', {
        method: 'POST',
        headers: { 'content-type': 'application/json' },
        body: JSON.stringify({ content: args.html })
      });
      return { content: [{ type: 'text', text: JSON.stringify(await res.json()) }] };
    }
  }, { signal: controller.signal });
}

Unregistering is an abort on the controller — there is no unregisterTool in the trial API.

It calls the same endpoint you would

No separate backend and no special authentication: the tool posts to the anonymous publish route, exactly like the curl on the home page.

curl -X POST https://read.botook.ai/v1/publish -F file=@index.html

The same catalogue, for people

In browsers without the API the registration is dead code, so the identical tool list also drives a ⌘K palette. One sentence in the palette generates a page and publishes it. Humans and agents learn the same verbs, which is the only way a catalogue like this stays honest.

What comes back

A JSON receipt with the unlisted URL, the expiry, and a claim ticket. An anonymous page lives 24 hours; sign in afterwards and the ticket attaches it to your account, after which the normal defaults and gates apply.

Anonymous by design

Requiring a sign-in before a browsing agent can act would defeat the point. The anonymous route is rate-limited by address and short-lived, and the resulting link is unlisted — a random token, never indexed, never listed.

Why bother, when there is already an MCP server

Different agents sit in different places. One is in your terminal and speaks MCP over HTTP; another is inside the browser and has only the document. A publish primitive should be reachable from whichever surface the agent happens to occupy, which is why this exists alongside the server and the REST API.

Safety of a page that exposes actions

The same verbs on three surfaces

Publishing is deliberately reachable three ways, and they are not three implementations — they are three doors onto one endpoint. Which one an agent uses is a fact about where the agent is sitting, not about what it is allowed to do:

SurfaceWho uses itAuthentication
MCP over HTTPAn agent in a terminal, an editor or a hosted clientA bearer key, or an OAuth grant
WebMCP on this pageAn agent driving a browserNone — the anonymous route
RESTA script, a CI job, anything with curlA bearer key, or none for anonymous

The gap between them is what each can reach, not what each can do: the anonymous route publishes and nothing else, because reading your account has to involve you.

The receipt says the bytes were accepted. It does not say the document renders, and an agent that reports a URL it never opened is guessing. One fetch closes that gap, and it is worth making the last step of any tool that publishes:

const receipt = await publish(html);
const check = await fetch(receipt.url);
if (!check.ok) throw new Error('published but not readable: ' + check.status);
// only now is the URL worth reporting

Browser support

Chrome, behind the origin trial. Other browsers do not expose the API yet; the feature detect above is the whole compatibility story, and everything on this site works without it.

Try it

If your browser has the trial enabled, ask your agent to publish a page from here. Otherwise press ⌘K, or paste HTML into the box at the bottom of the home page — all three routes hit the same endpoint.

Questions

Does this cost anything?

No. Pricing is a list of the limits you set yourself in a config file.

Can an agent read my published pages this way?

Not through WebMCP. Reading your account needs a key or an OAuth grant, both of which involve you.

Where is the server-side version?

The MCP server: same verbs, twelve tools, authenticated.

Keep reading