Deploy and customize remote MCP server on Cloudflare Workers without authentication
This example guides you through deploying a remote Model Context Protocol (MCP) server without requiring authentication, leveraging Cloudflare Workers.
A remote MCP server serves as a critical piece in the AI application ecosystem by enabling seamless integration of custom tools and data sources. This particular instance demonstrates how such a server can be quickly deployed via Cloudflare's extensive network, ensuring low latency and high reliability for global users.
The core focus of this remote MCP server is to provide a straightforward mechanism for AI applications like Claude Desktop, Continue, or Cursor to access tools and data without the need for API keys. Key features include:
The architecture revolves around the Model Context Protocol (MCP), which defines a standard method for communication between AI applications and remote servers. This implementation leverages Cloudflare Workers, allowing for rapid deployment and execution in a secure environment.
graph TD
A[AI Application] -->|MCP Client| B[MCP Server]
B --> C[Custom Tool/DataSource]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
graph TB
subgraph Database Layer
D[NPC Service]
E[API Gateway]
F[Cache Layer]
end
subgraph Application Layer
G[MCP Server Endpoint]
H[API Proxy]
I[Web Interface]
end
subgraph Tool Layer
J[Tool A]
K[Tool B]
L[Custom Tool]
end
D --> E
E --> F
F --> G
G --> H
H --> I
I --> J
I --> K
I --> L
Quickly deploy your own MCP server using the following steps:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
This remote MCP server is particularly useful for scenarios where dynamic tool integration and quick onboarding are crucial:
A user can integrate their remote MCP server with a news API, stock market data, and a custom sentiment analysis tool. By leveraging the MCP protocol, the AI application (e.g., Claude Desktop) can fetch real-time financial news, process sentiments, and provide actionable insights to users.
{
"mcpServers": {
"financial-analysis": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8787/sse"]
}
}
}
Compatibility matrix for various MCP clients:
MCP Client | Claude Desktop | Continue | Cursor |
---|---|---|---|
Resources | ✅ | ✅ | ❌ |
Tools | ✅ | ✅ | ✅ |
Prompts | ✅ | ✅ | ❌ |
Status | Full Support | Full Support | Tools Only |
This server is optimized for high performance with minimal latency. It ensures compatibility across multiple platforms and versions, making it a reliable choice for production environments.
Customize your MCP server by editing the src/index.ts
file to define tools using this.server.tool(...)
. Ensure security best practices are followed, such as network isolation, encryption, and regular audits.
Can I run this server without authentication? Yes, this demo setup does not require any kind of user authentication, making it ideal for rapid prototyping and testing environments.
How do I integrate custom tools into the server?
Define your tools in the src/index.ts
file using this.server.tool(...)
. This allows you to add new functionalities without changing existing code.
Which AI applications are compatible with this setup? The server is designed to be fully compatible with Claude Desktop, Continue, and Cursor, enabling seamless integration of custom tools in your workflows.
Is this MCP server suitable for production use? While the setup is optimized for performance, robust security practices must be implemented before going live, including proper access controls and data encryption.
Can I change the protocol behavior?
Yes, you can modify the protocol behavior by updating the configuration in src/index.ts
to suit your specific needs.
To contribute to this project:
git clone https://github.com/cloudflare/ai.git
Explore more about Model Context Protocol (MCP) on its official documentation site: ModelContextProtocol.io. Connect with the community through forums, GitHub issues, and regular updates.
By deploying this remote MCP server without authentication, developers can integrate custom tools and data into AI applications efficiently. The setup provides a scalable solution that meets the demands of modern AI workflows while ensuring flexibility and performance.
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
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
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