Remote MCP Server on Cloudflare logo

Remote MCP Server on Cloudflare

by aditya1

This project provides an example of setting up a remote MCP (Model Context Protocol) server on Cloudflare Workers with OAuth login. It allows you to connect to the server locally or deploy it to Cloudflare for remote access.

View on GitHub

Last updated: N/A

What is Remote MCP Server on Cloudflare?

This is an example of a remote MCP server that can be deployed on Cloudflare Workers. It enables communication between applications and language models using the Model Context Protocol.

How to use Remote MCP Server on Cloudflare?

To use this server, you can either develop it locally by cloning the repository, installing dependencies, and running it. Alternatively, you can deploy it to Cloudflare by creating a KV namespace, adding the namespace ID to wrangler.jsonc, and running the deploy command. You can then connect to the server using the MCP Inspector or Claude Desktop.

Key features of Remote MCP Server on Cloudflare

  • Remote MCP server

  • Cloudflare Workers deployment

  • OAuth login

  • Local development support

  • Integration with MCP Inspector

  • Integration with Claude Desktop

Use cases of Remote MCP Server on Cloudflare

  • Connecting applications to language models

  • Enabling language models to access external tools

  • Building serverless MCP servers

  • Experimenting with the Model Context Protocol

  • Integrating Claude with custom tools

FAQ from Remote MCP Server on Cloudflare

How do I connect to the server locally?

Run npx nx dev remote-mcp-server and connect to http://localhost:8787/sse using the MCP Inspector.

How do I deploy the server to Cloudflare?

Create a KV namespace, add the namespace ID to wrangler.jsonc, and run npm run deploy.

How do I connect the MCP Inspector?

Set the Transport Type to SSE and enter the server URL (e.g., http://localhost:8787/sse or your Cloudflare Workers URL).

How do I connect Claude Desktop?

Update the Claude configuration file to point to the server URL and restart Claude.

What if something goes wrong?

Try restarting Claude, connecting directly to the server with npx mcp-remote http://localhost:8787/sse, or clearing the files in ~/.mcp-auth.