Remote MCP Server on Cloudflare
@cahmetcan
Overview
What is Remote MCP Server on Cloudflare?
A starter template for deploying a remote Model Context Protocol (MCP) server on Cloudflare Workers with OAuth login. It provides a math tool example and supports SSE transport for connecting MCP clients like Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run locally with npx nx dev remote-mcp-server. Connect via MCP Inspector or Claude Desktop using SSE URL. Deploy with npm run deploy after creating an OAUTH_KV namespace.
Key features of Remote MCP Server on Cloudflare
- Deploy remote MCP servers on Cloudflare Workers
- Built‑in OAuth login flow
- Supports SSE transport for MCP clients
- Local development with mock authentication
- Example math tool (add) included
Use cases of Remote MCP Server on Cloudflare
- Running MCP tools accessible over the internet
- Building a remote AI tool server for Claude Desktop
- Experimenting with OAuth‑secured MCP endpoints
- Prototyping and deploying custom MCP tools on Cloudflare
FAQ from Remote MCP Server on Cloudflare
What is this server for?
It demonstrates how to run an MCP server remotely on Cloudflare Workers, complete with OAuth login, and connect clients like Claude Desktop.
What dependencies are required?
Local development needs Node.js and npm. Deployment requires a Cloudflare account, wrangler CLI, and a created OAUTH_KV namespace.
How does authentication work?
Locally it uses a mock user/password screen. Deployed, it uses OAuth login via Cloudflare Workers endpoints.
What transport does it use?
The server uses Server‑Sent Events (SSE) transport at the /sse endpoint.
Where can I find the source code?
The server is part of the cloudflare/ai repository on GitHub under remote-mcp-server.