Set up and connect remote MCP servers on Cloudflare Workers with OAuth, Claude, and MCP inspector tools
Remote MCP Server on Cloudflare enables developers to create and deploy an AI application integration point following the Model Context Protocol (MCP). This documentation will guide you through setting up, deploying, and integrating this server with various AI clients.
The Remote MCP Server provides a standardized way for AI services like Claude Desktop, Continue, and Cursor to interact with specific data sources or tools via the Model Context Protocol. It ensures seamless communication between these applications and remote backends through a well-defined protocol, making it an essential component in building robust AI workflows.
The Remote MCP Server supports key features such as OAuth login for secure integrations, SSE (Server-Sent Events) implementation for real-time data streams, and cross-platform compatibility with popular MCP clients. These capabilities allow developers to build flexible and scalable solutions that can adapt to different use cases.
The architecture of the Remote MCP Server is designed with scalability and flexibility in mind. It leverages Cloudflare Workers for handling requests efficiently, ensuring low latency and high performance. The server adheres to the Model Context Protocol, providing a standardized interface for AI applications to consume data or tools.
graph TD
A[AI Application] -->|Request| B[MCP Client]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD;
style DATA_A[attr] "data and metadata handling"
style SERVER_C[attr] "protocol adherence"
DATA_A -->|Request| TCP_REQUEST(Clients)
TCP_REQUEST(Clients) -->|MCP Protocol| MISC_FTP(Server)
SERVER_C -->|Response| TCP_RESPONSE(Tools)
TCP_RESPONSE(Tools) -->|Data Delivery| DATA_DELIVERY(Misc Data)
To set up the Remote MCP Server, follow these steps:
git clone [email protected]:cloudflare/ai.git
cd ai && npm install
npx nx dev remote-mcp-server
You should be able to access the server at http://localhost:8787/
.
The Remote MCP Server can be used in various AI workflows, such as data analysis and tool integration. For instance, an AI application could use this server to connect with a remote database for real-time analytics or perform complex calculations using external tools.
Imagine a financial analyst needs real-time stock price information from a remote API. By deploying the Remote MCP Server, they can seamlessly integrate this service into their existing workflow, allowing for dynamic and responsive data handling within their AI application.
The server is compatible with multiple MCP clients, including Claude Desktop, Continue, Cursor, and more. Here’s how you can connect these clients:
npx @modelcontextprotocol/inspector
to start the inspector.SSE
and enter the MCP server URL (http://localhost:8787/sse
).{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
The table below provides a detailed compatibility matrix for the Remote MCP Server:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
To securely deploy the Remote MCP Server:
npx wrangler kv namespace create OAUTH_KV
wrangler.jsonc
.graph TD;
style NAMESPACE[attr] "Cloudflare KV Namespace"
style REMOTE_C[attr] "Server Deployment"
NAMESPACE -->|Key-Value Storage| KVMgmt_Workers(Credentials)
KVMgmt_Workers -->|Environment Setup| REMOTE_C
REMOTE_C --> SERVER_API
Contributions are welcome! To contribute or report issues:
For more information on MCP and related projects, visit the official Model Context Protocol website and documentation. Additionally, join the community forums for support and collaboration.
By leveraging the Remote MCP Server, developers can streamline AI integration processes and ensure compatibility across multiple platforms. This server is a vital component in building robust and scalable AI applications, making it an indispensable tool for developers working on complex workflows.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration