mcpField
C
cloudflare-mcp-server

cloudflare-mcp-server

github.com/secondskyDevelopment240381 installsUpdated 5w ago
Repository

About cloudflare-mcp-server

A reference and template collection for developers building MCP servers on Cloudflare Workers. It covers MCP concepts, transports, and stateful service deployment.

Key features

  1. 01MCP core concepts
  2. 02Examples of tools, resources, and prompts
  3. 03SSE, HTTP, and WebSocket transports
  4. 04Workers and Durable Objects templates
  5. 05Deployment, testing, and error references

Use cases

  1. 01Set up a basic MCP server
  2. 02Choose a transport for a Workers service
  3. 03Build a stateful service with Durable Objects

MCP support

This skill guides the construction of MCP servers that expose tools, resources, and prompts to MCP clients. It covers SSE, HTTP, and WebSocket transports.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-mcp-server

After installing, type/cloudflare-mcp-serverin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
authentication.md
common-issues.md
core-concepts.md
debugging-guide.md
error-catalog.md
http-transport-fundamentals.md
oauth-providers.md
official-examples.md
production-deployment.md
quick-start-guide.md
stateful-servers.md
transport-comparison.md
transport.md
worker-basics.md
templates/
basic-mcp-server.ts
basic-mcp.ts
claude_desktop_config.json
mcp-bearer-auth.ts
mcp-http-fundamentals.ts
mcp-oauth-proxy.ts
mcp-stateful-do.ts
mcp-with-d1.ts
mcp-with-workers-ai.ts
package.json
wrangler-basic.jsonc
wrangler-oauth.jsonc

Details

From the project README

Cloudflare MCP Server

Last Updated: 2025-11-21

Quick Start

import { McpServer } from '@modelcontextprotocol/sdk';

const server = new McpServer({
  name: 'my-server',
  version: '1.0.0'
});

server.tool('getTodo', async ({ id }) => ({
  id,
  title: 'Task',
  completed: false
}));

export default server;

Core Concepts

  • Tools: Functions AI can call
  • Resources: Data AI can access
  • Prompts: Reusable templates
  • Transports: SSE, HTTP, WebSocket

Example Tool

server.tool('searchDocs', {
  description: 'Search documentation',
  parameters: {
    type: 'object',
    properties: {
      query: { type: 'string' }
    }
  },
  handler: async ({ query }) => {
    return { results: [...] };
  }
});

Resources

Core Documentation
  • references/quick-start-guide.md (704 lines) - Official Cloudflare templates, complete step-by-step workflow, 5-minute setup
  • references/core-concepts.md (66 lines) - MCP fundamentals: tools, resources, prompts, transports
  • references/worker-basics.md (326 lines) - Worker & Durable Objects basics, transport selection, HTTP fundamentals
  • references/stateful-servers.md (246 lines) - Durable Objects integration, WebSocket hibernation, cost optimization, common patterns
  • references/production-deployment.md (814 lines) - Deployment & testing, configuration reference, authentication patterns, 22 known errors with solutions
Templates
  • templates/basic-mcp.ts - Minimal MCP server
  • templates/tools-example.ts - Tool definitions
  • templates/durable-object-mcp.ts - Stateful MCP with DO
  • templates/websocket-mcp.ts - WebSocket transport

Official Docs: https://modelcontextprotocol.io | Cloudflare: https://developers.cloudflare.com/workers/runtime-apis/durable-objects/

Comments

Markdown supported