Learn how to deploy and connect a remote MCP server on Cloudflare with OAuth, Inspector, and Claude integration
The Remote MCP Server is designed to facilitate seamless integration between various AI applications and tools through a standardized protocol called Model Context Protocol (MCP). This server acts as a gateway, enabling diverse AI clients like Claude Desktop, Continue, Cursor, and more to access specific data sources and functionalities in a unified manner. By leveraging the power of Cloudflare Workers, this remote MCP server can be easily deployed and scaled worldwide, providing consistent performance across different environments.
The Remote MCP Server supports multiple core features essential for modern AI workflows:
These capabilities are pivotal in ensuring that AI applications can easily adapt to new data sources, APIs, or functionalities without extensive customization.
The architecture of the Remote MCP Server is built around a clean separation of concerns, enabling efficient interaction between multiple components:
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
graph TD
A[AI Application] --> B[MCP Client]
B --> C[MCP Server]
C --> D[Data Store]
D --> E[Databases/Services]
style A fill:#e1f5fe
style B fill:#d9ece7
style C fill:#f3e5f5
style D fill:#e8f5e8
# Clone the repository
git clone [email protected]:cloudflare/ai.git
# Install dependencies
cd ai
npm install
# Run locally
npx nx dev remote-mcp-server
Opening http://localhost:8787/
in your browser should display the front-end of the server. This step is crucial for local testing and development.
Imagine a use case where an investment firm needs to analyze real-time market data. By deploying this Remote MCP Server, the firm can integrate various data sources like stock exchange APIs seamlessly into their AI-driven trading platform. The server will ensure that all trades and analyses conform to standard MCP protocols, making it easy for different tools to collaborate in real-time.
In an e-commerce setting, a user's history and preferences can be fed through the Remote MCP Server to generate highly personalized product recommendations. This setup allows different AI clients to use this data collaboratively, ensuring that each recommendation is tailored based on the latest analytics and user behavior.
Updating the configuration in Claude Desktop involves several steps:
{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
This configuration enables Claude to communicate with the Remote MCP Server via HTTP, allowing it to execute tools like mathematical computations seamlessly.
The following matrix highlights compatibility levels across different MCP clients:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
This matrix ensures that users understand the extent of functionality available for each client.
For advanced use cases, it's essential to follow these steps:
OAuth KV Namespace Setup:
npx wrangler kv namespace create OAUTH_KV
Wrangler Configuration Update:
wrangler.jsonc
.Deployment Command:
npm run deploy
Handling authentication securely is critical, as the server interacts with sensitive data and third-party services.
To ensure a secure OAuth flow, follow these best practices:
Yes, running the Remote MCP Server locally is straightforward. Use the provided npx nx dev remote-mcp-server
command to start a local instance for testing and debugging.
Common issues include incorrect URL details or misconfigured server settings. Check your server configuration and ensure that all dependencies are correctly installed.
Yes, you can use command line tools like npx mcp-remote
to directly interact with the server from a terminal, which is useful for troubleshooting specific issues.
Test each client's integration points using a predefined set of APIs and tools. Ensure that all functionalities work as expected in both local and production environments.
If you're interested in contributing to the Remote MCP Server project, follow these guidelines:
git clone [email protected]:cloudflare/ai.git
git checkout -b feature/new-feature
git commit -am 'Add some feature'
git push origin feature/new-feature
Contributions are welcomed, and community feedback is valuable!
For more information on the broader MCP ecosystem, visit:
Join the community for updates and support:
This comprehensive documentation provides a robust foundation for integrating diverse AI applications using Remote MCP Server, ensuring high performance and seamless collaboration.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Integrate AI with GitHub using MCP Server for profiles repos and issue creation
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Explore community contributions to MCP including clients, servers, and projects for seamless integration
Python MCP client for testing servers avoid message limits and customize with API key
Explore MCP servers for weather data and DigitalOcean management with easy setup and API tools