Remote MCP Server on Cloudflare
@sergimiral
Overview
What is Remote MCP Server on Cloudflare?
The Remote MCP Server on Cloudflare is a starter project that helps developers deploy a Model Context Protocol (MCP) server on Cloudflare Workers with OAuth login. It provides a secure, serverless way to expose MCP tools over HTTP using SSE (Server-Sent Events) transport.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with npm install, and run locally using npx nx dev remote-mcp-server. Test with the MCP Inspector (npx @modelcontextprotocol/inspector) or connect Claude Desktop by configuring its mcpServers entry with the mcp-remote proxy pointing to your local or deployed /sse endpoint. Deploy to Cloudflare using npx wrangler kv namespace create OAUTH_KV and npm run deploy.
Key features of Remote MCP Server on Cloudflare
- Built on Cloudflare Workers for serverless deployment.
- Includes OAuth-based login for secure access.
- Supports SSE (Server-Sent Events) transport.
- Can be tested locally with MCP Inspector.
- Integrates with Claude Desktop via
mcp-remoteproxy.
Use cases of Remote MCP Server on Cloudflare
- Deploy custom MCP tools to the edge.
- Provide authenticated MCP endpoints to remote clients.
- Develop and test MCP servers locally before production deployment.
- Connect Claude Desktop to remote tools with OAuth.
FAQ from Remote MCP Server on Cloudflare
How do I connect Claude Desktop to my local MCP server?
Configure Claude Desktop’s claude_desktop_config.json with a mcpServers entry using mcp-remote and the URL http://localhost:8787/sse. Restart Claude to see the tools.
How do I deploy to Cloudflare?
Create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add its ID to wrangler.jsonc, then run npm run deploy. Your server will be available at a workers.dev URL.
How do I connect to the deployed remote MCP server?
Use the workers.dev URL with the /sse path in MCP Inspector or Claude Desktop configuration (e.g., https://worker-name.account-name.workers.dev/sse).
What if something goes wrong?
Restart Claude, try connecting via command line with npx mcp-remote http://localhost:8787/sse, or clear authentication files with rm -rf ~/.mcp-auth.