Learn how to set up and connect a remote MCP server on Cloudflare with OAuth and integrations
This document provides detailed instructions and technical guidance to set up, deploy, and integrate an MCP (Model Context Protocol) server on Cloudflare Workers, with a focus on enabling seamless AI application integration.
The Remote MCP Server enables the connection of AI applications like Claude Desktop, Continue, Cursor, and other compatible clients to various data sources and tools. By leveraging Model Context Protocol (MCP), this server serves as a bridge for these AI apps to perform operations such as calculations, database queries, or any other contextual tasks.
The Remote MCP Server offers several key features that empower integration with different AI applications:
These capabilities are essential for developers looking to build robust AI workflows, ensuring seamless interaction between their applications and external data sources or tools.
The architecture of the Remote MCP Server is designed to adhere strictly to the Model Context Protocol (MCP). This includes:
graph TB
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
graph TB
A[Persistent Storage] --> B[MCP Server Cache]
B --> C[SSE Stream]
C --> D[AI Application]
E[MPC Client] --> F[MCP Server Endpoint]
style A fill:#f5ede8
style C fill:#d6e9c7
To get started, follow these steps to set up and deploy the Remote MCP Server on Cloudflare Workers.
Clone the Repository
git clone [email protected]:cloudflare/ai.git
Install Dependencies
cd ai
npm install
Run Locally
npx nx dev remote-mcp-server
You should be able to open http://localhost:8787/
in your browser.
To explore and interact with the API:
npx @modelcontextprotocol/inspector@latest
http://localhost:8787/sse
.{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
worker-url
when deploying remotely.Real-Time Data Processing: Integrate real-time data processing tools within an AI application.
Interactive User Interface: Enable interactive prompts for users to call specific tools or services.
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
The Remote MCP Server is optimized for:
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
rm -rf ~/.mcp-auth
.Why does My MCP Client Not Work?
How Do I Secure My Integration?
Can I Deploy on a Different Platform?
What Tools are Compatible?
How Do I Debug MCP Server Issues?
Contributions to this project are welcome! Please follow these guidelines:
Explore more about Model Context Protocol (MCP) in the official documentation and community forums. Additionally, stay updated on the latest developments by following the Cloudflare Worker blog.
By leveraging the Remote MCP Server, developers can enhance their AI applications with powerful tool integration, ensuring a seamless user experience across multiple platforms and services.
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
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Expose Chicago Public Schools data with a local MCP server accessing SQLite and LanceDB databases
Connects n8n workflows to MCP servers for AI tool integration and data access