my-mcp-server

my-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, deployment, and integration with tools like 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 steps for local development, connecting to the MCP Inspector, integrating with Claude Desktop, and deploying the server to Cloudflare. The guide also provides instructions for debugging and connecting to the server from a remote MCP client. The MCP server facilitates communication between different tools and platforms, allowing for seamless integration and tool invocation. By following the guide, users can set up a robust MCP server environment that supports OAuth login and tool management.

Features

  • Local Development: Instructions for setting up and running the MCP server locally using npm and nx.
  • MCP Inspector Integration: Steps to connect the MCP Inspector to the server for API exploration.
  • Claude Desktop Integration: Configuration guidance for connecting Claude Desktop to the MCP server.
  • Cloudflare Deployment: Detailed steps for deploying the MCP server to Cloudflare Workers.
  • Debugging Tips: Suggestions for troubleshooting and resolving common issues.

Usage with Different Platforms

local_development

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

mcp_inspector

bash
npx @modelcontextprotocol/inspector

claude_desktop_local


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

cloudflare_deployment

bash
npx wrangler kv namespace create OAUTH_KV
# Add the kv namespace ID to wrangler.jsonc
npm run deploy

claude_desktop_remote


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