Remote MCP Server on Cloudflare
@MLC-Digital-Transformation
Overview
What is Remote MCP Server on Cloudflare?
Remote MCP Server on Cloudflare is a reference implementation that runs a Model Context Protocol (MCP) server on Cloudflare Workers with OAuth login. It is intended for developers who want to host and serve MCP tools remotely and connect clients like the MCP Inspector or Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with pnpm install, then run locally with npx nx dev remote-mcp-server. Deploy to Cloudflare using npm run deploy after creating an OAUTH_KV namespace. Connect clients by pointing them to the server’s SSE endpoint (e.g., http://localhost:8787/sse locally or the Workers URL in production) and authenticating via the OAuth login screen.
Key features of Remote MCP Server on Cloudflare
- Deployed on Cloudflare Workers for serverless hosting
- OAuth login for authenticated tool access
- Uses Server‑Sent Events (SSE) transport
- Includes a math tool as an example (addition)
- Works with MCP Inspector for local development
- Connects to Claude Desktop via a remote proxy (
mcp-remote)
Use cases of Remote MCP Server on Cloudflare
- Hosting custom MCP tools and making them accessible over the internet
- Testing MCP tool interactions locally with the MCP Inspector
- Connecting Claude Desktop to a remote MCP server using OAuth
- Demonstrating a full remote MCP workflow from development to deployment
FAQ from Remote MCP Server on Cloudflare
What runtime or dependencies are required?
The server runs on Cloudflare Workers. Local development requires Node.js and pnpm. You also need wrangler (installed via npm) for deployment and an OAUTH_KV namespace for OAuth state.
How does authentication work?
The server uses OAuth login. When connecting via MCP Inspector or Claude, you are redirected to a login screen where you enter an email and password. After authentication, you are returned to the client and can call tools.
Can I use this server with Claude Desktop?
Yes. Configure Claude’s mcpServers to use the mcp-remote command pointing to the server’s SSE URL. For a local server, use http://localhost:8787/sse; for a deployed one, use your Workers URL (e.g., https://worker-name.account-name.workers.dev/sse).
How do I debug connection issues?
Restart Claude or try connecting directly with npx mcp-remote http://localhost:8787/sse. If problems persist, clear the OAuth cache at ~/.mcp-auth using rm -rf ~/.mcp-auth.
What transport does the server use?
The server communicates over Server‑Sent Events (SSE). The MCP Inspector and Claude proxy connect to the <url>/sse endpoint.