building-mcp-server-on-cloudflare

Generate and deploy MCP servers with OAuth authentication on Cloudflare Workers using Node.js 18+ and Wrangler.

2.6k|242|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/cloudflare/skills --skill building-mcp-server-on-cloudflare-cloudflare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-mcp-server-on-cloudflare
Source: https://github.com/cloudflare/skills/tree/main/skills/building-mcp-server-on-cloudflare
Command: npx skills add https://github.com/cloudflare/skills --skill building-mcp-server-on-cloudflare-cloudflare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Builds remote MCP (Model Context Protocol) servers on Cloudflare Workers with tools, OAuth authentication, and production deployment. Generates server code, configures auth providers, and deploys to Workers.

Core Features & Use Cases

  • Automated server scaffolding: Generate boilerplate for an MCP server with OAuth integration and deployment templates.
  • Secure authentication setup: Configure OAuth providers and secure callback handling for MCP access.
  • Use Case: Imagine you want to expose MCP tools and deploy a production-ready server to Cloudflare Workers in minutes.

Quick Start

Run the starter commands to bootstrap a new MCP server:

  • npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
  • cd my-mcp-server
  • npm start

Frequently Asked Questions about building-mcp-server-on-cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a remote MCP server on Cloudflare Workers?

To deploy a remote MCP server on Cloudflare Workers, run the provided npm create cloudflare command to scaffold the project, then configure your OAuth providers and deploy using Wrangler. The Skill generates boilerplate code and deployment templates for production-ready MCP access.

What is needed to set up OAuth authentication for an MCP server?

Setting up OAuth authentication for an MCP server requires configuring OAuth providers and secure callback handling. This Skill automates secure auth setup to protect MCP tooling access on Cloudflare Workers.

Do I need Node.js and Wrangler to build MCP servers on Cloudflare?

Yes, building MCP servers on Cloudflare requires Node.js 18+ and Wrangler. You also need a Cloudflare Workers environment configured for deployment and an OAuth provider setup to manage secure access.

Can I scaffold a production-ready MCP server without writing boilerplate code?

Yes, you can scaffold a production-ready MCP server without writing boilerplate by running the npm create cloudflare starter command. It generates server code with OAuth integration and deployment templates automatically.

What is the best way to expose MCP tools on a Cloudflare environment?

The best way to expose MCP tools on a Cloudflare environment is building remote MCP servers on Cloudflare Workers. This approach handles OAuth authentication and production deployment natively.

Does this MCP server template support authless deployment?

Yes, the MCP server template supports authless deployment. The quick start command uses the cloudflare/ai/demos/remote-mcp-authless template to bootstrap an MCP server without authentication requirements.