MCP server
Cloudflare MCP server
Cloudflare's Code Mode MCP server lets AI search Cloudflare docs and the API and execute API calls, within the scopes you grant.
- Official server
- Cloud and infrastructure
At a glance
- Maintained by
- Cloudflare
- Tools exposed
- 3 listed below
- Reviewed
- September 24, 2026
Why it matters
What it does and why it matters
Cloudflare handles DNS, security, caching and edge apps for a large share of websites. Its recommended MCP server, Code Mode, has three tools: search the docs, search the API and execute API calls. Instead of hundreds of separate tools, the assistant finds the right API and calls it.
That covers everything from checking DNS records to reading Workers analytics.
What it can do is limited by the OAuth scopes or API token permissions you grant. We use scoped tokens, starting with read access to specific zones, and keep changes to DNS and security settings behind review, since a wrong DNS change can take a site offline.
Use cases
Best business use cases
DNS checks
Security settings
Cache questions
Workers
Docs
Tools
Available tools
Tool names as published by the maintainer at review time. Versions change, so check the repository for the current list.
Code Mode exposes only three tools but reaches about 2,500 API endpoints. Product-specific servers have their own tools (not listed here).
Read and write: Read and write across the Cloudflare API, limited by OAuth scopes or token permissions.
-
docsSearch Cloudflare developer docs.
-
searchWrite JavaScript to search the Cloudflare API spec for endpoints.
-
executeWrite JavaScript that calls the Cloudflare API.
Workflows
Example workflows
Check a domain before launch
-
1
Name the domain.
-
2
The assistant reads DNS and SSL settings.
-
3
It compares them with your plan.
-
4
It lists anything missing.
-
5
An engineer fixes it.
Purge cache after a release
-
1
Ask to purge specific URLs.
-
2
The assistant finds the API call.
-
3
It shows the planned purge.
-
4
You approve.
-
5
It purges and confirms.
Prompts
Example prompts
“List DNS records for example.com and flag anything unusual.”
“Is SSL set to full strict for this zone?”
“Purge the cache for these three URLs after I confirm.”
Setup
Installation and configuration
Examples for Claude Desktop and Claude Code. Replace the placeholder values with your own keys, and store secrets outside version control.
Claude Desktop: claude_desktop_config.json
{
"mcpServers": {
"cloudflare-api": {
"type": "http",
"url": "https://mcp.cloudflare.com/mcp"
}
}
}
Claude Code: terminal
claude mcp add --transport http cloudflare-api https://mcp.cloudflare.com/mcp
- Hosted server: https://mcp.cloudflare.com/mcp (Streamable HTTP). Product servers: docs.mcp.cloudflare.com/mcp, bindings.mcp.cloudflare.com/mcp, observability.mcp.cloudflare.com/mcp, browser.mcp.cloudflare.com/mcp, ai-gateway.mcp.cloudflare.com/mcp.
- Needs: OAuth (recommended) or a Cloudflare API token sent as a Bearer token..
Security
Security considerations
-
Read-only first
Start with read access and add actions only for reviewed tasks.
-
Scoped credentials
Use a dedicated role or token with the least access, never an owner or admin key.
-
Separate environments
Keep production changes out of assistant sessions, or require approval for them.
-
Audit
Review Cloudflare audit logs for changes.
Related servers
Servers that pair well with it
Vercel
Vercel's official MCP server lets AI search Vercel docs, list teams, projects and deployments, read build and runtime logs and deploy with confirmation.
Netlify
Netlify's official MCP server lets AI read account, team and project data and create, configure and deploy Netlify projects.
AWS
The AWS API MCP server from AWS Labs lets AI run AWS CLI commands, suggest commands and plan changes, with read-only and consent modes.
Keep exploring
Solutions and services that use it
Related services
View all related services- MCP integration Connect AI assistants to your CRM, files, databases and tools through Model Context Protocol servers, with safe permissions.
- Product scaling Keep a growing product fast and stable as users, data and features increase.
- AI-Powered Web Development Business websites, customer portals, dashboards and web applications that load fast, rank well and are easy to change.
- Multi-tenant architecture One product serving many customer accounts, with each account's data kept separate and secure.
- API integration Make two systems share data reliably, with retries, logging and alerts when something goes wrong.
- Automation and Integrations CRM, payment and API integrations, MCP connections and workflows that stop people copying data by hand.
Solutions
View all solutionsIndustries
View all industriesGuides and articles
View all guides and articles- How we review AI-generated code The checks we apply to every AI-assisted change, from tests and security to readability and business rules.
- How to connect AI to your database safely Let staff ask questions of your data in plain English without risking production systems or sensitive records.
- MCP security best practices How to choose, configure and monitor MCP servers so AI assistants get the access they need and nothing more.
- How to automate reporting with AI and MCP Build reports that assemble themselves from your systems through MCP, with a written summary people can trust.
- How to set up automated reporting Replace manual weekly and monthly reports with dashboards and summaries that update themselves.
Glossary terms
View all glossary terms- API integration An API integration connects two or more systems through their APIs so data and actions flow between them automatically.
- SEO SEO, or search engine optimization, is the work of making a website easy for search engines to understand and useful enough to rank for the searches your customers make.
- Cloud hosting Cloud hosting runs websites and applications on servers rented from a provider, which can grow or shrink with demand.
- Reverse proxy A reverse proxy is a server that sits in front of your applications, receiving visitors' requests and passing them to the right app, often adding security and caching.
- VPS A VPS, or virtual private server, is a rented virtual machine with its own resources, on which you can install and run your own software.
- API An API, or application programming interface, is a defined way for one piece of software to request data or actions from another.
FAQ
Questions people ask us
Have a question that is not here? Ask us directly.
Yes. Cloudflare recommends its Code Mode server.
It searches the docs and API and executes calls, instead of one tool per endpoint.
If your token allows it. Keep DNS changes behind review.