cloudflare-agents
Build AI agents on Cloudflare Workers with MCP integration, tool use, and LLM providers.
- License 许可
- MIT
- 最近更新
- 2026-08-24
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- cloudflare-agents
- license
- MIT
- description
- Build AI agents on Cloudflare Workers with MCP integration, tool use, and LLM providers.
02 资源文件 22
- 参考文档references/advanced-features.md13.6 KB
- 参考文档references/agent-api.md2.9 KB
- 参考文档references/configuration-guide.md3.1 KB
- 参考文档references/error-catalog.md275 B
- 参考文档references/http-sse-guide.md2.0 KB
- 参考文档references/mcp-integration.md2.7 KB
- 参考文档references/patterns-concepts.md11.0 KB
- 参考文档references/state-management.md9.5 KB
- 参考文档references/websockets-guide.md3.0 KB
- 脚本templates/basic-agent.ts383 B
- 脚本templates/browser-agent.ts4.9 KB
- 脚本templates/calling-agents-worker.ts3.7 KB
- 脚本templates/chat-agent-streaming.ts1.5 KB
- 脚本templates/hitl-agent.ts6.6 KB
- 脚本templates/mcp-server-basic.ts4.0 KB
- 脚本templates/rag-agent.ts4.8 KB
- 其他templates/react-useagent-client.tsx5.5 KB
- 脚本templates/scheduled-agent.ts4.5 KB
- 脚本templates/state-sync-agent.ts3.9 KB
- 脚本templates/websocket-agent.ts4.1 KB
- 脚本templates/workflow-agent.ts3.8 KB
- 其他templates/wrangler-agents-config.jsonc1.9 KB
03 SKILL.md 正文
Cloudflare Agents
Last Updated: 2025-11-21
Quick Start
export default {
async fetch(request, env, ctx) {
const agent = {
tools: [
{ name: 'getTodo', handler: async ({id}) => ({id, title: 'Task'}) }
],
async run(input) {
return await processWithLLM(input, this.tools);
}
};
return Response.json(await agent.run(await request.text()));
}
};
Core Features
- Tool Integration: Register and execute tools
- LLM Providers: OpenAI, Anthropic, Google Gemini
- MCP Protocol: Model Context Protocol support
- Cloudflare Bindings: D1, KV, R2, Durable Objects
Agent Pattern
const agent = {
tools: [...],
systemPrompt: 'You are a helpful assistant',
model: 'gpt-4o',
async run(input) {
// Process with LLM
}
};
Resources
Core Documentation
references/patterns-concepts.md(317 lines) - What is Cloudflare Agents, patterns & concepts, critical rules, known issues preventionreferences/configuration-guide.md(152 lines) - Complete configuration deep divereferences/agent-api.md(115 lines) - Complete Agent Class API reference
Integration Guides
references/http-sse-guide.md(74 lines) - HTTP & Server-Sent Eventsreferences/websockets-guide.md(110 lines) - WebSocket integrationreferences/state-management.md(388 lines) - State management, scheduled tasks, workflowsreferences/mcp-integration.md(130 lines) - Model Context Protocol integration
Advanced Features
references/advanced-features.md(637 lines) - Browser automation, RAG, AI model integration, calling agents, client APIs
Error Reference
references/error-catalog.md(10 lines) - Common errors and solutions
Templates
templates/basic-agent.ts- Basic agent setuptemplates/browser-agent.ts- Browser automationtemplates/calling-agents-worker.ts- Calling other agentstemplates/chat-agent-streaming.ts- Streaming chat agenttemplates/hitl-agent.ts- Human-in-the-looptemplates/mcp-server-basic.ts- MCP server integrationtemplates/rag-agent.ts- RAG implementationtemplates/react-useagent-client.tsx- React client integrationtemplates/scheduled-agent.ts- Scheduled taskstemplates/state-sync-agent.ts- State synchronizationtemplates/websocket-agent.ts- WebSocket agenttemplates/workflow-agent.ts- Workflows integrationtemplates/wrangler-agents-config.jsonc- Wrangler configuration
Official Docs: https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-agents/
04 同仓库更多 Skills
three-best-practices
Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL.
javascript-best-practices
Modern JavaScript best practices and performance optimization guidelines. Use when writing, reviewing, or refactoring JavaScript code to ensure optimal performance, maintainability, and modern patterns.
css-best-practices
Guidelines for building modern, performant, and accessible CSS using MDN best practices. Use this when styling components, fixing layout shifts, or optimizing CSS performance.
frontend-dev
Full-stack frontend development combining premium UI design, cinematic animations, AI-generated media assets, persuasive copywriting, and visual art. Builds complete, visually striking web pages with real media, advanced motion, and compelling copy. Use when: building landing pages, marketing sites, product pages, dashboards, generating media assets (image/video/audio/music), writing conversion copy, creating generative art, or implementing cinematic scroll animations.
exa-rate-limits
Implement Exa rate limiting, backoff, and idempotency patterns. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for Exa. Trigger with phrases like "exa rate limit", "exa throttling", "exa 429", "exa retry", "exa backoff".
exa-deploy-integration
Deploy Exa integrations to Vercel, Fly.io, and Cloud Run platforms. Use when deploying Exa-powered applications to production, configuring platform-specific secrets, or setting up deployment pipelines. Trigger with phrases like "deploy exa", "exa Vercel", "exa production deploy", "exa Cloud Run", "exa Fly.io".