Remote MCP Server on Cloudflare
@signalcipher
Overview
What is Remote MCP Server on Cloudflare?
This server runs a Model Context Protocol (MCP) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to deploy a remote MCP server accessible from any MCP client.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run npx nx dev remote-mcp-server for local development. For remote deployment, create an OAUTH_KV namespace, add its ID to wrangler.jsonc, and run npm run deploy. Connect clients (e.g., MCP Inspector or Claude Desktop) using the SSE endpoint at http://localhost:8787/sse locally or your workers.dev URL after deployment.
Key features of Remote MCP Server on Cloudflare
- Deployable on Cloudflare Workers with OAuth authentication.
- Uses Server-Sent Events (SSE) transport.
- Testable locally before deployment.
- Supports MCP Inspector for tool discovery and calls.
- Connects to Claude Desktop via a remote proxy (
npx mcp-remote). - Provides a global workers.dev URL for client access.
Use cases of Remote MCP Server on Cloudflare
- Deploy a remote MCP server reachable from any internet-connected client.
- Give AI assistants like Claude access to custom tools over the web.
- Authenticate users with OAuth before allowing tool execution.
- Develop and test MCP tools locally, then deploy globally with minimal friction.
FAQ from Remote MCP Server on Cloudflare
How do I run this server locally?
Clone the repo, run npm install, and then execute npx nx dev remote-mcp-server. The server will be available at http://localhost:8787/.
How do I connect the MCP Inspector?
Start the inspector with npx @modelcontextprotocol/inspector, set Transport Type to SSE, and enter http://localhost:8787/sse (or your deployed URL) as the server URL. You will go through a mock OAuth login to connect.
How do I deploy the server to Cloudflare?
First create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add the returned ID to wrangler.jsonc, then run npm run deploy.
How do I connect Claude Desktop to my deployed server?
Edit Claude Desktop’s config file to add an entry using npx mcp-remote pointing to your workers.dev/sse URL (e.g., https://worker-name.account-name.workers.dev/sse). Restart Claude; a login window will open.
What should I do if something goes wrong?
Try restarting Claude, or connect directly using npx mcp-remote http://localhost:8787/sse. In rare cases, clearing ~/.mcp-auth with rm -rf ~/.mcp-auth may help.