cloudflare-agents-mcp
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Guardrail for defaulting generic stateful services with tools to plain Worker plus Durable Object, and escalating to Agents SDK or remote MCP only when an explicit external interface or agent loop is required.
In this repository57 other files it gives its agents.
- ai-app-integrationSkill
- anti-llm-frontend-designSkill
- aspnet-core-web-developmentSkill
- async-python-patternsSkill
- browser-game-foundationsSkill
- browser-local-qaSkill
- build-mcp-server-sdk-v2Skill
- canva-design-opsSkill
- check-completionSkill
- cli-tool-creatorSkill
- cloudflare-durable-objectsSkill
- cloudflare-workers-platformSkill
- deployment-preview-workflowsSkill
- docx-document-artifactsSkill
- durable-workflow-orchestrationSkill
- dynamic-og-imagesSkill
- eval-auditSkill
- evaluate-ragSkill
- figma-design-to-code-rulesSkill
- fine-tuningSkill
- frontend-product-builderSkill
- game-asset-pipeline-expansionSkill
- game-ui-playtestSkill
- generate-synthetic-dataSkill
- github-pr-ci-opsSkill
- gmail-inbox-opsSkill
- golden-datasetSkill
- huggingface-llm-trainerSkill
- javascript-monorepo-buildsSkill
- linear-issue-managementSkill
- media-generation-transcriptionSkill
- millrace-rs-contract-paritySkill
- minecraft-mod-qa-automationSkill
- notion-workspace-flowsSkill
- openai-docsSkill
- optimize-agentic-cliSkill
- pdf-artifact-workflowSkill
- phaser-2d-game-developmentSkill
- postgres-query-performanceSkill
- product-ui-polish-reviewSkill
- pydantic-v2-patternsSkill
- python-repo-refactoring-hygieneSkill
- rag-corpus-hygieneSkill
- react-next-performance-reviewSkill
- rust-best-practicesSkill
- shadcn-ui-compositionSkill
- skill-evaluation-harnessSkill
- tauri-desktopSkill
- tauri-mcp-cliSkill
- tauri-ptySkill
- tile-pixel-art-transitionsSkill
- train-sentence-transformersSkill
- typer-cli-patternsSkill
- using-dbt-for-analytics-engineeringSkill
- validate-evaluatorSkill
- visual-asset-pipelineSkill
- watchdog-file-watcher-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 16 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
If the prompt only says stateful service or tool service, answer plain Worker or Durable Object first.
- Distinctive: line 47
Write the ownership map next: state, tools, auth, transport, deployment, verification.
- Distinctive: line 48
Check current Cloudflare docs before code whenever Agents SDK, MCP, or Workers APIs are involved.
- Distinctive: line 49
Prefer plain Worker or Durable Object when Agents SDK or MCP adds no value.
- Very specific: line 50
Call out McpAgent, routeAgentRequest, WebSocket handling, and scheduling only when they are actually part of the chosen seam.
- Distinctive: line 54
Do not let state live inside transport handlers.
- Distinctive: line 55
Do not hide OAuth or persistence inside tool code.
- Distinctive: line 56
Do not choose remote MCP because the task is "AI adjacent" or because tools are mentioned.
- Distinctive: line 57
Do not choose Agents SDK for a simple request/response service.
- Very specific: line 58
Do not choose hybrid just because the service is stateful and could also expose MCP.
- Distinctive: line 59
Do not rely on memory for Agents SDK, MCP, or Workers API names when current docs are available.
- Distinctive: line 60
Do not turn this into a full Cloudflare course.
- Distinctive: line 74
Keep the answer at planning level unless implementation is explicitly requested.
- Very specific: line 77
Read the request and classify it as plain Worker, Durable Object, Agents SDK agent, remote MCP server, or hybrid.
- Distinctive: line 79
Check current Cloudflare docs for every Agents SDK, MCP, or Workers API involved.
- Distinctive: line 80
Prefer plain Worker or Durable Object unless the request truly needs agent or MCP surface behavior.
- Distinctive: line 81
Use Agents SDK when stateful agent behavior, callable methods, or WebSockets are central.
- Distinctive: line 82
Use remote MCP when the main surface is tool exposure over MCP and the host app is not the real boundary.
- Distinctive: line 84
Verify the selected seam with the smallest proof step that matches the boundary.
- Distinctive: line 103
Start with the smallest useful decision: surface class, ownership map, and docs check.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare Agents MCP
Purpose
Help agents choose the smallest honest Cloudflare surface for a request that may involve Workers, Durable Objects, Agents SDK, or remote MCP. Generic stateful or tool-service prompts start as plain Worker plus Durable Object ownership. Remote MCP, McpAgent, and Agents SDK are conditional, not default. Treat tool service as a capability label, not a transport decision. Then make state, tools, auth, transport, deployment, and verification ownership explicit before any code is written. This is a guardrail, not a Cloudflare manual.
Use When
- the task needs a decision between a plain Worker, Durable Object, Agents SDK agent, remote MCP server, or hybrid
- the request touches stateful agents, callable methods, WebSockets, scheduled tasks, MCP tools, OAuth, or deployment boundaries
- the current code mixes state, transport, tools, and auth
- the answer depends on current Cloudflare docs or recent SDK or API behavior
Do Not Use When
- the work is generic Workers, backend, or frontend plumbing with no agent or MCP boundary question
- deployment ops, account setup, or launch logistics are the only problem
- the request is only about prompt writing or generic architecture advice
- another more specific skill already owns the surface
Quick Start
- Classify the request first as
plain Worker,Durable Object,Agents SDK agent,remote MCP server, orhybrid. - If the prompt only says
stateful serviceortool service, answerplain WorkerorDurable Objectfirst. That wording alone does not justifyremote MCP server,McpAgent, or an Agents SDK surface. - Choose
plain Workerwhen request/response is enough and no shared mutable state matters. - Choose
Durable Objectwhen per-key state, coordination, idempotency, or session continuity is the real need. - Choose
Agents SDK agentonly when first-class agent behavior, callable methods, or WebSockets are central. - Choose
remote MCP serveronly when the prompt explicitly requires an external MCP-facing tool surface or host-independent client boundary. - Choose
hybridonly when two distinct surfaces are explicitly required; do not use it to cover uncertainty. - Write the ownership map next: state, tools, auth, transport, deployment, verification.
- Check current Cloudflare docs before code whenever Agents SDK, MCP, or Workers APIs are involved.
- Prefer plain Worker or Durable Object when Agents SDK or MCP adds no value.
- Call out
McpAgent,routeAgentRequest, WebSocket handling, and scheduling only when they are actually part of the chosen seam. - End with the next verifier and the evidence it should capture.
Operating Constraints
- Do not let state live inside transport handlers.
- Do not hide OAuth or persistence inside tool code.
- Do not choose remote MCP because the task is "AI adjacent" or because tools are mentioned.
- Do not choose Agents SDK for a simple request/response service.
- Do not choose
hybridjust because the service is stateful and could also expose MCP. - Do not rely on memory for Agents SDK, MCP, or Workers API names when current docs are available.
- Do not turn this into a full Cloudflare course.
Inputs This Skill Expects
- the request goal and target surface
- whether state, tools, auth, WebSockets, scheduling, or MCP exposure matter
- current route, server, agent, or worker files if any exist
- current official docs for the APIs in scope
- any deployment or verification constraints already known
Output Contract
- Name the architecture classification first.
- State ownership for state, tools, auth, transport, deployment, and verification separately.
- State which current docs must be checked before code.
- Recommend the smallest viable starting point and what not to build.
- Keep the answer at planning level unless implementation is explicitly requested.
Procedure
- Read the request and classify it as
plain Worker,Durable Object,Agents SDK agent,remote MCP server, orhybrid. - Draw the ownership map before choosing code shape.
- Check current Cloudflare docs for every Agents SDK, MCP, or Workers API involved.
- Prefer plain Worker or Durable Object unless the request truly needs agent or MCP surface behavior.
- Use Agents SDK when stateful agent behavior, callable methods, or WebSockets are central.
- Use remote MCP when the main surface is tool exposure over MCP and the host app is not the real boundary.
- Call out
McpAgent,routeAgentRequest, WebSocket handling, and scheduling only when they are actually part of the chosen seam. - Verify the selected seam with the smallest proof step that matches the boundary.
Pitfalls And Gotchas
- Rejected trope: wire state straight into transport handlers and hope the boundary stays clean.
- Better alternative: keep state, tools, auth, transport, deployment, and verification owned by separate seams.
- Rejected trope: use Agents SDK for a simple request/response Worker.
- Better alternative: stay plain Worker or Durable Object when agent semantics add no value.
- Rejected trope: use remote MCP because the feature is "AI adjacent."
- Better alternative: choose remote MCP only when tool exposure over MCP is the actual interface.
- Rejected trope: let
tool servicealone choose remote MCP server,McpAgent, or an Agents SDK surface. - Better alternative: require an explicit external MCP interface, host-independent tool exposure, or first-class agent behavior first.
- Rejected trope: call it
hybridjust because the service is stateful and could also expose MCP. - Better alternative: choose
hybridonly when two distinct surfaces are clearly required. - Rejected trope: follow old examples from memory.
- Better alternative: check current Cloudflare docs before writing code.
- Rejected trope: turn this skill into a full Cloudflare manual.
- Better alternative: keep it as a narrow architecture guardrail.
Progressive Disclosure
Start with the smallest useful decision: surface class, ownership map, and docs check. Expand only enough to choose cleanly between plain Worker, Durable Object, Agents SDK agent, remote MCP server, or hybrid. Keep the skill short so it steers implementation instead of becoming a manual.
Verification Pattern
- Confirm the classification is explicit.
- Confirm state, tools, auth, transport, deployment, and verification are named separately.
- Confirm a docs-first check is named before code.
- Confirm the answer does not collapse into a generic Cloudflare essay.
- Next verifier: implementation reviewer or checker; capture the docs consulted, the selected architecture, and one concrete proof step.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

