Remote MCP Server on Cloudflare
@Miguel07Alm
Overview
What is Remote MCP Server on Cloudflare?
It provides a remote MCP (Model Context Protocol) server running on Cloudflare Workers, complete with OAuth-based login for authenticated access.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with npm install, and run locally via npx nx dev remote-mcp-server. Deploy to Cloudflare using npx wrangler kv namespace create OAUTH_KV, update wrangler.jsonc with the KV namespace ID, then run npm run deploy. Connect clients (e.g., MCP Inspector or Claude Desktop) using SSE at the server’s /sse endpoint.
Key features of Remote MCP Server on Cloudflare
- Runs on Cloudflare Workers for scalable, serverless deployment.
- Includes OAuth login for secure access.
- Uses SSE (Server-Sent Events) as the transport protocol.
- Works with MCP Inspector for local and remote testing.
- Integrates with Claude Desktop via the
mcp-remoteproxy. - Supports local development and debugging workflows.
Use cases of Remote MCP Server on Cloudflare
- Hosting a remote MCP server accessible from any SSE-capable client.
- Developing and testing MCP tools locally with MCP Inspector.
- Connecting Claude Desktop to a cloud-hosted MCP server with OAuth.
- Demonstrating end-to-end MCP server deployment on Cloudflare Workers.
FAQ from Remote MCP Server on Cloudflare
How do I develop the server locally?
Clone the repo, install dependencies with npm install, then run npx nx dev remote-mcp-server. The server will be available at http://localhost:8787/.
How do I deploy the server to Cloudflare?
Create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add the namespace ID to wrangler.jsonc, and run npm run deploy.
How do I connect Claude Desktop to the remote server?
Edit Claude Desktop’s configuration file (Settings > Developer > Edit Config) and add an entry using npx mcp-remote with the server’s full workers.dev URL ending in /sse.
How can I debug connection issues?
Restart Claude, or test the connection directly from the command line using npx mcp-remote <url>. In rare cases, clear the authentication cache by running rm -rf ~/.mcp-auth.
What transport protocol does the server use?
The server uses SSE (Server-Sent Events) as its transport. Clients connect to the /sse endpoint.