Remote MCP Server on Cloudflare
@jalexspringer
Overview
What is Remote MCP Server on Cloudflare?
A template to set up a remote MCP (Model Context Protocol) server on Cloudflare Workers with OAuth login. It enables developers to run authenticated MCP tools that can be accessed from any MCP client.
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 using npx wrangler kv namespace create OAUTH_KV, update wrangler.jsonc, then npm run deploy. Connect clients like the MCP Inspector or Claude Desktop by pointing them to the SSE endpoint (e.g., https://worker-name.workers.dev/sse).
Key features of Remote MCP Server on Cloudflare
- Deploy a remote MCP server to Cloudflare Workers.
- Built-in OAuth login for authentication.
- Works with SSE transport for remote clients.
- Compatible with MCP Inspector and Claude Desktop.
- Local development with live reload via Nx.
Use cases of Remote MCP Server on Cloudflare
- Run a custom MCP tool server accessible from anywhere.
- Integrate MCP tools with Claude Desktop via a remote proxy.
- Test and debug MCP tools locally before deploying to production.
- Provide authenticated MCP services to multiple clients.
FAQ from Remote MCP Server on Cloudflare
What exactly does this template provide?
It provides a fully working remote MCP server on Cloudflare Workers, complete with OAuth login, ready to be extended with custom tools.
What dependencies are required to use it?
You need Node.js, npm, and the Cloudflare Workers CLI (wrangler). A Cloudflare account is needed for deployment.
How do I connect Claude Desktop to the remote server?
Add an mcpServers entry in Claude's config using mcp-remote as the command pointing to your server’s SSE URL (e.g., https://worker-name.workers.dev/sse).
How can I debug connectivity issues?
Try restarting Claude, or test directly with npx mcp-remote http://localhost:8787/sse. If needed, clear the auth cache with rm -rf ~/.mcp-auth.
Does the server support transport other than SSE?
The README only demonstrates SSE transport for remote access. No other transports (e.g., stdio) are mentioned for the deployed server.