Remote MCP Server on Cloudflare
@NickB03
Overview
What is Remote MCP Server on Cloudflare?
This project helps you run a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to host MCP endpoints in the cloud and connect them to compatible clients like the MCP Inspector or Claude Desktop.
How to use Remote MCP Server on Cloudflare?
Clone the repository, install dependencies, and run locally with npx nx dev remote-mcp-server. Use the MCP Inspector (npx @modelcontextprotocol/inspector) to test the server at http://localhost:8787/sse with SSE transport. Deploy to Cloudflare with npx wrangler kv namespace create OAUTH_KV and then npm run deploy. Connect Claude Desktop by editing its configuration file to point to your workers.dev URL via the mcp-remote proxy.
Key features of Remote MCP Server on Cloudflare
- Runs MCP server as a Cloudflare Worker.
- Includes OAuth login flow for authentication.
- Uses SSE (Server-Sent Events) transport.
- Offers local development with live reload.
- Provides an example math tool for demonstration.
- Compatible with MCP Inspector and Claude Desktop.
Use cases of Remote MCP Server on Cloudflare
- Host a remote math tool that can be called via Claude Desktop.
- Test and debug MCP tools locally before deploying.
- Provide a secure, authenticated MCP endpoint for client applications.
- Experiment with remote MCP server deployment on Cloudflare.
FAQ from Remote MCP Server on Cloudflare
What is the purpose of this server?
It allows you to run an MCP server remotely on Cloudflare Workers, enabling clients like Claude Desktop to call tools over the internet with OAuth-based authentication.
How do I deploy my own copy?
After cloning the repo and installing dependencies, run npx wrangler kv namespace create OAUTH_KV, add the KV namespace ID to wrangler.jsonc, then run npm run deploy. Your server will be available at a workers.dev URL.
How can I connect Claude Desktop to the remote server?
Edit Claude Desktop’s configuration file (Settings > Developer > Edit Config) and add an entry like:
{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"https://worker-name.account-name.workers.dev/sse"
]
}
}
}
Restart Claude Desktop to connect.
What transport protocol does the server use?
The server communicates via SSE (Server-Sent Events). When using the MCP Inspector, set the Transport Type to SSE and use the /sse endpoint.
Does the server include any built‑in tools?
Yes, the example repository includes a math tool that can add two numbers. You can extend it with your own tools by modifying the server code.