{
  "markdown": "# Cloudflare MCP\n\n<p align=\"right\">\n    <b>English</b> | <a href=\"./README_zh.md\">简体中文</a>\n</p>\n\n[![GitHub last commit](https://img.shields.io/github/last-commit/ZhanZiyuan/cloudflare-mcp)](https://github.com/ZhanZiyuan/cloudflare-mcp/commits/main/)\n[![GitHub License](https://img.shields.io/github/license/ZhanZiyuan/cloudflare-mcp)](https://github.com/ZhanZiyuan/cloudflare-mcp/blob/main/LICENSE)\n[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/ZhanZiyuan/cloudflare-mcp/total)](https://github.com/ZhanZiyuan/cloudflare-mcp/releases)\n\nThis is an extension for the Gemini CLI that integrates Cloudflare's Model Context Protocol (MCP) servers.\nIt allows you to interact with various Cloudflare services (such as Workers, R2, DNS, Logs, etc.) using natural language.\n\nThis project uses mcp-remote to connect to Cloudflare-hosted remote MCP endpoints.\n\n## Project Directory Structure\n\n```text\ncloudflare-mcp/\n├── commands/\n│   └── cloudflare/\n│       ├── dev.toml      # Development commands (Workers, Builds, Bindings)\n│       ├── ops.toml      # Operations commands (Observability, Logs, Audit)\n│       └── info.toml     # Information commands (Docs, Radar, GraphQL)\n├── GEMINI.md             # AI assistant system prompts and context configuration\n├── gemini-extension.json # Core extension configuration and MCP server registry\n├── README.md             # English documentation\n└── README_zh.md          # Chinese documentation\n```\n\n## Prerequisites\n\n- **Gemini CLI**: Ensure the Gemini CLI environment is installed and configured.\n- **Node.js & NPM**: This extension relies on npx to run mcp-remote. Ensure Node.js is in your system path.\n- **Cloudflare Account**: A valid Cloudflare account is required to obtain API credentials.\n\n## Configuration and Installation\n\n### Configure Environment Variables (Critical Step)\n\nSetting the `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` is a critical step to ensure the Gemini CLI can securely authenticate with Cloudflare via the MCP protocol. Without these credentials, the remote MCP servers will reject connection requests.\n\nYou need to obtain an API Token from the [Cloudflare Dashboard](https://dash.cloudflare.com/profile/api-tokens). It is recommended to create a Token with Read/Write permissions for the services you intend to use (e.g., Workers, DNS, Logs).\n\nAdd the following to your terminal configuration file (e.g., `.bashrc`, `.zshrc`, or `PowerShell profile`), or export them in the current session before running the Gemini CLI:\n\n- **macOS / Linux:**\n\n    ```bash\n    export CLOUDFLARE_API_TOKEN=\"your_api_token\"\n    export CLOUDFLARE_ACCOUNT_ID=\"your_account_id\"\n    ```\n\n- **Windows (PowerShell):**\n\n    ```powershell\n    $env:CLOUDFLARE_API_TOKEN=\"your_api_token\"\n    $env:CLOUDFLARE_ACCOUNT_ID=\"your_account_id\"\n    ```\n\n### Link the Extension\n\n- Navigate to the project root directory in your terminal and run the following command to link the extension to the Gemini CLI:\n\n    ```bash\n    gemini extensions link .\n    ```\n\n    Once linked, restart the Gemini CLI for changes to take effect.\n\n- Or install the extension using the following command:\n\n    ```bash\n    gemini extensions install https://github.com/ZhanZiyuan/cloudflare-mcp\n    ```\n\n## Usage\n\nThis extension registers commands under the `cloudflare` group. You invoke them using the `/` prefix followed by `group:command`.\n\n- **Development Tasks (Workers, Builds)**: invokes commands defined in `commands/cloudflare/dev.toml`:\n\n    ```text\n    /cloudflare:dev \"List my recent Worker build statuses\"\n    ```\n\n- **Operations & Monitoring (Logs, Analytics)**: invokes commands defined in `commands/cloudflare/ops.toml`:\n\n    ```text\n    /cloudflare:ops \"Check for DNS resolution errors in the last hour\"\n    ```\n\n- **Information Retrieval (Docs, Radar)**: invokes commands defined in `commands/cloudflare/info.toml`:\n\n    ```text\n    /cloudflare:info \"How do I use KV storage in Cloudflare Workers?\"\n    ```\n\nThe AI will automatically detect your language preference and respond in English or Chinese\nbased on the configuration in [GEMINI.md](./GEMINI.md).\n\n---\n\n*Based on the [Gemini CLI Extensions Guide](https://geminicli.com/docs/extensions/getting-started-extensions/) and [Cloudflare Agents docs](https://developers.cloudflare.com/agents/model-context-protocol/mcp-servers-for-cloudflare/).*\n",
  "bytes": 4370,
  "sha": "8a9ac42c2a1c7278622d5f0d8a72bbf9036bb2c89d617f90c4c555fd01880d73",
  "repo_slug": "zhanziyuan/cloudflare-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_zhanziyuan_cloudflare_mcp_a157787c/readme"
}