api-workers

api-workers is a skill for Claude Code from cyanheads/openfda-mcp-server. It costs 51 tokens per session (3,756 once invoked), scanned A, a copy of api-workers, Apache-2.0.

A guide for deploying an MCP server as a Cloudflare Worker. Cloudflare Workers are programs that run on Cloudflare's network, and MCP is a standard connection between an AI agent and tools.

In plain words
What is it for?
Use it when building or deploying a Cloudflare-hosted MCP server with the cyanheads framework. It covers the handler shape, binding types, runtime checks, and wrangler configuration.
Why use it?
It shows how to connect tools, resources, prompts, services, environment variables, storage bindings, and scheduled jobs to the Worker entry point. This avoids guessing the required handler and deployment settings.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openfda-mcp-server plugin — 33 skills, 1 MCP server shipped together

Good fit Use it when building or deploying a Cloudflare-hosted MCP server with the cyanheads framework. It covers the handler shape, binding types, runtime checks, and wrangler configuration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cyanheads/openfda-mcp-server/api-workers
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cyanheads/openfda-mcp-server --skill api-workers
Clone the repo
git clone --depth 1 https://github.com/cyanheads/openfda-mcp-server

Made for: Claude Code.

Or install openfda-mcp-server, the plugin that ships this one along with the rest of its 33 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-workers

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyanheads/openfda-mcp-server/api-workers/github.svg)](https://agentmods.dev/skills/cyanheads/openfda-mcp-server/api-workers)
Your own site
<a href="https://agentmods.dev/skills/cyanheads/openfda-mcp-server/api-workers"><img src="https://agentmods.dev/badge/skills/cyanheads/openfda-mcp-server/api-workers/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-workers

Your own site · 80×15
<a href="https://agentmods.dev/skills/cyanheads/openfda-mcp-server/api-workers"><img src="https://agentmods.dev/badge/skills/cyanheads/openfda-mcp-server/api-workers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,756 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.03756
Opus 5.5 $0.00020 $0.01502
Sonnet 5.5 $0.00010 $0.00751
Haiku 4.5 $0.00005 $0.00376

Measured 17d ago against content hash 95c2a56eac37, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-workers scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

await worker.fetch(request, r2Env, ctx);
Origin

This is a copy

100% identical to api-workers — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

framework-skills/api-workers/SKILL.md · 320 lines

How it starts

The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Overview

@cyanheads/mcp-ts-core/worker exports createWorkerHandler — the Workers entry point. It wraps tool/resource/prompt registries into a per-request McpServer factory that integrates with the Cloudflare Workers runtime.


createWorkerHandler(options)

import { createWorkerHandler } from '@cyanheads/mcp-ts-core/worker';
import { echoTool } from './mcp-server/tools/definitions/echo.tool.js';
import { echoResource } from './mcp-server/resources/definitions/echo.resource.js';
import { echoPrompt } from './mcp-server/prompts/definitions/echo.prompt.js';
import { initMyService } from './services/my-domain/my-service.js';

export default createWorkerHandler({
  tools: [echoTool],
  resources: [echoResource],
  prompts: [echoPrompt],
  setup(core) {
    initMyService(core.config, core.storage);
  },
  extraEnvBindings: [['MY_API_KEY', 'MY_API_KEY']],
  extraObjectBindings: [['MY_CUSTOM_KV', 'MY_CUSTOM_KV']],
  onScheduled: async (controller, env, ctx) => {
    // Cloudflare cron trigger handler
  },
});

Fresh scaffolds register definitions directly in the entry point as shown above. If your project later adds barrel files for definitions, importing arrays from those barrels is also fine.

Options

Option Type Purpose
tools AnyToolDefinition[] Tool definitions to register
resources AnyResourceDefinition[] Resource definitions to register
prompts PromptDefinition[] Prompt definitions to register
extensions Record<string, object> SEP-2133 extensions to advertise in server capabilities
instructions string | (env: CloudflareBindings) => string Server-level orientation forwarded to the model on every initialize. Resolver form runs inside initializeApp(env) so env-derived text is available (see Workers-specific warnings). Empty string treated as unset.
setup (core: CoreServices) => void | Promise<void> Runs after core services are ready, during the first request (lazy init inside the fetch handler)
extraEnvBindings [bindingKey: string, processEnvKey: string][] Maps CF string bindings to process.env keys
extraObjectBindings [bindingKey: string, globalKey: string][] Maps CF object bindings (KV, R2, D1, AI) to globalThis keys
onScheduled (controller, env, ctx) => Promise<void> Cloudflare cron trigger handler

Read the full file on GitHub · 320 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 17d ago Changed · +2 lines 95c2a56eac37
  2. 1mo ago Changed 1690600e0552
  3. 1mo ago First seen · 318 lines · 51 tokens per session scan A 7979fbfdc182

Subscribe to this mod's changes

api-workers is a skill published in the GitHub repository cyanheads/openfda-mcp-server (4 stars, last pushed 3d ago), licensed Apache-2.0. It adds 51 tokens to every session and 3,756 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to api-workers, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

cdn-fallback

Put a 3x-ui inbound behind a CDN (WebSocket, gRPC or xhttp through Cloudflare) or share port 443 between several inbounds using Xray fallbacks. Use when REALITY is blocked or unsuitable, when the server IP must stay hidden behind a CDN, when a real domain and certificate are in play, or when several protocols need to…

pyworkload/3x-ui-mcp · 83 tokens

multi-node

Attach, secure and operate additional 3x-ui panels as nodes of a master panel — probe before saving, choose a TLS trust mode (verify/skip/pin/mTLS), select which inbounds sync, and monitor health and per-node traffic. Use when asked to add a server to a cluster, set up mTLS between panels, work out which node is…

pyworkload/3x-ui-mcp · 87 tokens

chainstack

Work with the Chainstack MCP server to manage blockchain nodes and projects. Use when deploying nodes, restricting node access with IP or origin allowlists, migrating to Chainstack from another RPC provider such as QuickNode or Alchemy, checking platform status, searching Chainstack docs, contacting the Chainstack…

chainstacklabs/mcp-server · 76 tokens

deployment-completeness-audit

Read-only audit of changes that were built but not wired, deployed or exercised. Trace the target project's actual release path, runtime, migrations and adapters; report evidence and missing access honestly.

getpapi/papi · 44 tokens

publish-release

Releases a new McpOrchestrator version end to end — version bump PR, tag, and the automated deploy to GitHub Releases, NuGet, and the MCP Registry. Use when asked to release, publish, deploy, ship, or bump the version of McpOrchestrator.

Byggarepop/dotnet-mcp-orchestrator · 63 tokens

media-gc

Audit and safely remove stale, uncommitted media uploads from a Mantle 0.2 Cloudflare R2 bucket. Use when an operator asks to inspect or clean objects left under uploads/ by an upload that was created but never committed.

aotter/mantle · 53 tokens