Remote MCP Server on Cloudflare
@fangxy926
Overview
What is Remote MCP Server on Cloudflare?
Remote MCP Server on Cloudflare is a template for deploying a Model Context Protocol (MCP) server on Cloudflare Workers with OAuth login. It is intended for developers who want to run an MCP server remotely and connect it to MCP clients such as Claude Desktop or the MCP Inspector.
How to use Remote MCP Server on Cloudflare?
Develop locally by cloning the repository, installing dependencies, and running npx nx dev remote-mcp-server. Deploy to Cloudflare by creating a KV namespace, adding it to wrangler.jsonc, and running npm run deploy. Connect clients (MCP Inspector or Claude Desktop) using SSE at the server’s /sse endpoint, with the mcp-remote proxy for Claude Desktop.
Key features of Remote MCP Server on Cloudflare
- Deploy a remote MCP server on Cloudflare Workers
- OAuth-based login for secure access
- Local development with mock authentication
- Uses SSE (Server-Sent Events) transport
- Compatible with MCP Inspector and Claude Desktop
Use cases of Remote MCP Server on Cloudflare
- Run an MCP server in the cloud for remote tool access
- Connect Claude Desktop to a custom remote MCP server
- Develop and test MCP tools locally before deploying
FAQ from Remote MCP Server on Cloudflare
What runtime or dependencies are required?
Node.js and npm are needed for local development. A Cloudflare account and the Wrangler CLI are required for deployment.
How is authentication handled?
The server includes OAuth login. In local development a mock login screen accepts any email and password; in production OAuth flows from Cloudflare Workers are used.
Where does data for the OAuth state live?
The README instructs creating a Cloudflare KV namespace named OAUTH_KV to store OAuth state.
What transport protocol does the server use?
The MCP server uses SSE (Server-Sent Events) over HTTP. Clients connect to the /sse endpoint.
Can I connect this to Claude Desktop?
Yes. Add a configuration entry in Claude Desktop’s config file that uses npx mcp-remote with the server’s /sse URL.