Remote MCP Server on Cloudflare logo

Remote MCP Server on Cloudflare

by miltonian

This project allows you to set up a remote MCP (Model Context Protocol) server on Cloudflare Workers, complete with OAuth login. It enables you to connect to the server using the MCP Inspector or Claude Desktop for interacting with tools.

View on GitHub

Last updated: N/A

What is Remote MCP Server on Cloudflare?

This is a remote MCP (Model Context Protocol) server that can be deployed on Cloudflare Workers. It provides a way to expose tools and functionalities to clients like the MCP Inspector or Claude Desktop, allowing them to interact with these tools remotely.

How to use Remote MCP Server on Cloudflare?

  1. Develop locally using npm install and npx nx dev remote-mcp-server. 2. Connect the MCP inspector by setting the Transport Type to SSE and entering http://localhost:8787/sse as the URL. 3. Connect Claude Desktop by updating the configuration file with the local or remote server URL. 4. Deploy to Cloudflare using npx wrangler kv namespace create OAUTH_KV and npm run deploy. 5. Connect to the deployed server using the MCP Inspector or Claude Desktop by updating the configuration with the workers.dev URL.

Key features of Remote MCP Server on Cloudflare

  • Remote MCP server deployment

  • Cloudflare Workers integration

  • OAuth login

  • SSE transport

  • Integration with MCP Inspector

  • Integration with Claude Desktop

Use cases of Remote MCP Server on Cloudflare

  • Exposing tools to remote clients

  • Integrating with AI models like Claude

  • Building serverless MCP applications

  • Creating a centralized tool repository

  • Enabling remote access to functionalities

FAQ from Remote MCP Server on Cloudflare

How do I run the server locally?

Clone the repository, install dependencies with npm install, and run npx nx dev remote-mcp-server.

How do I connect the MCP Inspector?

Start the inspector with npx @modelcontextprotocol/inspector, switch the Transport Type to SSE, and enter the server URL (e.g., http://localhost:8787/sse).

How do I connect Claude Desktop?

Update the Claude configuration file with the server URL and restart Claude.

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, and run npm run deploy.

How do I debug issues?

Restart Claude, connect directly to the MCP server on the command line with npx mcp-remote http://localhost:8787/sse, or clear the files added to ~/.mcp-auth with rm -rf ~/.mcp-auth.