cloudflare-mcp
cloudflare-mcp v1.0.0
Cloudflareエコシステム全体のためのユニバーサルModel Context Protocol (MCP)サーバー。 16個の断片化されたリモートMCPエンドポイントを、単一の高性能ローカルサーバーに置き換えます。
機能(7つの統合ツール)
cf_dns: ゾーン、DNSレコード(A、CNAME、TXT、MXなど)、CDNキャッシュパージcf_compute: Cloudflare Workers、KVキーバリューストレージ、サーバーレスD1 SQLデータベース実行cf_storage: R2オブジェクトストレージバケット、Vectorizeベクターデータベースクエリcf_ai: Workers AI推論(Llama、DeepSeek、Embeddings)、AI Gatewayログとテレメトリcf_security: Zero Trustトンネル(cloudflared)、WAFファイアウォールルール、監査ログcf_radar: Radar URLスキャナー、グローバルトラフィック/攻撃分析、GraphQLクエリcf_api: ユニバーサルREST APIゲートウェイ(2,500以上のCloudflareエンドポイントに直接アクセス)
Related MCP server: mcp-server-cloudflare
設定
Cloudflare APIトークンを環境変数に設定するか、~/.secrets/cloudflare-token.txtに保存してください:
export CLOUDFLARE_API_TOKEN="your-cloudflare-api-token"
export CLOUDFLARE_ACCOUNT_ID="your-account-id" # Optional, automatically discovered if omittedMCPクライアントへのインストール(Claude Desktop、OpenCode、Cursor、Windsurf)
オプション1:uvxによる即時インストール(推奨)
{
"mcpServers": {
"cloudflare": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Steph-ux/cloudflare-mcp.git", "cloudflare-mcp"]
}
}
}オプション2:pip installによるインストール
pip install git+https://github.com/Steph-ux/cloudflare-mcp.git次に、MCP設定ファイルに以下を追加します:
{
"mcpServers": {
"cloudflare": {
"command": "cloudflare-mcp"
}
}
}オプション3:ローカルクローン(開発用)
{
"mcpServers": {
"cloudflare": {
"command": "python",
"args": ["D:\\Steph\\script\\cloudflare-mcp\\server.py"]
}
}
}使用例
1. DNS管理
# List zones:
cf_dns(action='list_zones')
# Create DNS record:
cf_dns(
action='create_record',
zone_id='example.com',
type='A',
name='api',
content='192.168.10.1',
proxied=True
)
# Purge CDN cache:
cf_dns(action='purge_cache', zone_id='example.com', purge_everything=True)2. D1 SQLデータベースとWorkers
# Query D1 SQL database:
cf_compute(
action='d1_query',
database_id='YOUR_D1_DATABASE_ID',
sql='SELECT * FROM users WHERE active = 1 LIMIT 10;'
)
# Store key-value in KV:
cf_compute(
action='kv_put',
namespace_id='YOUR_KV_NAMESPACE_ID',
key_name='session_token',
value='xyz123'
)3. R2オブジェクトストレージ
# List buckets:
cf_storage(action='list_r2')
# Create bucket:
cf_storage(action='create_r2', bucket_name='my-app-assets', location_hint='weur')4. Workers AI推論
# Run Llama 3 on Cloudflare edge:
cf_ai(
action='run_model',
model='@cf/meta/llama-3.1-8b-instruct',
prompt='Write a python snippet for async retry logic.'
)5. Radar URLスキャンとセキュリティ
# Scan URL for malware & phishing via Cloudflare Radar:
cf_radar(action='scan_url', url='https://target-to-scan.com')
# List active Zero Trust Tunnels:
cf_security(action='list_tunnels')6. ユニバーサルRESTゲートウェイ(cf_api)
# Call any specific Cloudflare v4 REST endpoint:
cf_api(method='GET', path='/user')テスト
pytest testsライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Cloudflare Workers MCP server: api-composition-gateway
Cloudflare Workers MCP server: api-landing
Cloudflare Workers MCP server: ai-gateway
Related MCP Servers
AlicenseAqualityAmaintenanceLets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things on your Cloudflare account.22,155 npm4,409Apache 2.0- AlicenseAqualityDmaintenanceMCP server to manage Cloudflare Workers, KV, R2, Pages, DNS, and cache from your IDE.1317 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables managing Cloudflare domains, DNS records, SSL certificates, zone operations, analytics, and cache purging via MCP or CLI.11 npmMIT
- AlicenseBqualityBmaintenanceA local stdio MCP server that provides 69 tools for Cloudflare REST API v4, including DNS, Zones, Workers, KV, R2, D1, Pages, Queues, Tunnels, SSL, WAF, Email Routing, Logpush and Workers AI, authenticated by a single API token.6936 npm3MIT