MCP.so
Sign In

Overview

What is Remote MCP Server on Cloudflare?

Remote MCP Server on Cloudflare is a template for running a remote MCP (Model Context Protocol) server on Cloudflare Workers with OAuth login. It enables any MCP client—like the MCP Inspector or Claude Desktop—to connect to the server over HTTP using SSE (Server-Sent Events) transport. This server is intended for developers who want to host MCP tools at a public URL with authentication.

How to use Remote MCP Server on Cloudflare?

Clone the repository, install dependencies with npm install, and start a local development server using npx nx dev remote-mcp-server. For deployment, run npx wrangler kv namespace create OAUTH_KV to create an OAuth key-value store, add the namespace ID to wrangler.jsonc, then run npm run deploy. Connect clients by using the SSE endpoint (/sse) of the local or deployed server. Use npx @modelcontextprotocol/inspector to explore tools locally, and configure Claude Desktop with the mcp-remote proxy pointing to the SSE URL.

Key features of Remote MCP Server on Cloudflare

  • Runs on Cloudflare Workers for global, serverless hosting.
  • OAuth login protects tools (mock login in local dev mode).
  • Uses SSE (Server-Sent Events) transport for MCP communication.
  • Includes a built‑in math tool as an example (e.g., addition).
  • Supports local development, then one‑command deployment.
  • Works with MCP Inspector and Claude Desktop out of the box.

Use cases of Remote MCP Server on Cloudflare

  • Deploying MCP tools behind authentication on a public URL.
  • Connecting Claude Desktop to remote MCP servers via an SSE proxy.
  • Developing and testing new MCP tools locally with a mock login.
  • Exposing tools to remote MCP clients without requiring a local server.

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.

How do I deploy the server to production?

Create an OAuth KV namespace with wrangler kv namespace create OAUTH_KV, update wrangler.jsonc with the namespace ID, and run npm run deploy.

How do I connect Claude Desktop to the remote server?

Edit Claude Desktop’s configuration file to include an entry using the mcp-remote proxy, pointing to the server’s SSE URL (e.g., https://worker-name.account-name.workers.dev/sse).

What should I do if the connection fails?

Restart Claude Desktop, or test the connection directly with npx mcp-remote http://localhost:8787/sse. In rare cases, clear the auth cache with rm -rf ~/.mcp-auth.

Is there a local mock login?

Yes, when running locally, the inspector or Claude will show a mock login screen where you can enter any email and password to authenticate.

Tags

More from Cloud & Infrastructure