cloudflare-mcp-server
Build MCP (Model Context Protocol) servers on Cloudflare Workers with tools, resources, and prompts.
- License 许可
- MIT
- 最近更新
- 2026-09-24
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- cloudflare-mcp-server
- license
- MIT
- description
- Build MCP (Model Context Protocol) servers on Cloudflare Workers with tools, resources, and prompts.
02 资源文件 25
- 参考文档references/authentication.md9.1 KB
- 参考文档references/common-issues.md6.8 KB
- 参考文档references/core-concepts.md1.6 KB
- 参考文档references/debugging-guide.md12.7 KB
- 参考文档references/error-catalog.md268 B
- 参考文档references/http-transport-fundamentals.md10.3 KB
- 参考文档references/oauth-providers.md4.6 KB
- 参考文档references/official-examples.md4.2 KB
- 参考文档references/production-deployment.md17.6 KB
- 参考文档references/quick-start-guide.md16.9 KB
- 参考文档references/stateful-servers.md5.0 KB
- 参考文档references/transport-comparison.md9.4 KB
- 参考文档references/transport.md2.6 KB
- 参考文档references/worker-basics.md7.0 KB
- 脚本templates/basic-mcp-server.ts6.4 KB
- 脚本templates/basic-mcp.ts257 B
- 参考文档templates/claude_desktop_config.json751 B
- 脚本templates/mcp-bearer-auth.ts16.0 KB
- 脚本templates/mcp-http-fundamentals.ts8.4 KB
- 脚本templates/mcp-oauth-proxy.ts9.1 KB
- 脚本templates/mcp-stateful-do.ts8.2 KB
- 脚本templates/mcp-with-d1.ts19.0 KB
- 脚本templates/mcp-with-workers-ai.ts11.0 KB
- 其他templates/wrangler-basic.jsonc923 B
- 其他templates/wrangler-oauth.jsonc2.1 KB
03 SKILL.md 正文
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 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/
04 同仓库更多 Skills
{TODO=lowercase-hyphen-case-name}
[TODO: Write comprehensive description in third-person. Start with "This skill provides..." or "This skill should be used when..."] [TODO: Add "Use when" scenarios - specific situations where Claude should use this skill] [TODO: Add keywords - technologies, use cases, error messages that should trigger this skill]
zustand-state-management
Zustand state management for React with TypeScript. Use for global state, Redux/Context API migration, localStorage persistence, slices pattern, devtools, Next.js SSR, or encountering hydration errors, TypeScript inference issues, persist middleware problems, infinite render loops.
zod
TypeScript-first schema validation and type inference. Use for validating API requests/responses, form data, env vars, configs, defining type-safe schemas with runtime validation, transforming data, generating JSON Schema for OpenAPI/AI, or encountering missing validation errors, type inference issues, validation error handling problems. Zero dependencies (2kb gzipped).
xss-prevention
XSS attack prevention with input sanitization, output encoding, Content Security Policy. Use for user-generated content, rich text editors, web application security, or encountering stored XSS, reflected XSS, DOM manipulation, script injection errors.
wordpress-plugin-core
WordPress plugin development with hooks, security, REST API, custom post types. Use for plugin creation, $wpdb queries, Settings API, or encountering SQL injection, XSS, CSRF, nonce errors.
woocommerce-dev-cycle
Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow in WooCommerce projects.