# Cloudflare Api Key — how to use (mcp.ai)

Connect your Cloudflare Api Key account and use 25 tools for security and identity straight from your AI agent. Connect with your own API key. Cloudflare provides a suite of services to enhance the security, performance, and reliability of websites and applications.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cloudflare_api_key?ms=1787293380000`
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_api_key_create_dns_record`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cloudflare_api_key`
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_api_key/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cloudflare_api_key/create/dns/record` — Tool to create a new DNS record in a Cloudflare zone. Use when you need to add a record (A, CNAME, TXT, MX, etc.) to a specified zone.
  - body: { ttl?: integer, name: string, tags?: string[], type: string, comment?: string, content?: string, proxied?: boolean, zone_id: string, settings?: object }
- `POST https://api.mcp.ai/api/cloudflare_api_key/create/lockdown/rule` — Tool to create a Zone Lockdown rule. Use when you need to restrict access to specific URL patterns to defined IPs/CIDR ranges. Use after confirming zone_id.
  - body: { urls: string[], paused?: boolean, zone_id: string, priority?: integer, description?: string, configurations: object[] }
- `POST https://api.mcp.ai/api/cloudflare_api_key/create/rule/in/ruleset` — Tool to add a rule to an existing ruleset. Use when you need to append or insert a new rule in a Cloudflare ruleset.
  - body: { rule: object, zone_id?: string, account_id?: string, ruleset_id: string, accounts_or_zones: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/create/ruleset` — Creates a new Cloudflare ruleset at account or zone scope. Rulesets contain rules that control traffic behavior (firewall, rate limiting, redirects, etc.). First use List Zones to get a zone_id, then 
  - body: { kind: string, name: string, phase: string, rules?: object[], description?: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/delete/dns/record` — Tool to delete a DNS record. Use when you need to remove a specific DNS record from a zone after confirming both zone and record IDs.
  - body: { zone_id: string, dns_record_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/delete/dnssec` — Tool to delete DNSSEC records for a zone. Use after disabling DNSSEC at the registrar to remove DNSSEC configuration.
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/delete/rule/from/ruleset` — Tool to delete a specific rule from a ruleset. Use when you need to remove an outdated or incorrect rule from an account or zone ruleset after confirming IDs.
  - body: { rule_id: string, ruleset_id: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/delete/ruleset` — Tool to delete all versions of a ruleset. Use when you need to remove a ruleset from an account or zone after confirming no references exist.
  - body: { ruleset_id: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/delete/zone` — Tool to delete an existing zone. Use after confirming the zone_id to permanently remove the zone.
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/cloudflare/ip/addresses` — Tool to retrieve IP addresses used on the Cloudflare or JD Cloud network. Use when you need to obtain the list of IPv4 and IPv6 CIDR blocks used by Cloudflare's infrastructure or JD Cloud data centers
  - body: { networks?: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/entrypoint/ruleset/version` — Retrieves a specific historical version of an entry point ruleset from Cloudflare. Entry point rulesets are phase-specific and define the rules that execute during a particular phase of request/respon
  - body: { ruleset_phase: string, ruleset_version: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/lockdown/rule` — Tool to get a Zone Lockdown rule. Use when you need to fetch details of a specific lockdown rule by its ID within a Cloudflare zone.
  - body: { zone_id: string, lockdown_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/regional/tiered/cache` — Tool to get the regional tiered cache setting for a zone. Use when you need to verify if regional tiered cache is enabled for performance optimization after zone activation.
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/ruleset` — Tool to fetch the latest version of a ruleset by ID. Use after you have the ruleset scope and ID.
  - body: { zone_id?: string, account_id?: string, ruleset_id: string, accounts_or_zones: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/get/zone/details` — Tool to get details for a specific zone. Use when you need detailed zone metadata by ID.
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/list/dns/records` — List, search, sort, and filter DNS records for a Cloudflare zone. Use this tool to retrieve DNS records (A, AAAA, CNAME, TXT, MX, etc.) for a zone. Supports filtering by record type, name, content, an
  - body: { name?: string, page?: integer, type?: string, match?: string, order?: string, search?: string, content?: string, proxied?: boolean, zone_id: string, per_page?: integer, direction?: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/list/zones` — Tool to list, search, sort, and filter Cloudflare zones. Use when you need to retrieve a paginated list of zones available to the authenticated user.
  - body: { name?: string, page?: integer, match?: string, order?: string, status?: string, per_page?: integer, direction?: string, account.id?: string, account.name?: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/overwrite/dns/record` — Tool to completely overwrite a DNS record. Use when you need to replace all record details after confirming record type and name.
  - body: { ttl?: integer, name: string, tags?: string[], type: string, comment?: string, content?: string, proxied?: boolean, zone_id: string, settings?: object, dns_record_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/rerun/zone/activation/check` — Triggers a new activation check for a zone with 'pending' status. Use this after creating a zone or updating nameservers to verify that DNS propagation is complete and the zone can be activated. Rate 
  - body: { zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/update/dnssec/status` — Tool to update DNSSEC configuration for a zone. Use when you need to enable or disable DNSSEC or adjust DNSSEC options after confirming the zone ID.
  - body: { status?: string, zone_id: string, dnssec_presigned?: boolean, dnssec_use_nsec3?: boolean, dnssec_multi_signer?: boolean }
- `POST https://api.mcp.ai/api/cloudflare_api_key/update/lockdown/rule` — Tool to update a zone lockdown rule. Use when you need to modify the IP or URL settings of an existing Zone Lockdown rule after confirming the rule exists.
  - body: { urls: string[], paused?: boolean, zone_id: string, description?: string, lock_downs_id: string, configurations: object[] }
- `POST https://api.mcp.ai/api/cloudflare_api_key/update/rule/in/ruleset` — Tool to update a specific rule in a ruleset. Use when you need to modify a rule's configuration or reorder it after reviewing its current settings.
  - body: { rule?: object, rule_id: string, position?: object, ruleset_id: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/update/ruleset` — Update a Cloudflare ruleset, creating a new version. Use this to modify ruleset description, name, or rules. IMPORTANT: When updating rules, you must include ALL rules you want to keep - any rules not
  - body: { kind?: string, name?: string, phase?: string, rules?: object[], ruleset_id: string, description?: string, accounts_or_zones: string, account_or_zone_id: string }
- `POST https://api.mcp.ai/api/cloudflare_api_key/update/zone` — Tool to edit a Cloudflare zone. Use when you need to update a single zone property at a time. Ensure only one of paused, type, or vanity_name_servers is provided per call.
  - body: { type?: string, paused?: boolean, zone_id: string, vanity_name_servers?: string[] }
- `POST https://api.mcp.ai/api/cloudflare_api_key/upload/file/to/s3` — Tool to upload arbitrary file content to temporary storage. Use when you need to stage files for actions requiring FileUploadable.
  - body: { content: string, mimetype?: string, file_name: string }

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

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