remote-mcp-server

remote-mcp-server

3.3

This document provides a guide to setting up a remote Model Context Protocol (MCP) server on Cloudflare Workers, including local development, connection to MCP Inspector, and integration with Claude Desktop.

The Remote MCP Server on Cloudflare guide details the process of deploying a Model Context Protocol server using Cloudflare Workers. It includes steps for local development, connecting to the MCP Inspector for API exploration, and integrating with Claude Desktop for enhanced functionality. The guide also covers deployment to Cloudflare and provides troubleshooting tips. The MCP server facilitates communication between different platforms, allowing for seamless tool invocation and data exchange. By leveraging Cloudflare Workers, the server can be deployed remotely, providing scalability and reliability. The integration with OAuth login ensures secure access, while the use of the MCP Inspector and Claude Desktop enhances the user experience by providing intuitive interfaces for interaction with the server.

Features

  • Local Development: Instructions for setting up and running the MCP server locally using Node.js and npm.
  • MCP Inspector Integration: Steps to connect the MCP Inspector to the server for API exploration and tool invocation.
  • Claude Desktop Integration: Configuration details for connecting Claude Desktop to the MCP server for enhanced interaction.
  • Cloudflare Deployment: Guide to deploying the MCP server on Cloudflare Workers for remote access.
  • OAuth Login: Secure login mechanism for accessing the MCP server.

Usage with Different Platforms

Develop Locally

bash
# clone the repository
git clone git@github.com:cloudflare/ai.git

# install dependencies
cd ai
npm install

# run locally
npx nx dev remote-mcp-server

Connect MCP Inspector

bash
npx @modelcontextprotocol/inspector

Connect Claude Desktop


{
  "mcpServers": {
    "math": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse"
      ]
    }
  }
}

Deploy to Cloudflare

bash
npx wrangler kv namespace create OAUTH_KV
npm run deploy

Debugging

bash
npx mcp-remote http://localhost:8787/sse
rm -rf ~/.mcp-auth