remote-mcp-server

organicnz/remote-mcp-server

3.1

If you are the rightful owner of remote-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

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 setting up a Model Context Protocol server using Cloudflare Workers. It includes instructions for local development, connecting to the MCP Inspector, and integrating with Claude Desktop. The guide also covers deployment to Cloudflare and provides troubleshooting tips. The MCP server facilitates communication between different platforms and tools, allowing for seamless integration and interaction. By following the guide, users can set up a remote MCP server with OAuth login, enabling secure and efficient tool management and execution.

Features

  • Local Development: Instructions for setting up and running the MCP server locally using npm and nx.
  • MCP Inspector Connection: Steps to connect the MCP Inspector to the server for API exploration.
  • Claude Desktop Integration: Configuration details for connecting Claude Desktop to the MCP server.
  • Cloudflare Deployment: Guidance on deploying the MCP server to Cloudflare Workers.
  • Debugging Tips: Solutions for common issues, including restarting Claude and clearing authentication files.

Usages

local development with npx

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 locally

bash
npx @modelcontextprotocol/inspector

connect claude desktop locally

{
  "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

connect mcp inspector remotely

bash
npx @modelcontextprotocol/inspector@latest

connect claude desktop remotely

{
  "mcpServers": {
    "math": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://worker-name.account-name.workers.dev/sse"
      ]
    }
  }
}

debugging claude connection

bash
npx mcp-remote http://localhost:8787/sse

clear mcp auth files

bash
rm -rf ~/.mcp-auth