Remote MCP Server on Cloudflare

Provides a remote MCP server hosted on Cloudflare Workers with OAuth login, enabling clients to discover and call MCP tools.
  • typescript

0

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You can run a remote MCP server on Cloudflare Workers and connect to it from MCP clients and Claude Desktop. This setup lets you host the MCP backend in the cloud, explore its tools via an inspector, and securely deploy for remote access.

How to use

You connect to your MCP server from an MCP client by pointing the client at the server’s SSE (Server-Sent Events) endpoint. For local development, this is typically http://localhost:8787/sse. Use the MCP Inspector to discover, test, and call available tools and workflows. You can also connect Claude Desktop by configuring it to reach your local or remote MCP server, enabling you to invoke tools from Claude prompts.

How to install

Prerequisites: install Node.js and a package manager you prefer (pnpm is recommended in this workflow). You will also use the MCP tooling in npm/yarn-like commands.

# clone the project repository
git clone https://github.com/cloudflare/ai.git
# Or if using ssh:
# git clone git@github.com:cloudflare/ai.git

# install dependencies (use pnpm as the guide suggests)
cd ai
pnpm install

# run the remote MCP server in development mode
npx nx dev remote-mcp-server

# you should be able to open http://localhost:8787/ in your browser

Additional setup and usage notes

Connect the MCP inspector to your local server to explore the API. Start the inspector, switch the Transport Type to SSE, and point it at http://localhost:8787/sse. Log in with any email and password when prompted to access the tool surface.

Configure Claude Desktop to talk to your MCP server. Create or update the MCP config to run a local proxy that forwards to your server. Use the following configuration snippet in Claude’s dev config file.

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

Deploy to Cloudflare

Prepare Cloudflare deployment by creating a KV namespace to store OAuth state and related data, then deploy the Worker that hosts your MCP server.

npx wrangler kv namespace create OAUTH_KV

Follow the guidance to add the kv namespace ID to wrangler.jsonc, then deploy the Worker:

npm run deploy

Call your newly deployed remote MCP server from a remote MCP client

From the MCP Inspector, point the client to your Worker’s workers.dev URL (for example, https://your-worker-name.account.workers.dev/sse) and connect. This allows you to use the remote MCP server from a separate client session.

Connect Claude Desktop to your remote MCP server

Update Claude’s configuration to reference your remote server’s SSE endpoint and restart Claude to enable remote tool access.

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

Debugging

If something goes wrong, try restarting Claude or connecting directly to your MCP server from the command line to verify reachability. You can test the local server with the inspector and the remote server with the Claude configuration to isolate issues.

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

If you need to reset authentication data locally, remove the stored credentials:

rm -rf ~/.mcp-auth

Available tools

mcp_inspector

A client tool to explore the MCP API, switch Transport Type to SSE, connect to the local server, log in with any email and password, and list/call defined Tools.

claude_desktop_integration

Configuration steps to connect Claude Desktop to the MCP server, allowing Claude to prompt and execute MCP Tools via a local or remote proxy.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational