MCP.so
Sign In

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 designed for developers who want to host remote MCP servers and connect them to clients like Claude Desktop or the MCP Inspector.

How to use Remote MCP Server on Cloudflare?

Clone the repository, install dependencies with npm install, and run locally with npx nx dev remote-mcp-server. To connect clients, use npx @modelcontextprotocol/inspector with SSE transport at <url>/sse. Deploy with npx wrangler kv namespace create OAUTH_KV, add the KV namespace ID to wrangler.jsonc, then npm run deploy. Configure Claude Desktop by updating its mcpServers JSON to point to the remote SSE endpoint using mcp-remote.

Key features of Remote MCP Server on Cloudflare

  • Deploy MCP server on Cloudflare Workers with OAuth
  • Supports local development with live reload
  • Connect via MCP Inspector over SSE transport
  • Integrates with Claude Desktop via mcp-remote proxy
  • Uses Cloudflare KV for OAuth token storage
  • Includes mock login for local testing

Use cases of Remote MCP Server on Cloudflare

  • Host a math tool server that Claude can call remotely
  • Run custom MCP tools behind OAuth authentication
  • Prototype and debug MCP servers locally then deploy to production
  • Connect multiple MCP clients to a single cloud-hosted server

FAQ from Remote MCP Server on Cloudflare

What runtime or dependencies are required?

Node.js and npm are required for local development. Deployment uses Cloudflare Workers, so a Cloudflare account and Wrangler CLI are needed.

How does authentication work?

The server includes OAuth login. Locally, a mock login screen accepts any email and password. On Cloudflare, OAuth flows as configured.

How do I connect Claude Desktop to a remote server?

Update Claude's config file with an mcpServers entry using command: "npx", args ["mcp-remote", "https://your-worker.workers.dev/sse"], then restart Claude.

Where is the OAuth token stored?

It is stored in a Cloudflare KV namespace (configured via wrangler kv namespace create OAUTH_KV and adding the ID to wrangler.jsonc).

What transport does the server use?

The server uses SSE (Server-Sent Events) as the transport protocol, exposed at the /sse endpoint.

How do I debug connection issues?

Try connecting directly via npx mcp-remote http://localhost:8787/sse (or your deployed URL). Restart Claude, or clear ~/.mcp-auth in rare cases.

Tags

More from Cloud & Infrastructure