Cloudflare MCP Server
Provides tools for the Cloudflare API, enabling lookup of accounts, zones, DNS records, zone settings, SSL/TLS and certificates, page rules, redirect rules, Zero Trust Access applications and traffic analytics, plus write actions such as creating, updating and deleting DNS records, purging cache, setting the SSL mode, and toggling Always Use HTTPS and development mode.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Cloudflare MCP server
An MCP server for the Cloudflare API. Claude can use it to look up accounts, zones, DNS records, zone settings, SSL/TLS and certificates, page rules, redirect rules, Zero Trust Access applications and traffic analytics. Separately named write tools can create, change and delete DNS records, purge the cache, set the SSL mode, and turn Always Use HTTPS and development mode on or off.
There is one named tool per action and no generic "call any API path" tool: every tool calls fixed Cloudflare paths with validated arguments (IDs must be 32 hex characters, names must be domain names), so a tool can only do what its name says.
It uses the same framework as Cititec's other MCP servers: TypeScript, @modelcontextprotocol/sdk, a stdio transport, vitest tests, tsup and a Docker image. It is built to run on the Cititec MCP host, which runs one container per connection and turns every write into a proposal that a person approves before it runs.
Configuration
Variable | |
| An API token (never a Global API Key). See "API token permissions". |
|
|
The token is sent only to https://api.cloudflare.com/client/v4, as a Bearer header, and is removed from any error text.
Related MCP server: Cloudflare MCP Server
Tools
Results keep the useful fields only, and every result is capped at 60,000 characters. Where a tool takes zone, it accepts the zone name (example.com.au) or its ID; by name it costs one extra request to look the ID up.
Read tools
Tool | Cloudflare API | Notes |
|
| ID, name, type. Filter by name |
|
| Filter by exact name, text in the name ( |
|
| Status, name servers (and the ones before Cloudflare), account, plan, page rule quota, the token's permissions on it |
|
| Filter by type, exact name ( |
|
| |
|
| The main settings (SSL, HTTPS, TLS, HSTS, cache, security level, HTTP/3, ...); |
|
| SSL mode, Always Use HTTPS, minimum TLS, HSTS; certificate packs with authority, status and expiry |
|
| |
|
| Single Redirects. A zone without any returns an empty list |
|
| Name, type, domains, session duration, identity providers, policy names. Client secrets, keys and policy members (emails) are never returned |
|
| Requests, cached requests, bandwidth, threats, page views, unique visitors per day for 1 to 30 days |
Write tools
Every write tool takes zone_id and zone_name. Before changing anything it reads the zone and stops if the ID is not that zone, so a wrong ID cannot change another client's zone, and an approver sees the domain name in the proposal. Record changes also read the record first and stop if it is not the one named (current_name, or name and type for a delete). Then the tool sends exactly one change, which is never retried.
Tool | Cloudflare API | Notes |
|
| A, AAAA, CNAME, MX, TXT, NS. Content is checked for the type (an IP address, a host name). TTL 1 (automatic) by default; proxied only for A/AAAA/CNAME |
|
| Content, name, TTL, proxied, MX priority, comment (not the type). Returns the record before and after |
|
| Destructive. Returns the deleted record so it can be recreated |
|
| Up to 30 URLs, each on the zone or a subdomain of it |
|
| Destructive: every visitor's next requests go to the origin |
|
|
|
|
| |
|
| Turns itself off after 3 hours |
Destructive tools have the MCP annotation destructiveHint: true (all others false), and the package exports their names (DESTRUCTIVE_TOOL_NAMES) so a host can gate them separately. SRV, CAA and other structured record types can be read but not written by these tools.
API token permissions
Create a custom user API token (dash.cloudflare.com > My Profile > API Tokens > Create Token > Create Custom Token). Not a Global API Key, and not an account-owned token: an account-owned token works in one account only, and Cititec manages each client in its own account. Create the token on a user that is a member of every client account, preferably a dedicated service user (Cloudflare's 1,200 requests per 5 minutes is counted per user, including that user's dashboard use).
Read-only token (the host's -ro.env):
Scope | Permission | Level | Used by |
Account | Account Settings | Read |
|
Account | Access: Apps and Policies | Read |
|
Zone | Zone | Read | zone lookups, |
Zone | DNS | Read |
|
Zone | Zone Settings | Read |
|
Zone | SSL and Certificates | Read |
|
Zone | Page Rules | Read |
|
Zone | Single Redirect (listed as Dynamic Redirect on older dashboards) | Read |
|
Zone | Analytics | Read |
|
Write token (the host's -rw.env, used for everyone granted rw, so it needs the read permissions too): everything above, with these levels instead:
Scope | Permission | Level | Used by |
Zone | DNS | Edit | create, update and delete DNS records |
Zone | Zone Settings | Edit | SSL mode, Always Use HTTPS, development mode |
Zone | Cache Purge | Purge | both purge tools |
For both tokens:
Account Resources: Include > All accounts. Zone Resources: Include > All zones from all accounts (or All zones). New client accounts and zones are then covered without editing the token.
Client IP Address Filtering: Is in > the MCP host's public IP address, so a leaked token is useless elsewhere.
TTL: an end date, and a reminder to rotate it.
A tool whose permission is missing returns an auth error (HTTP 403, code 9109 "Unauthorized to access requested resource"); the other tools keep working. Nothing here needs Workers, Tunnels, Access edit, Billing, Members or API Tokens permissions.
Errors and rate limits
A failed call returns isError: true with a first line for people and a JSON line for programs, also in structuredContent:
Error: Cloudflare rate-limited the request (HTTP 429): GET /zones. Try again in 300 s.
{"error":"rate_limited","message":"...","retry_after_seconds":300}error is one of rate_limited, auth, invalid_input, not_found, api_error, config.
Cloudflare allows 1,200 requests per 5 minutes per user (dashboard and API tokens together) and 200 per second per IP; going over blocks every call for 5 minutes (limits). Following the Cititec fleet policy:
a read that gets HTTP 429 (or 503 with
Retry-After) is retried once, and only whenRetry-Afteris at most 10 s;a write is never retried; the error says it was not retried;
otherwise the tool returns
rate_limitedwithretry_after_seconds(Retry-After, or 300 when Cloudflare gives none).
Most tools make one request; a zone given by name adds one; cloudflare_get_ssl_status makes two; writes make two (zone check, change) and record updates and deletes three (zone check, record check, change). The Cititec MCP host also limits calls for everyone together, from these figures.
Development
npm ci
npm run lint # tsc --noEmit
npm test # vitest
npm run build # tsup -> dist/index.jsRun it over stdio with CLOUDFLARE_API_TOKEN=... node dist/index.js.
Releases: commits to main with Conventional Commit messages are released by the Cititec release workflow (semantic-release), which tags the version and pushes ghcr.io/cititec-pty-ltd/cloudflare-mcp:v<version> and :latest.
Licence
Apache 2.0. See LICENSE and NOTICE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
AI Visibility and Content Intelligence tools for Claude and MCP-compatible agents.
Give Claude only the Google Drive files you choose. Every action logged.
One workspace of tools for Claude and ChatGPT: connect 600+ apps, generate media, build tools.
Related MCP Servers
- AlicenseBqualityDmaintenanceExposes Cloudflare DNS, security, redirects and zone-settings functionality as structured tools that AI assistants like Claude Desktop can invoke directly.18MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Cloudflare resources through natural language, including DNS records, zone management, Workers KV storage, cache purging, and analytics. Supports comprehensive Cloudflare operations with secure API token authentication.132MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with the Cloudflare REST API for managing DNS records, zones, and other Cloudflare resources.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Cloudflare DNS records, including listing zones and records, and creating, updating, or deleting DNS records.681 npmMIT