Deploy a remote MCP server on Cloudflare Workers without authentication for easy integration and customization
This example demonstrates how to deploy a remote Model Context Protocol (MCP) server without authentication on Cloudflare Workers, allowing AI applications to connect seamlessly using the standard protocol.
An MCP Server enables AI applications like Claude Desktop, Continue, Cursor, and others to interact with specific data sources and tools via a standardized protocol. Deploying this remote MCP server ensures that these applications can leverage external services or local tools by adhering strictly to the Model Context Protocol.
The Remote MCP Server enables AI clients to connect without requiring authentication. This setup is particularly useful for shared environments or testing scenarios where user authentication may not be necessary. Key features include:
src/index.ts
, allowing developers to integrate their preferred tools into this MCP server infrastructure.The architecture of this remote MCP server ensures compatibility with various AI applications. The Model Context Protocol (MCP) flow involves an AI Application interacting with a MCP Client, which then communicates via the MCP Server to access Data Source/Tools. Here's a diagram to illustrate:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
Imagine a scenario where an investment firm uses the remote MCP server to connect with financial APIs. The firm can use tools within the server to fetch real-time market data, analyze trends, and generate reports directly from Claude Desktop or another AI client.
In environmental monitoring applications, a remote MCP server could integrate with weather sensors and machine learning models to predict climate patterns. This setup allows users like researchers to quickly access relevant tools without extensive manual setup, enhancing the efficiency of their workflows.
Deploying your MCP server can be done through two methods: using the Cloudflare Worker deployment button or manually via the command line.
remote-mcp-server-authless.<your-account>.workers.dev/sse
.Run the following command to set up your MCP server locally:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
This Remote MCP Server is ideal for various AI application use cases, including:
To use this Remote MCP Server, follow these steps:
remote-mcp-server-authless.<your-account>.workers.dev/sse
).Similarly, integrate this server with Claude Desktop by configuring it as follows:
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse" // or remote-mcp-server-authless.your-account.workers.dev/sse
]
}
}
}
The compatibility matrix for this Remote MCP Server outlines its support across different MCP clients:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
For advanced configurations, consider the following:
src/index.ts
.Yes, but ensure that your server has appropriate concurrency support.
Check that you've correctly added and configured the tool within the init()
method of src/index.ts
.
Utilize Cloudflare's built-in security features for worker functions to ensure only expected clients can access your server.
The platform imposes no explicit limits, but practical limitations may arise based on tool complexity and resource usage.
Yes, it can be adapted for deployment on platforms like AWS or GCP by adjusting the hosting environment config.
Contributions to this project are encouraged. To contribute:
Explore more resources and tools in the broader Model Context Protocol ecosystem, including official documentation and community forums.
By leveraging this Remote MCP Server, developers can enhance their AI applications with robust tool integrations and seamless protocol compatibility.
Explore community contributions to MCP including clients, servers, and projects for seamless integration
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
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Powerful GitLab MCP Server enables AI integration for project management, issues, files, and collaboration automation
SingleStore MCP Server for database querying schema description ER diagram generation SSL support and TypeScript safety