概览
What is Remote MCP Server on Cloudflare?
This server helps you get a remote MCP server running on Cloudflare Workers with OAuth login. It is intended for developers who want to expose Model Context Protocol tools over the internet and connect them to MCP clients such as Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run npx nx dev remote-mcp-server to start locally. Deploy to Cloudflare using npm run deploy after creating a KV namespace (npx wrangler kv namespace create OAUTH_KV). Connect clients like MCP Inspector or Claude Desktop by pointing them to the SSE endpoint (e.g., http://localhost:8787/sse locally or https://worker-name.account-name.workers.dev/sse after deployment).
Key features of Remote MCP Server on Cloudflare
- Deploys MCP server on Cloudflare Workers with OAuth login
- Supports local development with live reload
- Connects to MCP Inspector and Claude Desktop
- Uses SSE (Server-Sent Events) transport protocol
- Includes a mock math tool (add) for demonstration
Use cases of Remote MCP Server on Cloudflare
- Running a remote MCP server accessible from anywhere
- Prototyping and testing MCP tools with the MCP Inspector
- Integrating Claude Desktop with custom, self-hosted MCP tools
- Learning how to deploy and authenticate remote MCP servers
FAQ from Remote MCP Server on Cloudflare
How do I run the server locally?
Clone the repo, install dependencies, and execute npx nx dev remote-mcp-server. The server will be available at http://localhost:8787/.
How do I deploy to Cloudflare?
Create a KV namespace with npx wrangler kv namespace create OAUTH_KV, add the namespace ID to wrangler.jsonc, then run npm run deploy.
How do I connect the MCP Inspector?
Open the MCP Inspector (with npx @modelcontextprotocol/inspector), switch transport type to SSE, enter the server’s SSE URL (e.g., http://localhost:8787/sse), click Connect, and log in with any email and password.
How do I connect Claude Desktop?
Edit Claude Desktop’s config file to add an entry with command npx mcp-remote and args pointing to the server’s SSE URL (e.g., http://localhost:8787/sse or the workers.dev URL). Restart Claude and log in through the browser.
What runtime or dependencies are required?
The server runs on Node.js (for local development) and deploys to Cloudflare Workers. Requires npx, wrangler, and a Cloudflare account for deployment. No additional runtime beyond the Cloudflare infrastructure.