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
- 01MCP core concepts
- 02Examples of tools, resources, and prompts
- 03SSE, HTTP, and WebSocket transports
- 04Workers and Durable Objects templates
- 05Deployment, testing, and error references
Use cases
- 01Set up a basic MCP server
- 02Choose a transport for a Workers service
- 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-serverAfter installing, type/cloudflare-mcp-serverin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/authentication.mdcommon-issues.mdcore-concepts.mddebugging-guide.mderror-catalog.mdhttp-transport-fundamentals.mdoauth-providers.mdofficial-examples.mdproduction-deployment.mdquick-start-guide.mdstateful-servers.mdtransport-comparison.mdtransport.mdworker-basics.mdtemplates/basic-mcp-server.tsbasic-mcp.tsclaude_desktop_config.jsonmcp-bearer-auth.tsmcp-http-fundamentals.tsmcp-oauth-proxy.tsmcp-stateful-do.tsmcp-with-d1.tsmcp-with-workers-ai.tspackage.jsonwrangler-basic.jsoncwrangler-oauth.jsoncDetails
From the project READMECloudflare 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 setupreferences/core-concepts.md(66 lines) - MCP fundamentals: tools, resources, prompts, transportsreferences/worker-basics.md(326 lines) - Worker & Durable Objects basics, transport selection, HTTP fundamentalsreferences/stateful-servers.md(246 lines) - Durable Objects integration, WebSocket hibernation, cost optimization, common patternsreferences/production-deployment.md(814 lines) - Deployment & testing, configuration reference, authentication patterns, 22 known errors with solutions
Templates
templates/basic-mcp.ts- Minimal MCP servertemplates/tools-example.ts- Tool definitionstemplates/durable-object-mcp.ts- Stateful MCP with DOtemplates/websocket-mcp.ts- WebSocket transport
Official Docs: https://modelcontextprotocol.io | Cloudflare: https://developers.cloudflare.com/workers/runtime-apis/durable-objects/
Comments
Markdown supported