api-workers

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

A deployment guide for running MCP servers as Cloudflare Workers, Cloudflare’s serverless code platform. It explains how to connect tools, resources, prompts, and environment bindings to the Worker entry point.

In plain words
What is it for?
Use it to deploy an MCP server on Cloudflare Workers and configure secrets, object bindings, and scheduled jobs.
Why use it?
It helps avoid mistakes in the Worker handler, runtime compatibility checks, and Wrangler configuration.

Skill for Claude Code

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

Part of the obsidian-mcp-server plugin — 32 skills, 1 MCP server shipped together

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.

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

Made for: Claude Code.

Or install obsidian-mcp-server, the plugin that ships this one along with the rest of its 32 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/obsidian-mcp-server/api-workers.svg)](https://agentmods.dev/skills/cyanheads/obsidian-mcp-server/api-workers)
Your own site
<a href="https://agentmods.dev/skills/cyanheads/obsidian-mcp-server/api-workers"><img src="https://agentmods.dev/badge/skills/cyanheads/obsidian-mcp-server/api-workers.svg" alt="Measured on agentmods" 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,537 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found 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.03537
Opus 5 $0.00026 $0.01768
Sonnet 5 $0.00010 $0.00707
Haiku 4.5 $0.00005 $0.00354

Measured 6d ago against content hash 7979fbfdc182, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 6d 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

Copies of this mod

8 near-identical copies found in the catalogue:

skills/api-workers/SKILL.md · 318 lines

How it starts

The opening of the file, as written. The whole thing — 318 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 · 318 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. 6d 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/obsidian-mcp-server (673 stars, last pushed yesterday), licensed Apache-2.0. It adds 51 tokens to every session and 3,537 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

knowledge-base-management

Obsidian 知识库全生命周期管理:三层架构、素材入库(ABC分级)、健康检查、GBrain/GraphRAG/LLM Wiki 三件套集成、目录整理.

chubbyguan/chubbyskills · 49 tokens

deno-knowledge-patch

Use this skill when choosing current Deno runtime APIs, CLI options, configuration, dependency behavior, Node compatibility, or deployment workflows. Open the topic reference before changing a project because several commands, flags, APIs, and defaults changed more than once.

Nevaberry/nevaberry-plugins · 9 tokens

aws-cdk-knowledge-patch

Load this skill when changing, reviewing, debugging, or upgrading AWS CDK applications, construct libraries, CLI integrations, or synthesized CloudFormation templates.

Nevaberry/nevaberry-plugins · 11 tokens

aws-sdk-knowledge-patch

Use this skill when upgrading an AWS SDK or CLI, changing a supported runtime, configuring shared SDK behavior, or implementing one of the service APIs in the reference index. Identify the language, SDK major version, runtime, service, and deployment environment before applying the guidance.

Nevaberry/nevaberry-plugins · 9 tokens

azure-knowledge-patch

Use this skill for Azure infrastructure, Azure CLI, Azure PowerShell, Terraform AzureRM or AzAPI, Bicep, identity SDK, Microsoft Entra, networking, compute, containers, data services, storage, Key Vault, governance, and service lifecycle work.

Nevaberry/nevaberry-plugins · 8 tokens

chrony-knowledge-patch

Skill "chrony-knowledge-patch" from Nevaberry/nevaberry-plugins, covering chrony 4.7–4.8 knowledge patch, reference index, using this patch, breaking changes and upgrade checks and configuration and build compatibility.

Nevaberry/nevaberry-plugins · 9 tokens