mcp-server-cloudflare
Updated at 15 days ago
by cloudflare
297
on GitHub
Tags
What is mcp-server-cloudflare
mcp-server-cloudflare is a lightweight xDS server built using Cloudflare Workers. It leverages Cloudflare's global network and serverless platform to provide a scalable and reliable control plane for services using the xDS (Envoy's discovery service) protocol. Specifically, it targets services written in Rust and using the mcp
crate from the same Cloudflare organization. It's intended to be deployed as a Cloudflare Worker, providing a managed xDS server. The server manages configuration data via durable objects.
How to use
To use mcp-server-cloudflare
, you'll need to deploy it as a Cloudflare Worker. This involves:
-
Deploying the Worker: The project is designed to be built and deployed using the Workers CLI (Wrangler). The README includes information about required environment variables (
MCP_SERVER_AUTH_TOKEN
andMCP_NAMESPACE
). -
Authentication: The server uses an authentication token (
MCP_SERVER_AUTH_TOKEN
) to control access, allowing only authorized clients to push configuration updates. -
Configuration Updates: Clients using the
mcp
crate can then push configuration data to the Worker. -
xDS Discovery: Envoy-compatible services (or services using the
mcp
crate's client functionality) can then discover and retrieve configuration from the deployed Worker.
Key features
- Cloudflare Workers Integration: Built specifically to leverage Cloudflare's serverless platform for scalability and global reach.
- xDS Protocol Support: Implements the xDS protocol, making it compatible with Envoy and other xDS-enabled services.
- Rust-based: Written in Rust, offering performance and safety benefits.
- Authentication: Uses an authentication token for secure access.
- Durable Object Persistence: Configuration is managed with durable objects.
Use cases
- Service Mesh Control Plane: Provide a lightweight control plane for service meshes built with Envoy.
- Dynamic Configuration Management: Dynamically configure and update service behavior without requiring restarts.
- Traffic Management: Implement traffic routing and load balancing strategies.
- Feature Flagging: Control feature availability to different user segments.
FAQ
- What is xDS? xDS (Envoy's discovery service) is a suite of discovery protocols used by Envoy proxy and other services for dynamic configuration.
- Why use Cloudflare Workers for an xDS server? Cloudflare Workers provide a scalable, globally distributed, and cost-effective platform for running an xDS server.
- How do I authenticate with the server? You need to provide the correct
MCP_SERVER_AUTH_TOKEN
when pushing configurations. - What is
mcp
crate? It's a rust crate from cloudflare that implement xDS protocal. - How does the server store the configurations? The server is using durable objects for persistence.
- Is this server only for Rust-based services? While it's designed to integrate well with Rust services using the
mcp
crate, any xDS compatible service can utilize the service.