Skip to content

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.

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

Review DNS records for a domain.

Security settings

Check firewall and SSL settings.

Cache questions

Understand cache behavior and purge with approval.

Workers

Inspect Workers and their analytics.

Docs

Find the right Cloudflare feature for a need.

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.

  • docs

    Search Cloudflare developer docs.

  • search

    Write JavaScript to search the Cloudflare API spec for endpoints.

  • execute

    Write JavaScript that calls the Cloudflare API.

Workflows

Example workflows

Check a domain before launch

  1. 1

    Name the domain.

  2. 2

    The assistant reads DNS and SSL settings.

  3. 3

    It compares them with your plan.

  4. 4

    It lists anything missing.

  5. 5

    An engineer fixes it.

Purge cache after a release

  1. 1

    Ask to purge specific URLs.

  2. 2

    The assistant finds the API call.

  3. 3

    It shows the planned purge.

  4. 4

    You approve.

  5. 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

FAQ

Questions people ask us

Have a question that is not here? Ask us directly.

Start a project

Want this connected to your own systems? We build AI workflows with MCP.

Send a short brief. We reply with questions, a suggested plan and an estimate you can compare with other offers.

Your privacy choices

We use necessary storage to run this site. With your permission we also use Google Analytics to see which pages help people, and load maps from Google. You can change this at any time. Read the cookie policy.