cloudflare-agents
Original:🇺🇸 English
Translated
11 scripts
Build AI agents on Cloudflare Workers with MCP integration, tool use, and LLM providers.
2installs
Sourcesecondsky/claude-skills
Added on
NPX Install
npx skill4agent add secondsky/claude-skills cloudflare-agentsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Cloudflare Agents
Last Updated: 2025-11-21
Quick Start
typescript
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
typescript
const agent = {
tools: [...],
systemPrompt: 'You are a helpful assistant',
model: 'gpt-4o',
async run(input) {
// Process with LLM
}
};Resources
Core Documentation
- (317 lines) - What is Cloudflare Agents, patterns & concepts, critical rules, known issues prevention
references/patterns-concepts.md - (152 lines) - Complete configuration deep dive
references/configuration-guide.md - (115 lines) - Complete Agent Class API reference
references/agent-api.md
Integration Guides
- (74 lines) - HTTP & Server-Sent Events
references/http-sse-guide.md - (110 lines) - WebSocket integration
references/websockets-guide.md - (388 lines) - State management, scheduled tasks, workflows
references/state-management.md - (130 lines) - Model Context Protocol integration
references/mcp-integration.md
Advanced Features
- (637 lines) - Browser automation, RAG, AI model integration, calling agents, client APIs
references/advanced-features.md
Error Reference
- (10 lines) - Common errors and solutions
references/error-catalog.md
Templates
- - Basic agent setup
templates/basic-agent.ts - - Browser automation
templates/browser-agent.ts - - Calling other agents
templates/calling-agents-worker.ts - - Streaming chat agent
templates/chat-agent-streaming.ts - - Human-in-the-loop
templates/hitl-agent.ts - - MCP server integration
templates/mcp-server-basic.ts - - RAG implementation
templates/rag-agent.ts - - React client integration
templates/react-useagent-client.tsx - - Scheduled tasks
templates/scheduled-agent.ts - - State synchronization
templates/state-sync-agent.ts - - WebSocket agent
templates/websocket-agent.ts - - Workflows integration
templates/workflow-agent.ts - - Wrangler configuration
templates/wrangler-agents-config.jsonc