Cl

Cloudflare

Deploy, configure & interrogate your resources on the Cloudflare developer platform (e.g. Workers/KV/R2/D1)

#Cloudflare# Cloud Computing# Developer Platform
PublisherCloudflare
Submitted date4/11/2025

Unlocking LLM Potential: Cloudflare's Model Context Protocol (MCP) Server

The Model Context Protocol (MCP) is revolutionizing how Large Language Models (LLMs) interact with the real world. This open standard empowers developers to seamlessly connect LLMs to external data sources and tools, unlocking a new era of AI-powered applications. This repository provides both an installer and a dedicated MCP Server tailored for Cloudflare's robust API, enabling you to harness the power of natural language to manage and interact with your Cloudflare infrastructure.

Imagine using Claude Desktop, or any MCP-compatible client, to execute complex tasks with simple, intuitive commands:

  • "Deploy a new Worker with an example durable object."
  • "Summarize the data within my D1 database named '...'."
  • "Migrate all entries from my KV namespace '...' to my R2 bucket '...'."

This is the power of MCP, bringing natural language interaction to the heart of your Cloudflare workflows.

Connecting to the Remote MCP Server via Claude Desktop

Integrating with Claude Desktop is straightforward:

  1. Access Configuration: Open Claude Desktop and navigate to Settings -> Developer -> Edit Config. This will open the configuration file.

  2. Update Configuration: Replace the existing content with the following configuration snippet:

    { "mcpServers": { "cloudflare": { "command": "npx", "args": [ "mcp-remote", "https://mcp.cloudflare.com/workers/observability/sse" ] } } }
  3. Restart Claude Desktop: After restarting, a browser window will prompt you to authenticate via OAuth. This grants Claude the necessary permissions to access your MCP server.

  4. Enjoy Seamless Integration: Once authenticated, the Cloudflare tools will be readily available within Claude Desktop.

Important Note: Paid Features

Certain advanced features within this MCP server, specifically those related to Observability (prefixed with worker_logs_), require a paid Cloudflare Workers plan. Ensure your account has the appropriate subscription level to leverage these powerful capabilities.

Key Features

This MCP Server unlocks a range of powerful functionalities:

Workers Management

  • worker_list: Comprehensive listing of all Workers within your Cloudflare account.
  • worker_get_worker: Retrieve the complete script content of a specific Worker.

Workers Logs

  • worker_logs_by_worker_name: In-depth analysis of recent logs for a specific Cloudflare Worker, identified by its name.
  • worker_logs_by_ray_id: Cross-worker log analysis for a specific request, identified by its Cloudflare Ray ID.
  • worker_logs_keys: Discover the available telemetry keys for a Cloudflare Worker, enabling targeted log analysis.

Development Environment

This repository is structured as a monorepo, facilitating efficient development and code sharing.

Applications

Packages

  • eslint-config: Centralized ESLint configuration for consistent code style across all applications and packages.
  • typescript-config: Shared TypeScript configuration, ensuring consistent compilation settings.
  • mcp-common: A collection of shared tools and scripts designed to streamline monorepo management.

For detailed development guidance, refer to the apps/workers-observability directory.

Robust Testing Framework

This project utilizes Vitest as its primary testing framework, complemented by MSW (Mock Service Worker) for comprehensive API mocking.

Executing Tests

  • Run all tests:

    pnpm test
  • Run a specific test file:

    pnpm test -- tests/tools/queues.test.ts
  • Run tests in watch mode (for development):

    pnpm test:watch

Legacy Cloudflare MCP Server

Looking for the deprecated, local-only Cloudflare MCP Server? It's available on npm: https://www.npmjs.com/package/@cloudflare/mcp-server-cloudflare

Contributing

We welcome contributions! Please submit a Pull Request to contribute to the project.

Visit More

View All