概要
What is Remote MCP Server on Cloudflare?
A template for deploying a remote MCP server on Cloudflare Workers with OAuth login. It allows MCP clients to connect remotely via SSE and includes a local development workflow.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies with npm install, run locally with npx nx dev remote-mcp-server, then connect using the MCP Inspector or Claude Desktop via a local proxy (npx mcp-remote). Deploy with npx wrangler kv namespace create OAUTH_KV and npm run deploy.
Key features of Remote MCP Server on Cloudflare
- OAuth login for remote MCP server access.
- Supports SSE transport for MCP clients.
- Deployable to Cloudflare Workers.
- Local development with mock login.
- Integration with MCP Inspector and Claude Desktop.
Use cases of Remote MCP Server on Cloudflare
- Running a remote MCP server that works with Claude Desktop.
- Prototyping and testing MCP tools locally before deployment.
- Adding OAuth authentication to MCP server endpoints.
- Hosting MCP tools on Cloudflare’s global edge network.
FAQ from Remote MCP Server on Cloudflare
What dependencies are required?
Node.js, npm, and a Cloudflare account for deployment. Local development uses npx nx and the @modelcontextprotocol/inspector package.
How do I connect Claude Desktop to the remote server?
Update the Claude config file to use npx mcp-remote with your server’s workers.dev URL (e.g., https://worker-name.account-name.workers.dev/sse).
How do I troubleshoot connection issues?
Restart Claude, try connecting directly with npx mcp-remote http://localhost:8787/sse, or clear the auth cache with rm -rf ~/.mcp-auth.
What transport does the server use?
The server uses SSE (Server-Sent Events) as its transport protocol, configured at the /sse endpoint.
How is OAuth handled locally?
During local development, the OAuth flow uses a mock login screen that accepts any email and password. Deployed servers require a real OAuth provider configured via Cloudflare.