关于 Burrowbox
Burrowbox 为 AI Agent 提供持久化 Linux 机器,包含桌面、保持登录状态的浏览器、凭证保险库和 MCP 端点。其 TypeScript 客户端库面向需要创建和管理这些机器并连接 Agent 的开发者。
主要功能
- 01创建和管理 Linux 机器
- 02通过机器的 MCP 端点连接
- 03在凭证保险库中保存登录信息
- 04用签名链接嵌入屏幕
- 05按计划运行命令和 MCP 工具
适用场景
- 01为 Agent 配置持久化机器
- 02通过 MCP 将 Agent 连接到机器
- 03让 Agent 使用已存登录信息但不查看凭证
- 04通过计划任务或 Webhook 运行机器任务
MCP 相关
每台机器都有独立的 MCP 端点;该库提供机器和平台端点的连接信息。辅助函数可将其转换为适用于 Streamable HTTP 客户端、Anthropic Messages API 和 Claude Code 的格式。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://burrowbox.dev/mcpclaude mcp add --transport http burrowbox-burrowbox https://burrowbox.dev/mcp{"mcpServers":{"burrowbox-burrowbox":{"type":"http","url":"https://burrowbox.dev/mcp"}}}在 Cursor 中打开{"servers":{"burrowbox-burrowbox":{"type":"http","url":"https://burrowbox.dev/mcp"}}}在 VS Code 中打开{"mcpServers":{"burrowbox-burrowbox":{"type":"http","url":"https://burrowbox.dev/mcp"}}}{"mcpServers":{"burrowbox-burrowbox":{"serverUrl":"https://burrowbox.dev/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://burrowbox.dev/mcp需要授权工具
详细介绍
burrowbox-js
面向 Burrowbox API 的 TypeScript 客户端库:为 AI Agent 提供持久化的 Linux 计算机,每台计算机都配有桌面、保持登录状态的浏览器、凭据库和自己的 MCP 端点。
安装
bun add burrowbox
npm(npm install burrowbox)和 pnpm(pnpm add burrowbox)也都可以使用。没有运行时依赖。可在任何提供全局 fetch 的环境中使用:Bun、Node 18+、Deno、Cloudflare Workers。请将 API 密钥保存在服务器上。
快速入门
在 Account → API keys 下创建 API 密钥并导出:
export BURROWBOX_KEY=tmk_...
创建一台计算机,并通过 MCP 将 Agent 连接到它:
import { Burrowbox, toAgentSdkMcpServers } from "burrowbox";
import { query } from "@anthropic-ai/claude-agent-sdk";
const bb = new Burrowbox(); // reads BURROWBOX_KEY
// Boots in a few seconds. It turns itself off (keeping its state) after an hour.
const machine = await bb.machines.create({ name: "research-bot", size: "tiny", ttlMinutes: 60 });
// MCP URL + the machine's scoped token (tmm_…), which only works on this machine.
const mcp = await bb.machines.mcp(machine);
for await (const msg of query({
prompt: "Open news.ycombinator.com and summarise the top 5 stories.",
options: { mcpServers: toAgentSdkMcpServers(mcp) },
})) {
if (msg.type === "result" && msg.subtype === "success") console.log(msg.result);
}
await bb.machines.stop(machine); // files, apps, logins and open windows are kept
mcp 是普通数据({ name, url, token, headers }),因此可与任何 Streamable HTTP MCP 客户端配合使用。toMessagesApiMcpServer(mcp) 会生成 Anthropic Messages API MCP 连接器所需的结构,而 toClaudeCodeCommand(mcp) 会打印一条 claude mcp add 命令。
功能
- 计算机: 创建、列出、启动、停止、调整规格、安排计划和销毁计算机,还可查看截图、应用和窗口。
- MCP: 获取每台计算机的端点和平台端点的连接详情。
- 实时视图: 获取签名链接,将计算机屏幕嵌入你的产品。你可以选择观看者是否能够接管控制。
- 保管库: 在计算机中存储登录凭据。Agent 可以使用这些凭据,而无需查看它们。
- 预热池: 让计算机保持启动状态,并根据模板完成设置,然后为客户即时分配一台。
- 自动化: 定时任务和 Webhook,可在计算机内运行命令、MCP 工具或 HTTP 调用。
- 事件 Webhook: 计算机状态变化时发送签名通知,并提供
verifyWebhookSignature()。 - 计费和 VPN: 余额、按客户统计的用量,以及住宅 VPN 位置。
- 类型化错误(
NotFoundError、InsufficientCreditError、RateLimitError等)、超时,以及针对幂等请求的自动重试。
const bb = new Burrowbox({
apiKey: process.env.BURROWBOX_KEY, // or a machine token (tmm_…) for MCP and live-view only
baseUrl: "https://burrowbox.dev",
timeoutMs: 60_000,
maxRetries: 2,
fetch: customFetch, // optional
});
验证事件 Webhook
import { constructWebhookEvent } from "burrowbox";
// Pass the raw body, not re-serialized JSON. Throws WebhookSignatureError if it doesn't verify.
const event = await constructWebhookEvent(await req.text(), req.headers.get("burrowbox-signature"), process.env.BURROWBOX_WEBHOOK_SECRET!);
if (event.type === "machine.stopped") console.log(event.data.machine.id, event.data.detail);
它使用 Web Crypto,因此同一段代码可以在 Bun、Node、Deno、Workers 和边缘运行时中运行。
完整接口请参阅 API.md。
开发
该仓库使用 Bun 进行安装和运行脚本。测试使用 Vitest,构建使用 tsup(ESM + CJS + 类型)。
bun install
bun run typecheck && bun run test && bun run build
bun run smoke # import the built package from Node (ESM and CJS)
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。