CLAWD Gateway

SOLGPT // agent pages

WebMCP explainer

Grok bots: prefer /connect / Agent Connect for wallet create + WebMCP trading.

WebMCP is a browser standard (document.modelContext / navigator.modelContext) so agents can call tools on a page instead of screenshot-analyze-click loops. A page registers tools with a name, description, JSON Schema, and execute. Tools run in the same visible UI as the human. Missing document.modelContext is a no-op. Chrome beta lab sessions also expose navigator.modelContextTesting.listTools() / executeTool(). Cloudflare puts a small bridge in front of the origin. Same for these static pages and the React SPA. See Chrome WebMCP EPP and Cloudflare Browser Run WebMCP.

Humans: the interactive guide is /webmcp — shipped catalog, try-it execute(), copyable ChatGPT / Codex / MCP Inspector snippets for /mcp, and the shipped @x402solana/cli (x402 authorize + paper ooda). Agents: this page plus POST /mcp with a Bearer from npx -p @x402solana/cli x402 authorize. Paper ooda does not spend.

Named packs on the desk: solana.*, solgpt.*, clawd.*, x402.*, pump.*. Inspect, quote, and stage only. No silent sign or spend.

Two parts in front of the origin

Neither part rewrites your app code. Both work the same way on static HTML and a single-page app.

  1. Injection. Edge or origin adds one line to HTML: a module script pointing at same-origin /.webmcp/bridge.js.
  2. Bridge. The script finds document.modelContext. No surface → no-op, page unchanged. With a surface, it loads packs from data-packs and registers MCP tools.

The script tag

Origin fallback (Cloudflare edge may also inject it):

<script type="module"
        src="/.webmcp/bridge.js"
        data-packs="c2pa,mcp-server-client"
        data-mcp-url="/mcp"></script>

Packs

Site MCP Server pack discovers tools at boot via same-origin POST /mcp method tools/list, then proxies tools/call with credentials: same-origin so the visitor session is used. Public tools on this desk are read-only (pages, trending, health, pump quote). No keys.

Content Credentials pack (c2pa) reads image provenance in the visitor browser (first kilobytes of C2PA metadata). It does not send the image to Cloudflare.

registerTool proxy (from the Cloudflare blog)

// For each tool the site's own MCP server advertises (via tools/list),
// registering a proxy whose execute() calls the site back on the
// visitor's origin, with their session.
document.modelContext.registerTool({
  name: tool.name,                 // e.g. "search_products"
  description: tool.description,
  inputSchema: tool.inputSchema,   // taken straight from tools/list
  execute: async (args) => {
    const res = await fetch(mcpUrl, {   // same-origin /mcp
      method: "POST",
      credentials: "same-origin",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({
        jsonrpc: "2.0", id: 1, method: "tools/call",
        params: { name: tool.name, arguments: args },
      }),
    });
    const { result } = await res.json();
    return result;   // an MCP CallToolResult, passed straight through
  },
});

Chrome beta + Cloudflare Browser Run lab

WebMCP APIs in Chrome currently need a lab session (wrangler browser create --lab). Prefer listing tools over clicking.

npm i -g wrangler@latest
wrangler browser create --lab --keepAlive 300

In DevTools console on this origin:

await navigator.modelContextTesting.listTools();
await navigator.modelContextTesting.executeTool(
  "solana.get_wallet_context",
  JSON.stringify({}),
);

After each tool, list tools again — the set can change with page state. Stage tools (solana.stage_swap, x402.stage_payment) are human-in-the-loop: they set requiresUserSignature: true and wait for the connected wallet. Do not silent-sign.

Chrome DevTools MCP against a Browser Run lab session uses placeholders only — never commit CLOUDFLARE_API_TOKEN. Watch HITL prompts with wrangler browser list then wrangler browser view $SESSION_ID.

clawd-bot computers
  1. Open /llms.txt
  2. Open /agent/
  3. Call POST /mcp (tools/list, then tools/call)

$CLAWD still gates computer, art, Grok/Hauhau (100,000 $CLAWD). Do not implement spend tools here. Never print keys.

What this does and how it works

Two parts sit in front of the origin. Same for these static pages and the React SPA.

  1. Edge/origin injects one line: a module script at /.webmcp/bridge.js with data-packs="c2pa,mcp-server-client" and data-mcp-url="/mcp". Cloudflare may also inject this at the edge. This origin copy is the fallback.
  2. The bridge finds document.modelContext. If the browser has no WebMCP surface, it no-ops and the page is unchanged.

Packs register MCP tools. The Site MCP Server pack discovers tools from same-origin POST /mcp (tools/list) and proxies tools/call with credentials: same-origin. The Content Credentials pack (c2pa) reads image provenance in the visitor browser.

Agents already speaking MCP can drive the page. clawd-bot computers: open /llms.txt then /agent/ then call /mcp.

$CLAWD still gates computer, art, Grok/Hauhau (100,000 $CLAWD). Public MCP tools are read-only (pages, trending, health, pump quote). No keys.

Longer explainer: WebMCP.