Learn how to deploy and connect a remote MCP server on Cloudflare Workers with OAuth and Claude integration
The Remote MCP Server implementation on Cloudflare Workers provides a robust platform for integrating various AI applications and tools, leveraging Model Context Protocol (MCP) as the standard interface. This server allows developers to connect diverse AI models and utilities through a unified protocol, ensuring seamless interoperability across different environments including development, staging, and production.
With support for OAuth-based authentication, this server enables secure and seamless connections between AI clients and servers, facilitating real-time data exchange and tool invocation. The integration leverages Cloudflare's powerful Worker technology to deliver low-latency performance and reliability, making it ideal for applications requiring cross-platform compatibility.
The Remote MCP Server on Cloudflare is designed with several key features that enhance its utility:
Real-time communication between AI clients (e.g., Claude Desktop) and servers is achieved through Server-Sent Events (SSE), enabling instant responses to requests and updates.
OAuth 2.0 authentication ensures secure user authentication, allowing seamless login flows for users from various devices.
The server supports the invocation of tools and models defined in the MCP context, providing a flexible mechanism for executing tasks and processing data.
Utilizing Cloudflare's Worker technology allows for cloud-native development with automatic scaling, ensuring high availability and performance under varying loads.
Customizable API endpoints facilitate easy integration with existing workflows, enabling developers to extend the functionality of their applications as needed.
The architecture of the Remote MCP Server on Cloudflare is built around a layered design:
To get started with the Remote MCP Server on Cloudflare, follow these steps:
Clone the repository using Git:
git clone [email protected]:cloudflare/ai.git
Navigate to the project directory and install dependencies:
cd ai
npm install
Run the server locally for development purposes:
npx nx dev remote-mcp-server
This will start the server on http://localhost:8787/
, where you can access it through a web browser.
The Remote MCP Server on Cloudflare finds applications across multiple AI workflows, providing robust support for various use cases:
By integrating with real-time data streaming tools and APIs, users can process and analyze data as it comes in, enabling timely decision-making.
Allowing multiple developers to invoke models and tools simultaneously, this server supports collaborative work environments where tasks need to be executed across different stages or phases of a project.
OAuth 2.0 authentication ensures that only authorized users can access the MCP server, providing secure data access to critical information.
The Remote MCP Server on Cloudflare is compatible with several MCP clients, including:
Start the MCP Inspector:
npx @modelcontextprotocol/inspector@latest
Configure the MCP Inspector to connect to your local server:
SSE
and enter http://localhost:8787/sse
as the URL.email
, pass
.This setup enables Claude Desktop to interact with your Remote MCP Server through real-time data exchange.
|------------|-----------|-------|---------| | Claude Desktop | ✅ | ✅ | ✅ | Full Support | | Continue | ✅ | ✅ | ❌ (not supported) | Partial Support | | Cursor | ❌ (no support as of now) | ✅ | ❌ (not supported) | No Support |
To ensure advanced security and smooth operation, consider the following configurations:
API_KEY=your-unique-api-key
These environment variables can be configured during deployment for enhanced security.
If you experience issues connecting to your server:
rm -rf ~/.mcp-auth
Yes, the remote server can be deployed to multiple Cloudflare Worker accounts, allowing for scalability and redundancy.
OAuth is recommended but not mandatory. Simple HTTP authentication can also be used for basic needs, though security is enhanced with OAuth.
Clearing cached data and authentications may require you to log in again, ensuring the most up-to-date credentials are used.
Yes, by defining them in the MCP protocol-compliant format, both custom and third-party tools can be seamlessly integrated using this server.
SSE provides lower latency and more real-time capabilities compared to traditional HTTP requests, making it ideal for streaming data or notifications.
Contributions are welcome from the community! To start contributing:
git checkout -b feature/your-branch-name
.The Remote MCP Server on Cloudflare is part of a larger ecosystem:
This documentation aims to provide a comprehensive guide to implementing an MCP server on Cloudflare Workers and integrating it with multiple AI applications, ensuring robust performance and security.
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Python MCP client for testing servers avoid message limits and customize with API key
Discover easy deployment and management of MCP servers with Glutamate platform for Windows Linux Mac
Explore community contributions to MCP including clients, servers, and projects for seamless integration
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions