# Cloudflare — how to use (mcp.ai)

Connect your Cloudflare account and use 20 tools for security and identity straight from your AI agent. Connect with your own API key. Cloudflare is a global network designed to make everything you connect to the Internet secure, private, fast, and reliable.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cloudflare?ms=1787295780000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `cloudflare_create_dns_record`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cloudflare`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/cloudflare/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cloudflare/create/dns/record` — Tool to create a new DNS record within a specific zone. Requires write privileges and makes live changes to the zone. Use after obtaining the zone ID via CLOUDFLARE_LIST_ZONES to programmatically add 
  - body: { ttl?: integer, data?: object, name: string, tags?: string[], type: string, comment?: string, content: string, proxied?: boolean, priority?: integer, zone_identifier: string }
- `POST https://api.mcp.ai/api/cloudflare/create/list` — Create a new empty custom list for use in WAF rules and filters. Lists can contain IP addresses, hostnames, ASNs, or redirects. Once created, use separate actions to add items to the list. Note: List 
  - body: { kind: string, name: string, account_id: string, description?: string }
- `POST https://api.mcp.ai/api/cloudflare/create/zone` — Creates a new DNS zone (domain) in Cloudflare. A zone represents a domain and its DNS records. Use this when adding a new domain to manage with Cloudflare. Requires account ID (obtainable via LIST_ACC
  - body: { name: string, type?: string, account?: object, jump_start?: boolean }
- `POST https://api.mcp.ai/api/cloudflare/delete/dns/record` — Tool to delete a DNS record within a specific zone. Deletion is immediate and irreversible. Use only after confirming both zone and record IDs. Requires write privileges on the zone. Example: "Delete 
  - body: { identifier: string, zone_identifier: string }
- `POST https://api.mcp.ai/api/cloudflare/delete/list` — Tool to delete a WAF list. Use when you need to remove a list after verifying no filters reference it. Example: DELETE_LIST(account_id="<account_id>", list_id="<list_id>")
  - body: { list_id: string, account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/delete/zone` — Tool to delete a zone. Use after confirming the zone identifier to permanently remove a DNS zone and all its DNS records from your Cloudflare account. Example: DELETE_ZONE(zone_identifier="023e105f4ec
  - body: { zone_identifier: string }
- `POST https://api.mcp.ai/api/cloudflare/get/bot/management/settings` — Tool to retrieve a zone's Bot Management configuration (Bot Fight Mode / Super Bot Fight Mode / Enterprise Bot Management). Use after identifying the correct zone_id (e.g., via CLOUDFLARE_LIST_ZONES).
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare/get/lists` — Tool to fetch all WAF lists (no items) for an account. Results are paginated; iterate using page and per_page parameters until result_info.total_pages is reached to retrieve all lists. Use after confi
  - body: { account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/list/account/members` — Lists all members of a Cloudflare account with their roles, permissions, and status. Returns detailed information about each account member including their user details (name, email, 2FA status), assi
  - body: { page?: integer, order?: string, status?: string, per_page?: integer, direction?: string, account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/list/accounts` — List all Cloudflare accounts you have ownership or verified access to. Retrieves a paginated list of accounts with their details including account ID, name, type, settings, and creation date. An empty
  - body: { name?: string, page?: integer, per_page?: integer, direction?: string }
- `POST https://api.mcp.ai/api/cloudflare/list/dns/records` — Tool to list and search DNS records in a Cloudflare zone. Use when you need to find existing DNS record IDs for update or delete operations, especially after a "record already exists" error during cre
  - body: { name?: string, page?: integer, type?: string, match?: string, content?: string, proxied?: boolean, zone_id: string, per_page?: integer, name_contains?: string, comment_contains?: string, content_contains?: string }
- `POST https://api.mcp.ai/api/cloudflare/list/firewall/rules` — Tool to list firewall rules for a specific DNS zone. Use after confirming the zone ID to retrieve and audit current firewall rules. Does not expose Workers routes or other routing constructs.
  - body: { page?: integer, match?: string, order?: string, zone_id: string, per_page?: integer, direction?: string }
- `POST https://api.mcp.ai/api/cloudflare/list/monitors` — Tool to list all load-balancer monitors in a Cloudflare account. Use after creating or updating monitors to retrieve a paginated list. Response includes `result_info.total_pages` to determine when all
  - body: { page?: integer, order?: string, per_page?: integer, direction?: string, account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/list/pools` — Tool to list all load balancer pools in a Cloudflare account. Use after confirming account ID to discover pool IDs. Paginate using `page` and `per_page`; check `result_info.total_pages` in the respons
  - body: { page?: integer, monitor?: string, per_page?: integer, account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/list/tunnels` — List Cloudflare Tunnel (cloudflared) tunnels in an account to discover tunnel IDs, names, and statuses. Use when you need to find a tunnel_id before performing tunnel operations like routing, DNS conf
  - body: { name?: string, page?: integer, per_page?: integer, account_id: string, is_deleted?: boolean }
- `POST https://api.mcp.ai/api/cloudflare/list/zones` — Lists, searches, sorts, and filters zones in the authenticated account. Use `page`/`per_page` to paginate; check `result_info.total_pages` in the response to iterate all pages. Does not return DNS rec
  - body: { name?: string, page?: integer, match?: string, order?: string, status?: string, account?: object, per_page?: integer, direction?: string }
- `POST https://api.mcp.ai/api/cloudflare/update/dns/record` — Tool to update an existing DNS record within a specific zone. Use after confirming both zone and record identifiers; only provided fields are modified. Updates to records used by active tunnels take e
  - body: { ttl?: integer, data?: object, name?: string, type?: string, content?: string, proxied?: boolean, priority?: integer, identifier: string, zone_identifier: string }
- `POST https://api.mcp.ai/api/cloudflare/update/list` — Tool to update the description of a WAF list (cannot update items). Use after confirming list metadata.
  - body: { list_id: string, account_id: string, description: string }
- `POST https://api.mcp.ai/api/cloudflare/update/tunnel/configuration` — Tool to update a remotely-managed Cloudflare Tunnel's configuration (ingress rules and routing). Use when you need to programmatically configure hostname-to-origin mappings for a tunnel. WARNING: This
  - body: { config: object, tunnel_id: string, account_id: string }
- `POST https://api.mcp.ai/api/cloudflare/update/zone` — Tool to update properties of an existing zone; changes apply immediately to the live zone. Confirm zone ID and intended change with the user before calling. Only one field can be modified per call.
  - body: { type?: string, paused?: boolean, zone_id: string, vanity_name_servers?: string[] }

## Example prompts
- "What can I do in Cloudflare?"
- "Show me a summary of my Cloudflare account"

## More
- Page: https://mcp.ai/cloudflare
- Agent spec (llms.txt): https://mcp.ai/cloudflare/llms.txt
- Postman collection: https://mcp.ai/cloudflare/postman.json
