Learn how to deploy and manage an authentication-free remote MCP server on Cloudflare Workers efficiently.
This example showcases how to deploy a remote Model Context Protocol (MCP) server that does not require authentication on Cloudflare Workers. The server allows AI applications such as Claude Desktop, Continue, Cursor, and others to connect to specific data sources and tools through the Model Context Protocol with ease.
The core capabilities of this Remote MCP Server include:
Deployment Options:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
git clone <repository-url>
cd <repository-directory>
npm install
npx wrangler login
npx wrangler deploy
Securing Secrets:
.dev.vars
files.Customization: Add tools through the init()
method of your custom implementation class.
Imagine integrating a financial analysis tool that provides stock price predictions into an AI application like Claude Desktop. This integration can be achieved by setting up a Remote MCP Server with tools for fetching and analyzing stock data, which Claude can query directly.
Deploy a medical diagnosis tool on the Remote MCP Server to enable doctors or AI applications to gather patient symptoms, retrieve relevant diagnoses from a database, and suggest treatment options via MCP requests.
The architecture of this Remote MCP Server leverages Cloudflare Workers for hosting the server. The server interacts with clients using the Model Context Protocol (MCP) over SSE (Server-Sent Events).
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
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | Full Support | |
Cursor | ❌ (Limited) | ✅ | Tools Only |
To quickly get started, use the one-click deploy button:
Alternatively, follow these manual steps:
git clone <repository-url>
cd <repository-directory>
npm install
npx wrangler login
npx wrangler deploy
A financial analysis tool can provide valuable data to AI applications like Claude Desktop for making informed investment decisions.
Medical professionals and AI healthcare solutions can benefit from deploying a remote medical diagnosis tool, enhancing diagnostic accuracy with real-time patient data integration.
Ensure compatibility between your Remote MCP Server and various MCP clients. The following steps outline how to connect the server:
<server-url>/sse
The performance and compatibility of this server are designed to ensure seamless integration with various MCP clients, focusing on real-time data exchanges and optimal resource utilization.
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
npx wrangler secret put
to securely store sensitive data.// Example in src/index.ts
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const apiKey = env.YOUR_SECRET_NAME;
// ... rest of your code
},
};
Can I integrate this server with multiple MCP clients?
How do I manage secrets securely?
What are the performance implications of deploying this server?
Can I customize tools beyond what is provided in the examples?
init()
method in src/index.ts
.Is there a limit to the number of tools I can add?
Contributions are welcome! Fork the repository and submit pull requests with your features or improvements. Ensure all code adheres to our coding standards and includes necessary tests.
Explore the broader MCP ecosystem, including resources for developers working on AI applications:
This comprehensive guide positions the Remote MCP Server as a robust tool for integrating various AI applications with custom data sources and tools. By leveraging Cloudflare Workers, developers can easily deploy and manage their servers while maintaining high performance and security standards.
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
Connects n8n workflows to MCP servers for AI tool integration and data access
Expose Chicago Public Schools data with a local MCP server accessing SQLite and LanceDB databases
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support