Workbench guide

Give Your AI Agent a Browser With Kitesurf

Give your agent a form to fill, then check the saved record yourself. A local Kitesurf setup with the full prompt and demo server.

Two charcoal clay workers guide a yellow ticket through a small machine toward a receiving tray.
The browser action ends with a record to check. The Engineer Desk
In this piece

What changed

Cloudflare open-sourced Kitesurf on November 12, with a blog walkthrough on November 13, 2026.

Why it matters

Builders can inspect and run a browser engine for agent workflows, then verify what each action actually saved.

Give your AI agent a browser with Kitesurf, then ask it to fill and submit a form. This guide shows how to connect Kitesurf to Claude Code. You will check the saved entry yourself to see whether the task worked.

The task is small: two fields, one button, one saved entry. Success means the name and email appear in a file on your computer. You can compare that file with the receipt the agent sees.

This guide is for readers who can run terminal commands and install development tools. The first build downloads tools and compiles code. We have not measured setup time for this walkthrough.

How the Kitesurf browser connects to your agent

[8] on November 12, 2026. Its [1]. Kitesurf loads web pages, runs their JavaScript, and can save screenshots. It runs on Workers, Cloudflare's code-running platform.

Three parts work together. Claude Code reads your request. Chrome DevTools MCP gives it browser tools. Kitesurf opens the page and carries out those tools' actions.

MCP is a standard for connecting AI apps to tools. The tools talk to Kitesurf through CDP, a browser-control protocol. You do not need to write that connection yourself; Step 3 provides the configuration.

The browser engine runs on your computer in this setup. Claude Code still uses its AI service and your existing billing. This does not install a local AI model.

A request passes from the agent through Kitesurf to a form, followed by an independent saved-record check.
Check the saved record after the browser action. This is a workflow diagram, not a test result. The Engineer Desk

What you need

Part Requirement or cost
Computer A development machine with terminal access
Kitesurf build Node.js 22+, Bazelisk as bazel, pnpm 9.15.4; GNU tar on macOS
Coding agent Claude Code with your existing plan or API billing
Browser connection Chrome DevTools MCP, installed by npx
Demo The Node server below; no database or signup service

Install the tools in the [2] before Step 1. Node.js runs JavaScript on your computer. pnpm installs the project's packages. Bazelisk starts Bazel, which builds the engine and downloads the required build tools.

Use separate terminal tabs so you can keep each service running:

Tab What stays open
1 Kitesurf engine, started in Step 1
2 Demo form server, started in Step 2
3 Claude Code, started in Step 3
4 Your own saved-entry check in Step 5

This guide uses local development. Deploying your own Kitesurf engine to Cloudflare requires a Workers Paid plan. Leave deployment for a later task.

If Claude Code is new to you, read our beginner's guide first. Use a separate folder for this experiment.

Step 1: Start the Kitesurf engine

In a terminal, run the repository's setup commands:

git clone https://github.com/cloudflare/kitesurf.git
cd kitesurf
pnpm install --frozen-lockfile
git rev-parse HEAD
pnpm run dev

Save the commit ID printed by git rev-parse HEAD. It identifies the exact code you used, which helps when reporting an error.

Leave that terminal open. In another terminal, check the documented health endpoint:

curl --fail http://127.0.0.1:8787/health

A successful response tells you the engine is reachable. It does not yet show that your agent can control it. If the build or health check fails, stop here and record the exact error.

Step 2: Make a form you can inspect

In a new terminal tab, create a folder next to the Kitesurf folder:

mkdir kitesurf-demo
cd kitesurf-demo

Run those commands from the parent folder, not from inside kitesurf. Save the following code as demo-server.mjs in the new folder. Copy the whole block; no edits are needed.

import http from 'node:http';
import {appendFileSync, existsSync, readFileSync} from 'node:fs';
import {randomUUID} from 'node:crypto';

const logFile = new URL('./submissions.jsonl', import.meta.url);
const form = `<!doctype html><html lang="en"><meta charset="utf-8">
<title>Desk demo</title><h1>Join the demo list</h1>
<form method="post" action="/submit">
<label>Name <input name="name" required></label>
<label>Email <input name="email" type="email" required></label>
<button type="submit">Save demo entry</button></form></html>`;

http.createServer(async (req, res) => {
  const send = (status, type, body) => {
    res.writeHead(status, {'Content-Type': type, 'Cache-Control': 'no-store'});
    res.end(body);
  };
  if (req.method === 'GET' && req.url === '/') {
    return send(200, 'text/html; charset=utf-8', form);
  }
  if (req.method === 'GET' && req.url === '/records') {
    const lines = existsSync(logFile) ? readFileSync(logFile, 'utf8').trim() : '';
    const records = lines ? lines.split('\n').map(line => JSON.parse(line)) : [];
    return send(200, 'application/json', JSON.stringify(records));
  }
  if (req.method !== 'POST' || req.url !== '/submit') {
    return send(404, 'text/plain', 'Not found');
  }
  try {
    let body = '';
    for await (const chunk of req) {
      body += chunk.toString();
      if (Buffer.byteLength(body) > 4096) {
        return send(413, 'text/plain', 'Demo input too large');
      }
    }
    const input = new URLSearchParams(body);
    const name = (input.get('name') || '').trim();
    const email = (input.get('email') || '').trim();
    if (!name || name.length > 100 || !/^[^@\s]+@example\.com$/.test(email)) {
      return send(400, 'text/plain', 'Use a name and an example.com email');
    }
    const entry = {id: randomUUID(), name, email};
    appendFileSync(logFile, JSON.stringify(entry) + '\n');
    return send(201, 'text/html; charset=utf-8',
      `<!doctype html><title>Saved</title><h1>Saved</h1><p id="receipt">${entry.id}</p>`);
  } catch {
    return send(500, 'text/plain', 'Demo save failed');
  }
}).listen(8788, '127.0.0.1', () => {
  console.log('Demo: http://127.0.0.1:8788');
});

Start it from that folder:

node demo-server.mjs

Open http://127.0.0.1:8788 in your normal browser to inspect the form. Leave the fields empty for now. The page should have Name, Email, and Save demo entry.

The server accepts only example.com email addresses. It writes each submission to submissions.jsonl beside the script before it returns a receipt. That gives us something to check outside the browser.

Use invented details. Keep this demo on your own computer and leave its terminal running while the agent works.

Step 3: Connect Claude Code to Kitesurf

In kitesurf-demo, create .mcp.json with this configuration. If the file already exists, merge the kitesurf entry into its mcpServers object.

{
  "mcpServers": {
    "kitesurf": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--wsEndpoint=ws://127.0.0.1:8787/devtools/browser",
        "--no-usage-statistics"
      ]
    }
  }
}

The [6] documents the WebSocket option. It points the tools at the engine you started. Omitting it would change which browser the server tries to use.

Start Claude Code from this folder. Review its project-server trust prompt, then use /mcp to inspect the connection. Anthropic documents this setup in its [7]. Keep your usual tool permissions enabled.

There is a compatibility limit here. Cloudflare shows [4], while the [5] covers Chrome. A connection does not prove that every tool works with this engine.

Use the form task to find that boundary. If a browser tool fails, keep the error. Do not switch to Chrome and report the result as Kitesurf.

Step 4: Give the agent the complete task

Paste this into Claude Code. Everything needed for this first run is filled in.

PromptSave one demo entry through Kitesurf
ROLE: You are a browser automation engineer. Judge success from observed evidence.

CONTEXT: A Kitesurf engine is running at 127.0.0.1:8787.
The kitesurf MCP server connects to it. I own a demo form at
http://127.0.0.1:8788. This task uses invented data.

MY INPUT:
- Page: http://127.0.0.1:8788
- Name: Mira Demo
- Email: mira@example.com

STEPS:
1. Use only the kitesurf browser tools to open the page and inspect its fields.
2. Fill Name and Email. Submit the form once.
3. Read the receipt and capture a screenshot if that tool works.
4. Report what you observed. I will verify the saved record separately.

OUTPUT: A short table: action, evidence, result. Include the receipt ID,
the screenshot path if one was saved, and any tool error.

RULES:
- Use only this demo origin. Do not open other websites.
- Do not use a shell, HTTP client, or file edit to submit the form.
- Do not read or change submissions.jsonl.
- Do not substitute another browser or invent a successful result.
- If a tool fails or the outcome is unclear, stop without submitting again.
- If something is missing or unclear, ask me before you start.

Watch the tool calls. The agent should inspect the page, enter the two values, and submit once. Its table should name the evidence it saw.

The prompt tells the agent what to do. Your tool permissions still control what it can run, so review the browser calls as they appear.

Step 5: Check the saved record yourself

In another terminal, from kitesurf-demo, run:

cat submissions.jsonl

Find the entry for Mira Demo and mira@example.com. Its id should match the receipt. Count matching entries: the first run should have exactly one.

If the file is missing, no saved entry has been found. If you see two matching entries, the form was submitted more than once. Check the tool history before running the task again.

The receipt and record should agree. A screenshot alone only shows what appeared on the page. A matching record shows that the form action reached this server and was saved.

Our webhook retry guide explains how to plan for repeated writes when you build a larger workflow.

What you should get

The success criteria are a receipt, one matching record, and a tool history that used Kitesurf. These are expected checks, not a claimed TED result. Keep the engine commit, agent version, MCP package version, and errors with your run notes.

Record the terminal version with claude --version. After npx resolves the package, note the version reported by its startup output or /mcp details. Replace @latest with that version for a repeat run.

Common problems: if a step fails

What you see What to check next
Health check fails Tab 1: did the engine finish building and start?
Form does not open Tab 2: is the demo server still running?
MCP connection fails Tab 3: check /mcp and the WebSocket address
Connected, but a browser tool fails Save the tool error and versions; stop the task
No saved file after submission Check the server output before another attempt

A timeout can leave the outcome unclear. Inspect the saved file before asking the agent to submit again.

Try a failure after the first run

For the failure case, stop the demo server with Ctrl+C in tab 2. Copy demo-server.mjs into a new empty folder and start it there. Use an email outside example.com. The server should reject it and save no entry. Ask the agent to report the rejection.

This second case checks whether the agent can recognize a failure. It does not establish that the browser works on unrelated sites, login flows, or complex apps.

For your first run, start the two local services, paste the prompt, and keep the saved-record check in your own terminal.

Sources

  1. Kitesurf is now open source, Cloudflare (blog.cloudflare.com)
  2. Kitesurf README, Cloudflare (github.com)
  3. Kitesurf Browser Run documentation, Cloudflare (developers.cloudflare.com)
  4. The road to the agentic browser: A Kitesurf update, Cloudflare (blog.cloudflare.com)
  5. Chrome DevTools MCP, Chrome DevTools team (github.com)
  6. Chrome DevTools MCP configuration, Chrome DevTools team (github.com)
  7. Connect Claude Code to tools via MCP, Anthropic (code.claude.com)
  8. Kitesurf is now open source: official changelog, Cloudflare (developers.cloudflare.com)

Spot an error? Tell us. See how we handle sources and corrections in our editorial standards.

Found this useful? Get The Weekly Desk, one concise email a week.