huanshenyi_mcp-server-bearer-auth

huanshenyi_mcp-server-bearer-auth

3.3

This document provides instructions for setting up a remote Model Context Protocol (MCP) server on Cloudflare Workers, including local development, deployment, and connection to various tools.

The Remote MCP Server on Cloudflare guide is designed to help users set up a Model Context Protocol server using Cloudflare Workers. It includes steps for local development, connecting to the MCP Inspector, deploying to Cloudflare, and connecting to the server from different platforms. The guide also provides debugging tips and scripts for connecting to the server using various tools. The MCP server supports OAuth login, allowing secure access and management of the server. By following the instructions, users can efficiently deploy and manage their MCP server, ensuring seamless integration with other tools and platforms.

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.
  • Cloudflare Deployment: Guide to deploying the MCP server on Cloudflare Workers.
  • Remote Client Connection: Instructions for connecting to the MCP server from a remote client.
  • Debugging Tips: Provides solutions for common issues and debugging methods.

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-bearer-auth

Connect Claude Desktop


    "remote-example": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse",
        "--header",
        "Authorization: Bearer {token}"
      ]
    }

Debugging

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

rm -rf ~/.mcp-auth