Learn how to deploy and connect a remote MCP server on Cloudflare Workers without authentication
This example allows you to deploy a remote MCP server that does not require authentication on Cloudflare Workers.
The Remote MCP Server is designed as an adapter for AI applications, facilitating seamless integration with data sources and tools. By leveraging the Model Context Protocol (MCP), this server ensures compatibility across various AI clients such as Claude Desktop, Continue, Cursor, and others. The goal is to provide a standardized approach that enhances the versatility and efficiency of AI workflows.
The Remote MCP Server introduces several key capabilities designed for seamless integration with AI applications:
init()
method within src/index.ts
. The this.server.tool(...)
directive enables integration with a wide range of tools, enhancing the AI application's operational capabilities.The architecture of the Remote MCP Server is built on top of Cloudflare Workers and adheres to the Model Context Protocol (MCP). This protocol ensures that data flows efficiently between the client and server in a standardized manner. Below are the core components of the implementation:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
This diagram illustrates the flow of data from an AI application (through a MCP client) to the Remote MCP Server and subsequently to external tools or data sources.
graph TD
A[AI Application] ---|MCP Client| B[MCP Server]
B -- Request for Tool --> C[Tool Integration Layer]
C -- Tool Response --> D[MCP Protocol Response]
This diagram visualizes how data is processed within the server, starting from the request made by an MCP client and ending with a response containing tool integration.
Getting started with the Remote MCP Server involves two primary methods: using Cloudflare's deployment platform or initiating a local installation via the command line.
Deploying through the Cloudflare Worker platform is straightforward:
When you use this button, it will deploy your MCP server to a URL like: remote-mcp-server-authless.<your-account>.workers.dev/sse
For local testing and development purposes, you can install the Remote MCP Server using npm:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
This command initializes a project with all necessary dependencies for further customizations.
The Remote MCP Server is particularly useful in various AI workflows, such as:
Imagine you're building an AI-driven market research tool. You can use the Remote MCP Server to connect it with financial APIs, social media platforms, and analytics tools. This integration allows your AI application to fetch up-to-date market trends, customer feedback, and competitive analysis automatically.
In a CRM system integrated with an AI chatbot, you can leverage the Remote MCP Server to dynamically access customer data from various databases. The bot can provide personalized recommendations based on real-time data analytics, enhancing user experience significantly.
Integration with MCP clients like Claude Desktop involves setting up the MCP server as a remote resource accessible via the mcp-remote
proxy tool. Below is an example of how to configure this integration:
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse" // or remote-mcp-server-authless.your-account.workers.dev/sse
]
}
}
}
This configuration instructs the client to connect to your MCP server via a specified URL.
The Remote MCP Server is compatible with several popular MCP clients:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
For advanced configurations and security settings, you can modify the environment variables and command-line arguments during deployment. For example:
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
This configuration snippet allows you to set specific environment variables, enhancing security or customizing behavior.
A1: The server supports authless deployment by default. For production environments, consider integrating with a token management system before deploying.
A2: Yes, you can extend or replace tools using the this.server.tool(...)
directive in the init()
method of src/index.ts
.
A3: The server is primarily designed for use with Claude Desktop, Continue, and Cursor. Support for other clients may vary.
A4: Regular updates are published through npm whenever there are changes in the underlying libraries. Follow the package management system for such notifications.
A5: Yes, while this guide focuses on deploying with Cloudflare Workers, you can adapt the setup to deploy it elsewhere using the same codebase but adjusting the deployment process accordingly.
Contributions are welcome to enhance the capabilities and functionality of the Remote MCP Server. Potential contributors should follow these guidelines:
For more information on the Model Context Protocol, visit ModelContextProtocol.io. Additionally, explore resources and documentation available to deepen your understanding of MCP implementation and application.
AI Vision MCP Server offers AI-powered visual analysis, screenshots, and report generation for MCP-compatible AI assistants
Analyze search intent with MCP API for SEO insights and keyword categorization
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
MCP server for accessing and managing IMDB data with notes, summaries, and tools
Learn how to try Model Context Protocol server with MCP Client and Cursor tools efficiently
Connects n8n workflows to MCP servers for AI tool integration and data access