Remote MCP Server on Cloudflare
@pathikpa
Overview
What is Remote MCP Server on Cloudflare?
This repository provides a template to quickly deploy a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to host an MCP server accessible from remote clients like the MCP Inspector or Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with pnpm install, and run locally via npx nx dev remote-mcp-server. For production, deploy using npx wrangler kv namespace create OAUTH_KV and npm run deploy. Connect clients by specifying the SSE endpoint (e.g., http://localhost:8787/sse locally or your workers.dev URL). Configure Claude Desktop by adding an mcpServers entry with "command": "npx", "args": ["mcp-remote", "<URL>/sse"].
Key features of Remote MCP Server on Cloudflare
- Deploy a remote MCP server on Cloudflare Workers
- OAuth login for secure client access
- SSE (Server-Sent Events) transport
- Local development with MCP Inspector support
- Easy integration with Claude Desktop via
mcp-remoteproxy - Minimal configuration using
wrangler.jsonc
Use cases of Remote MCP Server on Cloudflare
- Host a math tool MCP server and call it from a remote client
- Connect Claude Desktop to a self‑deployed MCP server for custom tool use
- Test and debug MCP tools locally before deploying to production
FAQ from Remote MCP Server on Cloudflare
What does this project do?
It sets up a remote MCP server on Cloudflare Workers, complete with OAuth login, so that clients like Claude Desktop can call your tools over the internet.
What dependencies are required?
Node.js and pnpm are needed for local development. Cloudflare Wrangler CLI (npx wrangler) is used for deployment. The mcp-remote package (run via npx) acts as a local proxy when connecting Claude Desktop.
How do I connect Claude Desktop to the remote server?
Update your Claude Desktop configuration JSON to add an mcpServers entry with the command npx mcp-remote and the full workers.dev URL ending in /sse. Restart Claude, and a browser window will open for OAuth login.
How do I deploy my own instance?
Create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add its ID to wrangler.jsonc, then run npm run deploy. Your server will be live at a *.workers.dev URL.
Which transport protocol is used?
The server uses SSE (Server-Sent Events) transport, as shown by the /sse endpoint required by the MCP Inspector and the mcp-remote proxy.