home / mcp / cloudflare mcp server

Cloudflare MCP Server

Remote MCP server on Cloudflare Workers with OAuth login, controllable via MCP Inspector and Claude Desktop.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ainoob-awx-mcp-server": {
      "url": "http://localhost:8787/sse"
    }
  }
}

You can run a remote MCP server on Cloudflare Workers and connect it to clients like the MCP Inspector and Claude Desktop. This setup enables you to host your MCP endpoints securely, explore them locally, and use a browser-based login flow powered by OAuth.

How to use

Connect to your MCP server from an MCP client to explore tools, run commands, and validate end-to-end flows. Start with your local server, then test with the MCP Inspector and Claude Desktop. When you deploy remotely, switch the client configuration to the remote URL.

How to install

# clone the repository
git clone https://github.com/cloudflare/ai.git
# Or if using ssh:
# git clone [email protected]:cloudflare/ai.git

# install dependencies
cd ai
# Note: using pnpm instead of just "npm"
pnpm install

# run locally
npx nx dev remote-mcp-server

Deploy and connect to Cloudflare

Deploying to Cloudflare requires creating a KV namespace for OAuth data, updating your wrangler configuration, and deploying the worker. After deployment, use the remote URL in your MCP clients to connect.

1. npx wrangler kv namespace create OAUTH_KV
2. Follow the guidance to add the kv namespace ID to `wrangler.jsonc`
3. npm run deploy

Connect Claude Desktop to your local MCP server

Configure Claude Desktop to proxy through your local MCP server so Claude can issue MCP calls over HTTP. Use the following configuration in Claude's settings to point to the local SSE endpoint.

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

Test locally with the MCP Inspector

You can explore your MCP API using the MCP Inspector. Start the inspector, switch the transport type to SSE, and connect to your local server at /sse. You will complete a mock login and then be able to list and call defined tools.

# Start the inspector
npx @modelcontextprotocol/inspector

Use the local server from a remote MCP client

After you deploy your MCP server, connect a remote MCP client by using the worker’s workers.dev URL. Enter the URL in the inspector as the MCP server to connect to, then you can access the same tools from anywhere.

npx @modelcontextprotocol/inspector@latest
# In the inspector, connect to:
https://your-workname.account.workers.dev/sse

Connect Claude Desktop to your remote MCP server

Update the Claude Desktop configuration to point to your deployed MCP server. Replace the local URL with the remote workers.dev URL to let Claude issue MCP calls through the remote server.

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

Available tools

mcp_inspector

CLI tool to connect to a MCP server, switch to SSE, login, and call tools.

claude_desktop

Desktop AI assistant client configured to talk to your MCP server via a local HTTP proxy.

Cloudflare MCP Server - ainoob/awx-mcp-server