CM

cloudflare/mcp

API development公式

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1030 stars 155 forks 品質 74 トレンド 50Apache-2.0

Cloudflare API用のMCPサーバー

概要

Cloudflare API全体に対応するトークン効率の良いMCPサーバー。1kトークンで2500エンドポイント、コードモード駆動。 MCPサーバーのURLに接続するだけで、権限の承認と選択のためにCloudflareにリダイレクトされます。 CI/CDや自動化、あるいはトークン管理を自分でやりたい場合など。 必要な権限を持つCloudflare APIトークンを作成しましょう。両方ともサポートされています。アカウントトークンについては、サーバーがアカウントIDを自動検出できるように権限を含めてください。 有効化されたAPIトークンは現在サポートされていません。 もしMCPクライアントがすでにコードモードを使っている場合、またはこのサーバーを別のサーバーと組み合わせていてコードモードを使う場合は、?codemode=falseクエリパラメータで無効にできます。これにより、コードモードAPIツールの代わりに~2,500のCloudflare APIエンドポイントそれぞれに個別のツールが登録されます。ドキュメントツールは両方のモードで利用可能です。 コードモードが無効化された場合:- 各APIエンドポイントは独自のツールとして登録されます(例:

概要(AI 翻訳)

Cloudflare API全体のためのトークン効率の良いMCPサーバー。1kトークンで2500エンドポイントを搭載し、コードモードで動作します。

トークン比較

アプローチ ツール トークンコスト 使用コンテキスト(200K)
プロンプト内のRaw OpenAPI仕様 — ~2,000,000 977%
ネイティブMCP(フルスキーマ) 2,594 1,170,523 585%
ネイティブMCP(最小限 — 必要なパラメータのみ) 2,594 244,047 122%
コードモード 3 ~1,100 0.5%

始めよう

MCP URL: https://mcp.cloudflare.com/mcp

オプション1:OAuth(推奨)

MCPサーバーのURLに接続するだけで、権限の承認と選択のためにCloudflareにリダイレクトされます。

例 JSON 構成

オプション2:APIトークン

CI/CDや自動化、あるいはトークン管理を自分でやりたい場合など。

必要な権限を持つCloudflare APIトークンを作成してください。ユーザートークンとアカウントトークンの両方がサポートされています。アカウントトークンについては、サーバーが自動的にアカウントIDを検出できるようにアカウントリソース:読み取り権限を含めてください。

**注:クライアントIPアドレスフィルタリングが有効化されたAPIトークンは現在サポートされていません。

エージェントに追加

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Cloudflare MCP Server

A token-efficient MCP server for the entire Cloudflare API. 2500 endpoints in 1k tokens, powered by Code Mode.

Token Comparison

Approach Tools Token cost Context used (200K)
Raw OpenAPI spec in prompt — ~2,000,000 977%
Native MCP (full schemas) 2,594 1,170,523 585%
Native MCP (minimal — required params only) 2,594 244,047 122%
Code mode 3 ~1,100 0.5%

Get Started

MCP URL: https://mcp.cloudflare.com/mcp

Just connect to the MCP server URL - you’ll be redirected to Cloudflare to authorize and select permissions.

Example JSON Configuration

{
  "mcpServers": {
    "cloudflare-api": {
      "type": "http",
      "url": "https://mcp.cloudflare.com/mcp"
    }
  }
}

Option 2: API Token

For CI/CD, automation, or if you prefer managing tokens yourself.

Create a Cloudflare API token with the permissions you need. Both user tokens and account tokens are supported. For account tokens, include the Account Resources : Read permission so the server can auto-detect your account ID.

Note: API tokens with Client IP Address Filtering enabled are not currently supported.

Add to Agent

Setting Value
MCP URL https://mcp.cloudflare.com/mcp
Bearer Token Your Cloudflare API Token

Disable Code Mode

If your MCP client already uses code mode, or you’re composing this server with another server that uses code mode, you can disable it with the ?codemode=false query parameter. This registers an individual tool for each of the ~2,500 Cloudflare API endpoints instead of the code mode API tools. The docs and whoami tools remain available in both modes.

https://mcp.cloudflare.com/mcp?codemode=false

Example JSON Configuration

{
  "mcpServers": {
    "cloudflare-api": {
      "type": "http",
      "url": "https://mcp.cloudflare.com/mcp?codemode=false"
    }
  }
}

When code mode is disabled:

  • Each API endpoint is registered as its own tool (e.g., get_workers_scripts, post_d1_database)
  • Tool input schemas are derived from the endpoint’s path parameters, query parameters, and request body
  • Tools make direct API calls — no code execution involved
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "cloudflare-api": { "type": "http", "url": "https://mcp.cloudflare.com/mcp" } } }