Remote MCP Server on Cloudflare
@RayDataCo
Overview
What is Remote MCP Server on Cloudflare?
Remote MCP Server on Cloudflare is a reference implementation for running a Model Context Protocol (MCP) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to expose MCP tools via a secure, serverless endpoint.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run locally with npx nx dev remote-mcp-server. Deploy to Cloudflare using npm run deploy after creating a KV namespace. Connect clients like the MCP Inspector or Claude Desktop by pointing them to the server’s SSE endpoint (e.g., http://localhost:8787/sse locally or https://worker-name.account-name.workers.dev/sse after deployment).
Key features of Remote MCP Server on Cloudflare
- Runs on Cloudflare Workers for serverless hosting.
- Includes OAuth login for secure access.
- Supports SSE (Server-Sent Events) transport.
- Easy local development with MCP Inspector.
- Direct integration with Claude Desktop via remote proxy.
Use cases of Remote MCP Server on Cloudflare
- Deploying MCP tools that require authenticated remote access.
- Prototyping and testing MCP servers locally before deployment.
- Connecting Claude Desktop to a cloud-based MCP server.
- Building serverless MCP toolchains on Cloudflare’s edge network.
FAQ from Remote MCP Server on Cloudflare
What transport does the server use?
The server communicates over SSE (Server-Sent Events). Clients connect to the /sse endpoint.
Can I run it locally without Cloudflare?
Yes. Use npx nx dev remote-mcp-server to run the server locally on http://localhost:8787.
How do I connect Claude Desktop to a deployed server?
Update the Claude Desktop configuration file (Settings > Developer > Edit Config) to use npx mcp-remote with the deployed Workers URL followed by /sse.
How do I authenticate when using the server?
The server implements an OAuth login flow. When connecting a client (e.g., MCP Inspector or Claude), a browser window opens for login. Locally, any email/password works; on deployment, the OAuth provider you configure is used.
What tools are included by default?
The README demonstrates a math tool for basic arithmetic, but the server can be extended with any MCP tools you define.