Remote MCP Server on Cloudflare
@pandaee-lovable
概览
What is Remote MCP Server on Cloudflare?
This project enables you to deploy a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to host MCP tools remotely and connect them to AI assistants like Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with npm install, and run locally using npx nx dev remote-mcp-server. Test the server with the MCP Inspector or connect Claude Desktop via the mcp-remote proxy. Deploy to Cloudflare by creating a KV namespace (npx wrangler kv namespace create OAUTH_KV), adding the namespace ID to wrangler.jsonc, and running npm run deploy.
Key features of Remote MCP Server on Cloudflare
- Deploy MCP server on Cloudflare Workers with OAuth
- Run the server locally for development and testing
- Connect Claude Desktop via a local proxy (
mcp-remote) - Test with the MCP Inspector over SSE transport
- Simple deployment with
wranglerand KV store
Use cases of Remote MCP Server on Cloudflare
- Host MCP tools remotely for AI assistants like Claude
- Prototype OAuth-secured MCP servers before production
- Develop and debug MCP tools locally before deploying
- Integrate MCP capabilities into Cloudflare workers
FAQ from Remote MCP Server on Cloudflare
What is the purpose of this project?
It provides a complete guide to getting a remote MCP server running on Cloudflare Workers with OAuth login.
How do I deploy to Cloudflare?
Create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add the ID to wrangler.jsonc, then run npm run deploy. The server will be available at your workers.dev URL.
How do I connect Claude Desktop to the server?
In Claude Desktop’s configuration file, add a mcpServers entry using the mcp-remote command pointing to your server’s SSE endpoint (e.g., http://localhost:8787/sse for local development).
How do I debug the server?
Restart Claude Desktop, try connecting directly via npx mcp-remote http://localhost:8787/sse, or clear the ~/.mcp-auth directory if authentication issues arise.
What transport and authentication does the server use?
The server uses SSE (Server-Sent Events) as the transport protocol and includes OAuth login for authentication.