Cloudflare 开源 Kitesurf:面向 AI Agent
Kitesurf is now open source
Agent 开发者的基础设施利器,原生支持 CDP 且资源占用极低,建议关注其部署方案与兼容性进展。
We introduced Kitesurf, our stateless browser for AI agents that runs entirely on top of Workers, in August and followed up in September with WebMCP support, new APIs, and improved compatibility. On every occasion, we mentioned our commitment to open sourcing it so that developers could run their own browser engine on their own Cloudflare accounts if they want to.
我们在八月推出了 Kitesurf,这是一款完全运行在 Workers 之上的无状态 AI 代理浏览器,并在九月跟进发布了 WebMCP 支持、新 API 以及改进的兼容性。在每次发布中,我们都提到了将其开源的承诺,以便开发者可以在自己的 Cloudflare 账户上运行自己的浏览器引擎(如果他们愿意的话)。
That promise is now real. Kitesurf is open source on GitHub under the Apache 2.0 license. You can read the code, run it locally, change it, and deploy your own instance to Cloudflare Workers.
这一承诺现已实现。Kitesurf 已在 GitHub 上以 Apache 2.0 许可证开源。你可以阅读代码、在本地运行它、修改它,并将你自己的实例部署到 Cloudflare Workers。
A browser built for agents
专为代理构建的浏览器
Kitesurf runs entirely on Cloudflare Workers. It parses HTML, applies CSS, executes page JavaScript, and renders screenshots without a browser container. It supports the Chrome DevTools Protocol (CDP), so you can connect clients such as Puppeteer.
Kitesurf 完全运行在 Cloudflare Workers 上。它在没有浏览器容器的情况下解析 HTML、应用 CSS、执行页面 JavaScript 并渲染截图。它支持 Chrome DevTools Protocol (CDP),因此你可以连接 Puppeteer 等客户端。
Our main goal is to give AI agents a lightweight, efficient browser — one that can load websites, execute JavaScript, and interact with pages while using less CPU and memory than a full browser like Chromium, and scaling on demand across Cloudflare’s global Workers network.
我们的主要目标是为 AI 代理提供一个轻量级、高效的浏览器——它能够加载网站、执行 JavaScript 并与页面交互,同时比 Chromium 等完整浏览器使用更少的 CPU 和内存,并可在 Cloudflare 的全球 Workers 网络上按需扩展。
Read more about why and how we built Kitesurf in our initial announcement and how to use it in Browser Run’s developer documentation.
在我们的初始公告中了解更多关于为何以及如何构建 Kitesurf 的信息,并在 Browser Run 的开发人员文档中了解如何使用它。
What is inside the repository?
仓库里有什么?
Kitesurf builds on Cloudflare’s Developer Platform and APIs, alongside an ecosystem of open-source Rust packages compiled to WebAssembly:
Kitesurf 建立在 Cloudflare 的 Developer Platform 和 API 之上,以及一个编译为 WebAssembly 的开源 Rust 包生态系统:
- Blitz provides HTML parsing, the DOM, layout, and painting.
- Stylo provides CSS parsing, cascading, and computed styles.
- Boa runs JavaScript inside WebAssembly (as the last resort only when we can’t run JavaScript in Dynamic Workers).
- Linebender libraries provide text layout and 2D graphics, and Krilla generates PDF output.
- Blitz 提供 HTML 解析、DOM、布局和绘制功能。
- Stylo 提供 CSS 解析、层叠和计算样式功能。
- Boa 在 WebAssembly 内运行 JavaScript(仅在我们无法在 Dynamic Workers 中运行 JavaScript 时才作为最后手段使用)。
- Linebender 库提供文本布局和 2D 图形功能,Krilla 生成 PDF 输出。
These projects made Kitesurf possible. They retain their respective licenses; the repository's NOTICE documents third-party notices.
这些项目使 Kitesurf 成为可能。它们保留各自的许可证;仓库中的 NOTICE 文件记录了第三方通知。
Kitesurf has three main parts: the Engine manages browser sessions and client connections, PageScript runs the page and its JavaScript, and PageRenderer draws the result.
Kitesurf 有三个主要部分:Engine 管理浏览器会话和客户端连接,PageScript 运行页面及其 JavaScript,PageRenderer 绘制结果。
All packages, the engine, its Rust core, DOM shims, renderer, and Kitesurf CLI live separately in folders under the repository’s packages directory where you can explore how all the pieces fit together.
所有包、引擎、其 Rust 核心、DOM shim、渲染器和 Kitesurf CLI 都分别位于仓库 packages 目录下的文件夹中,你可以在那里探索各个部分如何协同工作。
Run your own Kitesurf
运行你自己的 Kitesurf
To run Kitesurf locally, follow the repository's build requirements, then clone the repository, install dependencies, and start the engine:
要在本地运行 Kitesurf,请遵循仓库的构建要求,然后克隆仓库、安装依赖项并启动引擎:
git clone https://github.com/cloudflare/kitesurf.git
cd kitesurf
pnpm install --frozen-lockfile
pnpm run devThe first build compiles the Rust core and its dependencies, so give it some time. Subsequent builds reuse the build cache. Finally wrangler starts a local development server at http://127.0.0.1:8787. Open that address to try a page in Chrome DevTools, or use it programmatically.
首次构建会编译 Rust 核心及其依赖项,因此请给它一些时间。后续构建将复用构建缓存。最后,wrangler 会在 http://127.0.0.1:8787 启动本地开发服务器。打开该地址以在 Chrome DevTools 中尝试页面,或以编程方式使用它。
You can use puppeteer with a NodeJS script:
你可以使用 puppeteer 配合 NodeJS 脚本:
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://127.0.0.1:8787/devtools/browser",
});
try {
const page = await browser.newPage();
await page.goto("https://example.com/");
await page.screenshot({ path: "page.png" });
} finally {
await browser.disconnect();
}Or you can point your AI harness at the local CDP port (agents love CDP) and watch it take full control of Kitesurf.
或者,你可以将你的 AI 工具指向本地 CDP 端口(代理们喜欢 CDP),并观察其完全控制 Kitesurf。
Deploy to your Cloudflare account
部署到你的 Cloudflare 账户
When you’re done changing and testing locally, you can deploy the engine to your own account and use Kitesurf from there instead of the Browser Run managed APIs we provide. Note that a Workers Paid plan is required because Kitesurf uses Dynamic Workers to create isolated Workers for pages.
当你在本地完成更改和测试后,你可以将引擎部署到你自己的账户,并从那里使用 Kitesurf,而不是使用我们提供的 Browser Run 托管 API。请注意,由于 Kitesurf 使用 Dynamic Workers 为页面创建隔离的 Workers,因此需要 Workers Paid 计划。
From the repository root:
从仓库根目录:
pnpm run deployHelp us make it better
帮助我们做得更好
As with all of our open-sourced projects, Kitesurf lives in Github and we welcome forks and contributions. However, note that Kitesurf is under heavy development and we are focusing on making the engine more compatible (check out Web Platform Test evolution), more reliable, and efficient.
与我们所有的开源项目一样,Kitesurf 托管在 Github 上,我们欢迎分叉和贡献。但是,请注意,Kitesurf 正处于密集开发阶段,我们正专注于使引擎更具兼容性(查看 Web Platform Test 演进)、更可靠和高效。
Start with the contribution guidelines if you want to contribute. Open an issue with a minimal reproduction or a proposed approach, and get vouched by a maintainer before opening a pull request. Focused fixes with tests, clear evidence, and a well-defined scope are much easier to review than large rewrites or unrelated cleanup, but all contribution does not have to be code: a small page that reproduces a rendering bug, a failing automation workflow, or a clear documentation correction can help us move forward.
如果你想做出贡献,请先阅读贡献指南。提交一个包含最小复现或提议方案的 issue,并在提交 pull request 之前获得维护者的背书。带有测试、明确证据和清晰范围的专注修复比大型重写或不相关的清理工作更容易审查,但并非所有贡献都必须是代码:一个能复现渲染 bug 的小页面、一个失败的自动化工作流,或一份清晰的文档更正都能帮助我们推进。
Stay tuned
敬请期待
Kitesurf is evolving quickly. Stay tuned for updates in the blog and our changelog, and keep an eye on the official landing page for the latest on standards compatibility in Web Platform Tests page and benchmarks.
Kitesurf 正在快速演变。请关注博客和我们更新日志中的更新,并密切关注官方着陆页,以获取 Web Platform Tests 页面和基准测试中标准兼容性的最新信息。
And come chat with the team on Discord. We’re building a browser for agents, and we’d love your help making it better.
加入 Discord 与团队聊天。我们正在为代理构建浏览器,我们非常乐意得到你让它变得更好的帮助。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力