Remote MCP Server on Cloudflare
@danXyu
Overview
What is Remote MCP Server on Cloudflare?
Remote MCP Server on Cloudflare is a template to deploy a remote Model Context Protocol (MCP) server on Cloudflare Workers with OAuth login. It is intended for developers who want to expose MCP tools over the internet and connect them to clients like Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with npm install, and run locally with npx nx dev remote-mcp-server. Deploy to Cloudflare by creating an OAuth KV namespace with npx wrangler kv namespace create OAUTH_KV, adding the ID to wrangler.jsonc, then running npm run deploy. Connect clients like the MCP Inspector or Claude Desktop via SSE at the server’s /sse endpoint.
Key features of Remote MCP Server on Cloudflare
- Runs on Cloudflare Workers with OAuth authentication
- Supports SSE transport for remote MCP clients
- Includes local development with mock login
- Integrates with Claude Desktop via a local proxy
- Provides a workflow to deploy and connect remotely
Use cases of Remote MCP Server on Cloudflare
- Expose a custom MCP tool suite to Claude Desktop over the internet
- Develop and test MCP tools locally before deploying globally
- Remotely call AI‑powered functions from any MCP‑compatible client
FAQ from Remote MCP Server on Cloudflare
What transport does Remote MCP Server on Cloudflare use?
The server communicates via Server‑Sent Events (SSE) on the /sse endpoint.
What runtime or dependencies are required?
The server runs on Cloudflare Workers. Local development requires Node.js and npm. Deployment uses Wrangler and an OAuth KV namespace.
How does authentication work?
The server implements OAuth login. During local development a mock login screen accepts any email and password; in production the Cloudflare Worker handles the OAuth flow.
How do I connect Claude Desktop to a deployed instance?
Configure Claude Desktop’s mcpServers JSON to point to your workers.dev URL with npx mcp-remote as the command, e.g. https://worker-name.account-name.workers.dev/sse.
Where does data (e.g. OAuth tokens) live?
OAuth data is stored in a Cloudflare KV namespace created during deployment.