Learn how to deploy a no-auth MCP server on Cloudflare Workers and connect with AI tools easily.
This example allows you to deploy a remote MCP server that doesn't require authentication on Cloudflare Workers, providing a universal adapter for AI applications.
An MPC (Model Context Protocol) server enables AI applications like Claude Desktop, Continue, Cursor, and others to connect to specific data sources and tools via a standardized protocol. This remote server variant simplifies deployment without the need for authentication, making it accessible from various devices.
The server uses Server-Sent Events (SSE) over HTTP/2 for real-time communication with AI applications, ensuring efficient data streaming and low latency.
You can add your own tools to the MCP server by defining them inside the init()
method of src/index.ts
using this.server.tool(...)
. This allows you to extend the functionality of your remote server according to specific needs.
To deploy this server, you can utilize a pre-built template via NPM or the provided Cloudflare Workers button:
Using NPM:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
Alternatively: Click here to automatically deploy the server.
Once deployed, you can connect your AI applications to this MCP server using the following steps:
Connect to Cloudflare AI Playground:
remote-mcp-server-authless.<your-account>.workers.dev/sse
)Connect Claude Desktop:
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
Ensure you have the necessary development environment set up:
Clone Repository:
git clone https://github.com/cloudflare/ai.git
cd ai/demos/remote-mcp-authless
Initialize Project: Run the following command:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
Deploy to Cloudflare Workers:
Follow the link provided or use npm run deploy
within your project directory.
Imagine an AI application designed for financial analysts. By integrating a remote MCP server deployed on Cloudflare, you can provide real-time stock price updates and predictive analysis tools directly through the server.
init()
method of src/index.ts
.mcp-remote
command to connect the AI application to these tools.A customer service chatbot could use a remote MCP server to analyze and categorize customer feedback from social media. Tools like sentiment analysis could be added directly into the server.
init()
for sending the analyzed results back.The following table shows the compatibility of various MCP clients with this remote server:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
{
"mcpServers": {
"calculator": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
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
Real-time updates between the AI application and tools via SSE ensure efficient data streaming.
You can extend the functionality of your remote server by defining new tools within the init()
method. Each tool is added using this.server.tool(...)
.
How do I integrate tools into the remote MCP server?
src/index.ts
using this.server.tool()
. Each utility can perform specific tasks like data analysis or integration with external APIs.What is the compatibility matrix for this remote MCP server?
How do I connect the Cloudflare AI playground to my deployed server?
remote-mcp-server-authless.<your-account>.workers.dev/sse
) in the AI Playground interface and use the available tools directly.Can this remote MCP server be used with other AI frameworks besides Claude Desktop?
mcp-remote
command-line utility or API keys.What are some security best practices for deploying an MCP server on Cloudflare Workers?
Install Dependencies:
npm install
Run Locally:
npm run start
Contribute to Open Source:
Deploying a remote authless MCP server on Cloudflare provides a scalable and secure solution for integrating various AI applications with external tools and data sources. With flexibility in customization and wide compatibility, this server caters to developers looking to enhance their AI workflows through standardized protocols.
By following the detailed steps outlined here, you can set up your own MCP server and seamlessly integrate it into existing or new AI applications.
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
Explore community contributions to MCP including clients, servers, and projects for seamless integration
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