Secure MCP server for Cloudflare DNS, Transform Rules, and Page Rules
Runs on your machine from its package; the steps are below.
At most: creates or changes data: records, files, settings.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
uvx mcp-cloudflare-crunchtools
MCP client config
{
"mcpServers": {
"mcp-cloudflare": {
"command": "uvx",
"args": [
"mcp-cloudflare-crunchtools"
]
}
}
}A secure MCP (Model Context Protocol) server for Cloudflare DNS, Transform Rules, Page Rules, and cache management.
This MCP server is designed to be:
quay.io/crunchtools/mcp-cloudflare built on Hummingbird Python base image| Component | Name |
|---|---|
| GitHub repo | crunchtools/mcp-cloudflare |
| Container | quay.io/crunchtools/mcp-cloudflare |
| Python package (PyPI) | mcp-cloudflare-crunchtools |
| CLI command | mcp-cloudflare-crunchtools |
| Module import | mcp_cloudflare_crunchtools |
The container image is built on the Hummingbird Python base image from Project Hummingbird, which provides:
This means your MCP server runs in a hardened environment with fewer vulnerabilities than typical Python container images
list_zones - List all zones accessible by your API tokenget_zone - Get zone details by ID or domain namelist_dns_records - List DNS records with filteringget_dns_record - Get a single DNS recordcreate_dns_record - Create A, AAAA, CNAME, MX, TXT, NS, SRV, CAA recordsupdate_dns_record - Update existing recordsdelete_dns_record - Delete recordslist_request_header_rules / set_request_header_rules - Modify request headerslist_response_header_rules / set_response_header_rules - Modify response headerslist_url_rewrite_rules / set_url_rewrite_rules - URL path/query rewriteslist_page_rules - List all page rulescreate_page_rule - Create redirects, cache settings, SSL modesupdate_page_rule - Modify existing rulesdelete_page_rule - Remove rulesget_access_organization - The Zero Trust organization and its team login domainlist_access_apps / get_access_app - Applications on a zone, with their audience tagscreate_access_app / delete_access_app - Put a hostname behind an Access login, or take it outlist_access_policies - Who an application admitscreate_access_policy / delete_access_policy - Allow, deny or bypass by email, email domain, IP or everyonepurge_cache - Purge by URL, tag, host, prefix, or everythinguvx mcp-cloudflare-crunchtools
pip install mcp-cloudflare-crunchtools
podman run -e CLOUDFLARE_API_TOKEN=your_token \
quay.io/crunchtools/mcp-cloudflare
Navigate to API Tokens
Configure Token Name
mcp-cloudflare-crunchtoolsConfigure Permissions
The Permissions section has three dropdowns per row:
Account or Zone)Read or Edit)Click "+ Add more" to add each permission row. For full management, add:
| Resource | Permission | Access |
|---|---|---|
| Zone | Zone | Read |
| Zone | DNS | Edit |
| Zone | Page Rules | Edit |
| Zone | Transform Rules | Edit |
| Zone | Cache Purge | Purge |
| Account | Access: Apps and Policies | Edit |
| Account | Access: Organizations, Identity Providers, and Groups | Read |
Configure Zone Resources
Configure Client IP Address Filtering (Optional)
Create and Copy Token
claude mcp add mcp-cloudflare-crunchtools \
--env CLOUDFLARE_API_TOKEN=your_token_here \
-- uvx mcp-cloudflare-crunchtools
Or for the container version:
claude mcp add mcp-cloudflare-crunchtools \
--env CLOUDFLARE_API_TOKEN=your_token_here \
-- podman run -i --rm -e CLOUDFLARE_API_TOKEN quay.io/crunchtools/mcp-cloudflare
| Resource | Permission | Access |
|---|---|---|
| Zone | Zone | Read |
| Zone | DNS | Read |
| Resource | Permission | Access |
|---|---|---|
| Zone | Zone | Read |
| Zone | DNS | Edit |
| Resource | Permission | Access |
|---|---|---|
| Zone | Zone | Read |
| Zone | DNS | Edit |
| Zone | Page Rules | Edit |
| Zone | Transform Rules | Edit |
| Zone | Cache Purge | Purge |
User: List my Cloudflare zones
Assistant: [calls list_zones]
User: Create an A record for www.example.com pointing to 192.168.1.1
Assistant: [calls create_dns_record with type=A, name=www, content=192.168.1.1]
User: Add X-Content-Type-Options: nosniff to all responses for zone abc123...
Assistant: [calls set_response_header_rules with appropriate rule]
User: Purge the cache for https://example.com/styles.css
Assistant: [calls purge_cache with files=["https://example.com/styles.css"]]
This server was designed with security as a primary concern. See SECURITY.md for:
Token Protection
Input Validation
API Hardening
Automated CVE Scanning
git clone https://github.com/crunchtools/mcp-cloudflare.git
cd mcp-cloudflare
uv sync
uv run pytest
uv run ruff check src tests
uv run mypy src
podman build -t mcp-cloudflare .
AGPL-3.0-or-later
Contributions welcome! Please read SECURITY.md before submitting security-related changes.