Remote MCP Server on Cloudflare
@Mechanicalgoat
Overview
What is Remote MCP Server on Cloudflare?
A template for deploying a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login. It allows AI clients like Claude Desktop to connect to and call tools over SSE.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run locally with npx nx dev remote-mcp-server. Deploy by creating an OAuth KV namespace in Wrangler and running npm run deploy. Connect via the MCP Inspector (SSE URL) or configure Claude Desktop with npx mcp-remote pointing to the server’s /sse endpoint.
Key features of Remote MCP Server on Cloudflare
- Runs on Cloudflare Workers for serverless deployment.
- Includes OAuth login for authentication.
- Uses SSE transport for MCP communication.
- Works with MCP Inspector for local testing.
- Connects to Claude Desktop via a local proxy.
- Provides a sample math tool for demonstration.
- Supports both local and remote deployment.
Use cases of Remote MCP Server on Cloudflare
- Deploying a remote MCP server for AI tools to access.
- Prototyping and testing MCP tools with MCP Inspector.
- Integrating custom MCP tools with Claude Desktop over the internet.
- Learning how to build and deploy an OAuth-protected MCP server on Cloudflare.
FAQ from Remote MCP Server on Cloudflare
How do I connect the MCP Inspector to my local server?
Open the Inspector, set Transport Type to SSE, enter http://localhost:8787/sse, click “Connect”, and log in with any email/password.
How do I connect Claude Desktop to a remote deployment?
Update Claude’s config file to use npx mcp-remote with your workers.dev URL followed by /sse.
What runtime or dependencies are required?
Node.js and npm for local development. The deploy step uses wrangler and a Cloudflare account.
Where does authentication data live?
In a Cloudflare KV namespace (OAUTH_KV) created during deployment.
Is there any known limitation or alternative?
—