Cloudflare MCP Server — Code Mode
Cloudflare MCP Server — 代码模式
无服务器入门模板,用于在 Cloudflare Workers 上构建远程 Model Context Protocol (MCP) 服务器。
该项目专为 代码模式 设计:客户端可以发现能力,并根据结构化响应组合工具调用。入门模板中不启用任意代码执行;只有在定义了沙箱、身份验证、限制和审计之后,才应添加该能力。
目标
通过 Cloudflare Workers 在边缘运行。
在
/mcp暴露一个 MCP 端点。保持工具小巧、类型化且可组合。
准备 OAuth 身份验证和 Cloudflare 绑定。
后续在隔离沙箱中实现安全的代码执行。
Related MCP server: Adi MCP
本地开发
先决条件:Node.js 18+ 以及一个启用了 Workers 的 Cloudflare 账户。
npm install
npm run dev本地服务器在 http://localhost:8788/mcp 运行。
使用 MCP Inspector 验证:
npx @modelcontextprotocol/inspector@latest部署
npx wrangler login
npm run deploy部署完成后,端点将是:
https://<worker>.<account>.workers.dev/mcp结构
src/index.ts:Worker 的 HTTP 路由。src/mcp.ts:MCP 服务器和工具。wrangler.jsonc:Worker 的配置。PLAN.md:实现计划和验收标准。
安全
不要直接在 Worker 中添加 eval、new Function 或代码解释器。对于真正执行代码的代码模式,请使用合适的沙箱、强身份验证、API 允许列表、CPU/内存/时间限制、用户级隔离,以及不含敏感信息的日志。
后续步骤
参见 PLAN.md。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceA remote MCP server deployed on Cloudflare Workers without authentication, enabling tool creation and integration with MCP clients like Claude Desktop and Cloudflare AI Playground.
- FlicenseNot gradedqualityBmaintenanceA remote MCP server that exposes tools from many services (X, LinkedIn, GitHub, Gmail, Notion, etc.) through a single endpoint on Cloudflare Workers, enabling unified access to third-party APIs via natural language.
- FlicenseNot gradedqualityCmaintenanceDeploy a stateless remote MCP server on Cloudflare Workers without authentication, enabling tool calls via MCP protocol.
- FlicenseNot gradedqualityCmaintenanceA stateless remote MCP server on Cloudflare Workers without authentication, supporting custom tool registration and integration with MCP clients like Cloudflare AI Playground and Claude Desktop.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Remote MCP for GenAI span mapping, provider normalization, dashboard schemas, and receipts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/romeucampos/cloudflare-mcp-server-code-mode'
If you have feedback or need assistance with the MCP directory API, please join our Discord server