MCP.so
Sign In

Overview

What is Remote MCP Server on Cloudflare?

A reference implementation for running a remote Model Context Protocol (MCP) server on Cloudflare Workers, complete with OAuth login. It is intended for developers who want to expose MCP tools over the internet with authentication.

How to use Remote MCP Server on Cloudflare?

Clone the repository, install dependencies with npm install, and run locally with npx nx dev remote-mcp-server. Deploy to Cloudflare by creating a KV namespace (npx wrangler kv namespace create OAUTH_KV), updating wrangler.jsonc, and running npm run deploy.

Key features of Remote MCP Server on Cloudflare

  • Runs on Cloudflare Workers for global, serverless deployment.
  • Includes OAuth login for secure tool access.
  • Supports local development with Hot Module Replacement.
  • Easily connectable via MCP Inspector (SSE transport).
  • Compatible with Claude Desktop using mcp-remote proxy.
  • Provides a fully remote, authenticated MCP endpoint.

Use cases of Remote MCP Server on Cloudflare

  • Deploying a public MCP math tool for AI assistants.
  • Building custom MCP servers with OAuth-protected endpoints.
  • Prototyping and testing MCP tools locally before deploying to production.

FAQ from Remote MCP Server on Cloudflare

What dependencies or runtime are required?

Node.js and npm for local development; a Cloudflare account with Wrangler CLI for deployment. The server runs on the Cloudflare Workers runtime.

How does authentication work?

The server implements OAuth login via a browser redirect. A mock login screen is used in local development; for production, OAuth provider configuration would be needed.

Where does user or session data live?

Session/authentication data is stored in a Cloudflare Workers KV namespace (OAUTH_KV) created during deployment.

What transport does the server use?

It uses Server-Sent Events (SSE) for the MCP transport, accessed at the /sse endpoint.

Are there any known limits?

Tags

More from Cloud & Infrastructure