概要
What is Remote MCP Server on Cloudflare?
A template to deploy a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login via browser. It is intended for developers who want to run MCP tools remotely and connect them to clients like Claude Desktop or the MCP Inspector.
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. To deploy, create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add its ID to wrangler.jsonc, then run npm run deploy. Connect clients by pointing them to the /sse endpoint of the server (e.g., http://localhost:8787/sse locally or the workers.dev URL after deployment). For Claude Desktop, add an mcp-remote proxy entry in the config file pointing to the SSE URL.
Key features of Remote MCP Server on Cloudflare
- Serverless deployment on Cloudflare Workers
- OAuth login flow via browser
- SSE (Server‑Sent Events) transport for MCP
- Local development with hot‑reload
- Works with MCP Inspector and Claude Desktop
- CLI proxy (
mcp-remote) for client connections
Use cases of Remote MCP Server on Cloudflare
- Quickly prototype and deploy custom MCP tools
- Connect Claude Desktop to remote tools behind OAuth
- Demo an MCP server to collaborators without local setup
- Run computation (e.g., math tools) via a cloud worker
FAQ from Remote MCP Server on Cloudflare
What transport does the server use?
It uses SSE (Server‑Sent Events) as the MCP transport layer.
How do I connect Claude Desktop to the server?
Add an entry in Claude’s configuration file with command: "npx" and args: ["mcp-remote", "<sse-url>"] (e.g., http://localhost:8787/sse locally or the remote workers.dev/sse URL).
What dependencies are required to run the server?
You need Node.js, the repository cloned, and npm install. For deployment you also need the Cloudflare Wrangler CLI and a Cloudflare account.
How do I deploy the server to Cloudflare?
Run npx wrangler kv namespace create OAUTH_KV, add the returned KV namespace ID to wrangler.jsonc, then execute npm run deploy.
What can I do if the server doesn’t connect?
Try connecting directly with npx mcp-remote http://localhost:8787/sse on the command line. In rare cases, clear the auth cache with rm -rf ~/.mcp-auth.