building-mcp-server-on-cloudflare — Cloudflare Workers integration official, Cloudflare Workers integration, ide skills, MCP SDK deployment, Cloudflare server management, MCP spec protocol, Workers documentation retrieval

Verified
v1.0.0

About this Skill

Ideal for Cloudflare-focused AI Agents seeking to integrate Model Context Protocol (MCP) for advanced server management and deployment. building-mcp-server-on-cloudflare is a technical skill for setting up MCP servers on Cloudflare using the MCP SDK and Cloudflare Workers integration.

Features

Retrieves MCP server setup and deployment information from MCP docs
Utilizes Cloudflare Workers for MCP server integration
References MCP spec for protocol definitions and tool/resource information
Supports retrieval of Workers documentation for further customization

# Core Topics

cloudflare cloudflare
[711]
[80]
Updated: 3/26/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reviewed Landing Page Review Score: 11/11

Killer-Skills keeps this page indexable because it adds recommendation, limitations, and review signals beyond the upstream repository text.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review Locale and body language aligned
Review Score
11/11
Quality Score
92
Canonical Locale
en
Detected Body Locale
en

Ideal for Cloudflare-focused AI Agents seeking to integrate Model Context Protocol (MCP) for advanced server management and deployment. building-mcp-server-on-cloudflare is a technical skill for setting up MCP servers on Cloudflare using the MCP SDK and Cloudflare Workers integration.

Core Value

Empowers agents to leverage Cloudflare Workers for MCP server setup, authentication, and deployment, utilizing the MCP SDK and Model Context Protocol specifications for seamless integration and preferential retrieval over pre-training for optimized performance.

Ideal Agent Persona

Ideal for Cloudflare-focused AI Agents seeking to integrate Model Context Protocol (MCP) for advanced server management and deployment.

Capabilities Granted for building-mcp-server-on-cloudflare

Deploying MCP servers on Cloudflare for scalable and secure applications
Configuring authentication and authorization for MCP servers using Cloudflare Workers
Optimizing MCP server performance through retrieval-based task management

! Prerequisites & Limits

  • Requires knowledge of MCP SDK and Cloudflare Workers integration
  • Needs access to Cloudflare account and MCP documentation
  • Preferential retrieval over pre-training may require adjustments to existing workflows

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Curated Collection Review

Reviewed In Curated Collections

This section shows how Killer-Skills has already collected, reviewed, and maintained this skill inside first-party curated paths. For operators and crawlers alike, this is a stronger signal than treating the upstream README as the primary story.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is building-mcp-server-on-cloudflare?

Ideal for Cloudflare-focused AI Agents seeking to integrate Model Context Protocol (MCP) for advanced server management and deployment. building-mcp-server-on-cloudflare is a technical skill for setting up MCP servers on Cloudflare using the MCP SDK and Cloudflare Workers integration.

How do I install building-mcp-server-on-cloudflare?

Run the command: npx killer-skills add cloudflare/skills/building-mcp-server-on-cloudflare. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for building-mcp-server-on-cloudflare?

Key use cases include: Deploying MCP servers on Cloudflare for scalable and secure applications, Configuring authentication and authorization for MCP servers using Cloudflare Workers, Optimizing MCP server performance through retrieval-based task management.

Which IDEs are compatible with building-mcp-server-on-cloudflare?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for building-mcp-server-on-cloudflare?

Requires knowledge of MCP SDK and Cloudflare Workers integration. Needs access to Cloudflare account and MCP documentation. Preferential retrieval over pre-training may require adjustments to existing workflows.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add cloudflare/skills/building-mcp-server-on-cloudflare. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use building-mcp-server-on-cloudflare immediately in the current project.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

building-mcp-server-on-cloudflare

Install building-mcp-server-on-cloudflare, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before...

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Building MCP Servers on Cloudflare

Your knowledge of the MCP SDK and Cloudflare Workers integration may be outdated. Prefer retrieval over pre-training for any MCP server task.

Retrieval Sources

SourceHow to retrieveUse for
MCP docshttps://developers.cloudflare.com/agents/mcp/Server setup, auth, deployment
MCP spechttps://modelcontextprotocol.io/Protocol spec, tool/resource definitions
Workers docsSearch tool or https://developers.cloudflare.com/workers/Runtime APIs, bindings, config

When to Use

  • User wants to build a remote MCP server
  • User needs to expose tools via MCP
  • User asks about MCP authentication or OAuth
  • User wants to deploy MCP to Cloudflare Workers

Prerequisites

  • Cloudflare account with Workers enabled
  • Node.js 18+ and npm/pnpm/yarn
  • Wrangler CLI (npm install -g wrangler)

Quick Start

Option 1: Public Server (No Auth)

bash
1npm create cloudflare@latest -- my-mcp-server \ 2 --template=cloudflare/ai/demos/remote-mcp-authless 3cd my-mcp-server 4npm start

Server runs at http://localhost:8788/mcp

Option 2: Authenticated Server (OAuth)

bash
1npm create cloudflare@latest -- my-mcp-server \ 2 --template=cloudflare/ai/demos/remote-mcp-github-oauth 3cd my-mcp-server

Requires OAuth app setup. See references/oauth-setup.md.

Core Workflow

Step 1: Define Tools

Tools are functions MCP clients can call. Define them using server.tool():

typescript
1import { McpAgent } from "agents/mcp"; 2import { z } from "zod"; 3 4export class MyMCP extends McpAgent { 5 server = new Server({ name: "my-mcp", version: "1.0.0" }); 6 7 async init() { 8 // Simple tool with parameters 9 this.server.tool( 10 "add", 11 { a: z.number(), b: z.number() }, 12 async ({ a, b }) => ({ 13 content: [{ type: "text", text: String(a + b) }], 14 }) 15 ); 16 17 // Tool that calls external API 18 this.server.tool( 19 "get_weather", 20 { city: z.string() }, 21 async ({ city }) => { 22 const response = await fetch(`https://api.weather.com/${city}`); 23 const data = await response.json(); 24 return { 25 content: [{ type: "text", text: JSON.stringify(data) }], 26 }; 27 } 28 ); 29 } 30}

Step 2: Configure Entry Point

Public server (src/index.ts):

typescript
1import { MyMCP } from "./mcp"; 2 3export default { 4 fetch(request: Request, env: Env, ctx: ExecutionContext) { 5 const url = new URL(request.url); 6 if (url.pathname === "/mcp") { 7 return MyMCP.serveSSE("/mcp").fetch(request, env, ctx); 8 } 9 return new Response("MCP Server", { status: 200 }); 10 }, 11}; 12 13export { MyMCP };

Authenticated server — See references/oauth-setup.md.

Step 3: Test Locally

bash
1# Start server 2npm start 3 4# In another terminal, test with MCP Inspector 5npx @modelcontextprotocol/inspector@latest 6# Open http://localhost:5173, enter http://localhost:8788/mcp

Step 4: Deploy

bash
1npx wrangler deploy

Server accessible at https://[worker-name].[account].workers.dev/mcp

Step 5: Connect Clients

Claude Desktop (claude_desktop_config.json):

json
1{ 2 "mcpServers": { 3 "my-server": { 4 "command": "npx", 5 "args": ["mcp-remote", "https://my-mcp.workers.dev/mcp"] 6 } 7 } 8}

Restart Claude Desktop after updating config.

Tool Patterns

Return Types

typescript
1// Text response 2return { content: [{ type: "text", text: "result" }] }; 3 4// Multiple content items 5return { 6 content: [ 7 { type: "text", text: "Here's the data:" }, 8 { type: "text", text: JSON.stringify(data, null, 2) }, 9 ], 10};

Input Validation with Zod

typescript
1this.server.tool( 2 "create_user", 3 { 4 email: z.string().email(), 5 name: z.string().min(1).max(100), 6 role: z.enum(["admin", "user", "guest"]), 7 age: z.number().int().min(0).optional(), 8 }, 9 async (params) => { 10 // params are fully typed and validated 11 } 12);

Accessing Environment/Bindings

typescript
1export class MyMCP extends McpAgent<Env> { 2 async init() { 3 this.server.tool("query_db", { sql: z.string() }, async ({ sql }) => { 4 // Access D1 binding 5 const result = await this.env.DB.prepare(sql).all(); 6 return { content: [{ type: "text", text: JSON.stringify(result) }] }; 7 }); 8 } 9}

Authentication

For OAuth-protected servers, see references/oauth-setup.md.

Supported providers:

  • GitHub
  • Google
  • Auth0
  • Stytch
  • WorkOS
  • Any OAuth 2.0 compliant provider

Wrangler Configuration

Minimal wrangler.toml:

toml
1name = "my-mcp-server" 2main = "src/index.ts" 3compatibility_date = "2024-12-01" 4 5[durable_objects] 6bindings = [{ name = "MCP", class_name = "MyMCP" }] 7 8[[migrations]] 9tag = "v1" 10new_classes = ["MyMCP"]

With bindings (D1, KV, etc.):

toml
1[[d1_databases]] 2binding = "DB" 3database_name = "my-db" 4database_id = "xxx" 5 6[[kv_namespaces]] 7binding = "KV" 8id = "xxx"

Common Issues

"Tool not found" in Client

  1. Verify tool name matches exactly (case-sensitive)
  2. Ensure init() registers tools before connections
  3. Check server logs: wrangler tail

Connection Fails

  1. Confirm endpoint path is /mcp
  2. Check CORS if browser-based client
  3. Verify Worker is deployed: wrangler deployments list

OAuth Redirect Errors

  1. Callback URL must match OAuth app config exactly
  2. Check GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are set
  3. For local dev, use http://localhost:8788/callback

References

Related Skills

Looking for an alternative to building-mcp-server-on-cloudflare or another official skill for your workflow? Explore these related open-source skills.

View All

flags

Logo of facebook
facebook

Use when you need to check feature flag states, compare channels, or debug why a feature behaves differently across release channels.

244.2k
0
Developer

extract-errors

Logo of facebook
facebook

extract-errors is a React error handling skill that automates the process of extracting and assigning error codes, ensuring accurate and up-to-date error messages in React applications.

244.2k
0
Developer

fix

Logo of facebook
facebook

fix is a code optimization skill that automates formatting and linting using yarn prettier and linc.

244.2k
0
Developer

flow

Logo of facebook
facebook

Use when you need to run Flow type checking, or when seeing Flow type errors in React code.

244.2k
0
Developer