Cloudflare MCP security: permissions, risky tools and how to lock it down

What the official Cloudflare API MCP server can read and change, how OAuth grants and portal tool controls limit it, and which optional servers to leave out.

On this page

Can Cloudflare MCP security be locked down to the permissions an agent needs?

The requirement is only partly met out of the box. The grant scope is chosen per connection: when a user connects over OAuth, Cloudflare redirects them to authorize and select the permissions the agent receives, so the scope is decided at the moment of connection rather than set once by an administrator. Tool-level restrictions are a separate control. They sit in MCP server portals, which Cloudflare documents as a Cloudflare One (Access) feature, where administrators can manage tools and prompts and turn off individual tools or prompts. Before relying on either, confirm in your own account and Cloudflare One edition that portals are available to you and that the portal settings apply to the connection your staff will use.

The blast radius is large. The main Cloudflare API MCP server at ` reaches over 2,500 endpoints across DNS, Workers, R2, Zero Trust and other products, so a broad grant lets an agent change many services in one connection. The practical decision is therefore which services a grant covers and whether the agent needs write access at all. Ask the vendor and your account team to document which scopes exist for the API server, whether scopes can be limited by product or account, and what a user sees on the consent screen. Test the answers in a non-production account before approving a rollout.

Treat the portal and grant settings as the control set to review, not the server's defaults. Record which tools are turned off in the portal, which product-specific servers (such as documentation, container, Browser Run, DEX and CASB) are left out because they are optional, and which users are allowed to authorize the connection. Then test that a read-only task cannot trigger a write through a tool you did not intend to expose. Because the server runs generated JavaScript in an isolated Dynamic Worker sandbox, the sandbox limits where code runs, but it does not replace these account-level permission decisions.

Which Cloudflare MCP controls are built in, paid or outside the product

This table sorts the Cloudflare MCP controls covered on this page by where they live: built into the connection, a Cloudflare One feature, an optional separate server, or something to confirm with Cloudflare. Read the status column first, then check the confirmation items before approving a connection. The main takeaway is that the broad API server reaches many services, so the grant chosen at connection time and any portal-level tool restrictions are the controls that decide what an agent can change.

CapabilityStatusWhat to confirm or check
OAuth connection with per-connection permission selectionBuilt inChoose the narrowest permissions at authorization, and confirm which permission sets are offered for each account
Main Cloudflare API MCP server at /mcpBuilt inConfirm the endpoint is and that it covers over 2,500 API endpoints
search, execute and docs toolsBuilt inConfirm whether execute() can perform writes under every permission grant you plan to issue
Code Mode sandboxing in an isolated Dynamic WorkerBuilt inConfirm with Cloudflare what the sandbox can reach, including outbound network and bindings
MCP server portals with tool and prompt turn-offCloudflare One featureConfirm your Cloudflare One plan includes portals and that tools can be disabled individually
Optional product-specific servers (docs, containers, Browser Run, DEX, CASB)Outside componentLeave out any server you do not need; the main API server is the default choice for most users
Open source code under Apache-2.0Outside componentReview the github.com/cloudflare/mcp code and confirm it matches the hosted server version you connect to
Audit logging of agent actionsConfirm with CloudflareAsk which account audit logs record MCP-driven changes and how attribution appears

How the agent's requests pass through OAuth, code execution and portals

Each control sits at a different point in the request path, so a review has to check all of them. The MCP client connects to the Streamable HTTP endpoint at /mcp, for the main server at On first connection the user is redirected to Cloudflare to authorize the client and select the permissions to grant. That grant is the first decision point: it sets what the agent may reach before any request is made. The MCP specification uses OAuth 2.1 for authorization between clients and servers, and the related Cloudflare guide covers token validation and scope-based access control. Confirm in your own tenant which scopes the consent screen offers and which one your users will actually be shown.

Once connected, the agent does not call each API directly. It uses search() to find endpoints in the typed OpenAPI representation and execute() to run calls, with docs() for developer documentation. The grant decides which endpoints are reachable, so a broad grant covering DNS, Workers, R2 and Zero Trust lets one agent change many services. Code Mode then has the model write JavaScript that runs inside an isolated Dynamic Worker sandbox. The sandbox limits what generated code can do in its runtime, but it does not narrow the account permissions the grant already gave. Treat the sandbox as containment for the code, and the grant as the real ceiling on what the code can change.

Portals add a third layer where administrators can narrow tools before a client sees them. Cloudflare documents MCP server portals as a Cloudflare One (Access) feature, and its portal docs describe managing tools and prompts and turning off individual tools or prompts. Use that filter to remove write-capable operations your teams do not need, then test the portal path, not only the direct connection, because a user connecting directly may bypass the portal. Confirm with Cloudflare which portal controls apply to your plan and how portal logs record tool calls.

Where a Cloudflare MCP request is authorized and filtered

The request starts at an MCP client, which may connect directly to the Cloudflare API MCP server or first pass through an optional MCP server portal in Cloudflare One. The OAuth grant screen is where you choose the permissions the agent receives for that connection, so it is the first point to check. Inside the server, the search(), execute() and docs() tools hand generated JavaScript to a Dynamic Worker sandbox, and the calls then reach the account's Cloudflare services. Check the grant scope at the OAuth step and the tool list at the portal step.

Authorization and tool filtering points on a Cloudflare MCP request path.

Which tools and reach make the Cloudflare API server risky

The main Cloudflare API MCP server gives an agent a small set of tools that reach a very large API surface. Four features drive the risk: the execute() path, the breadth of services behind it, the grant chosen at connection, and optional product servers that add reach. Each card names the control that narrows it.

execute() as the path to change services

The server exposes search() and execute() tools to find and call API endpoints. Calls made through execute() are the ones that can create, modify or delete resources, so this tool is where a change actually happens. Generated code runs in an isolated Dynamic Worker sandbox, which limits what that code can touch on the host, but it does not limit which Cloudflare resources the account allows. Ask your team to confirm which write operations the connected identity can perform, and review them before approving the connection. Use the portal to turn off tools you do not need.

Cloudflare server docs

Breadth across DNS, Workers and R2

The docs describe the server as reaching over 2,500 endpoints across DNS, Workers, R2, Zero Trust and other products. One connection can therefore touch traffic routing, serverless code, object storage and access policy. A change to DNS or a Zero Trust rule can affect many users at once, which makes a single agent mistake more costly than it would be in a single-product tool. Map which of these products matter to your organization, and decide which ones an agent should never change.

Broad grant chosen at connection

When you connect over OAuth, Cloudflare redirects you to authorize the agent and select the permissions to grant, so the scope is set per connection. A developer who accepts a broad set of permissions gives the agent that full reach for as long as the connection lasts. Require a written list of permissions for each approved client, ask for read-only grants for analysis work, and make reviewers check the consent screen before users click through it. Re-check grants when the agent's role changes.

Optional product servers widen reach

Cloudflare also runs product-specific MCP servers, such as documentation, container, Browser Run, DEX and CASB. The docs describe these as optional and say most people should use the main Cloudflare API MCP server. Every extra server you leave connected adds another tool surface and another consent step to review. Connect only the servers that a documented use case needs, and remove the rest from approved client configurations. Leaving optional servers out is the simplest reduction in reach you can make.

How the lockdown differs for read-only teams, developers and regulated accounts

Teams that only need to review configurations or produce reports should start from the narrowest grant the connection screen offers. The Cloudflare docs say that on connecting via OAuth you are redirected to Cloudflare to authorize and select the permissions to grant to your agent, so read-only access is a choice you make for each connection, not a default you assume. An agent that only reads can still send sensitive configuration into a model context, so the review goal is to limit both the grant and what the tools return.

  • Choose read permissions only: select the read-level grant during OAuth and confirm no write permissions are ticked for the account.
  • Use separate identities for reporting: give reporting staff their own connection so their activity is distinguishable from engineers.
  • Turn off write-capable tools in a portal: where a portal is used, disable any tool that can change state, using the tool management settings in the MCP server portals docs.
  • Limit what leaves the session: ask whether exported configuration or search results are kept in the client's logs or history.

Before approving this tab, confirm with Cloudflare exactly which permissions a read-only grant includes for the main Cloudflare API MCP server, since the search() and execute() tools may still reach many endpoints.

Gaps to cover when the grant and portal settings are not enough

The grant screen and portal toggles cover a lot, but the supplied facts leave several questions open about how far those controls reach. Each card below names one gap, what to confirm with Cloudflare, and the control to rely on while the answer is pending.

No documented per-endpoint allowlist

The main server reaches more than 2,500 API endpoints, and the connection-time grant selects permissions by scope rather than by named endpoint. Confirm with Cloudflare exactly which endpoints a chosen grant includes before approving the connection. Until that mapping is in writing, limit the access at the account level: create a token or account role with the least privileges the task needs and keep write permissions for DNS, Workers, R2 and Zero Trust separate from read access.

Cloudflare MCP servers docs

Portal restrictions on every path

Tool and prompt toggles in MCP server portals are the main tool-level control, but the supplied material does not say whether they apply to every way a client can reach the server. Test a connection that bypasses the portal, such as a direct connection to the server endpoint, and confirm that a disabled tool stays disabled. If direct connections are possible, treat the portal as advisory and rely on the account-level grant until testing shows otherwise.

MCP server portals docs

Attribution of agent actions

When an agent changes a DNS record or a Worker, the audit trail must show that the change came from an AI client acting for a named user, not from that user directly. Ask Cloudflare which identity appears in the account audit log for an OAuth-authorized agent and whether the client is recorded. Where attribution is unclear, log changes outside the tool by requiring change tickets and comparing configuration snapshots against the agent's sessions.

Limits of model-written code

The Code Mode pattern has the model write JavaScript that runs in an isolated Dynamic Worker sandbox. Isolation limits the code's host access, but it does not decide whether a generated call is a sensible change. A prompt-injected or mistaken script can still issue valid API calls within the granted scope. Compensate with change review for any write request, a dry-run or read-only grant for first use, and monitoring of the write operations the account actually receives.

Testing in a separate account

Experiments with an agent against production zones carry the same risk as a live change. Use a separate Cloudflare account or a non-production zone for trials, with its own token and no access to billing or production DNS. Promote a configuration to production only after the team has reviewed the change. This separation is a common control for staff who are still learning what an agent will attempt, and it costs little to set up beyond the account itself.

Ownership of optional servers

The product-specific servers, such as documentation, container, Browser Run, DEX and CASB, are optional, and Cloudflare recommends most users start with the main API server. Each extra server adds its own tools and grant prompts, so an approved connection may reach more than the team meant to enable. Keep a written list of approved servers per team, remove the ones no one uses, and review the list whenever Cloudflare changes its catalog.

Order of work before staff connect an agent to a production account

This sequence moves from knowing what the Cloudflare MCP servers can reach to a tested, narrowed configuration that is retested after each change. Each step ends with a record a reviewer can check, so the production decision rests on evidence rather than on the default grant.

  1. Inventory which MCP servers staff actually need

    The security or platform lead lists each team's intended use, such as DNS changes, Workers deployments, or reading security settings, and maps it to a server. Cloudflare documents a main Cloudflare API MCP server that covers over 2,500 endpoints plus developer documentation, and most people should start there. Done when every planned connection has a named owner, a stated purpose, and a server name written down.

  2. Decide the permission grant for each role

    During OAuth, Cloudflare redirects the user to authorize the connection and lets them select the permissions granted to the agent, so the grant is chosen per connection. The identity or security team sets a grant for each role that covers only the services that role needs, and writes down the exclusions. Done when each role has a written grant that a reviewer could compare against the account's services.

  3. Decide whether MCP server portals are required

    Cloudflare documents MCP server portals as a Cloudflare One (Access) feature. The team decides whether central control over which clients and servers staff can reach is needed, based on how many people will connect and how much change control the organization requires. Done when the decision is recorded with the reason, and the portal is either scheduled for configuration or formally waived.

  4. Disable tools and prompts that are not needed

    The MCP server portals documentation describes managing tools and prompts and turning off individual tools or prompts, which is where tool-level restrictions are set. The administrator reviews the tool list the agent will see, switches off anything the approved use cases do not require, and records which tools remain enabled. Done when the exported or screenshotted tool list matches the approved list for each role.

  5. Leave optional product servers out

    Cloudflare describes product-specific servers, such as those for documentation, containers, Browser Run, DEX and CASB, as optional. The team connects only the servers that map to an approved use case in step one and leaves the rest unconnected. Done when the list of connected servers is short, justified, and identical to the inventory.

  6. Test in a non-production account first

    Before any connection touches production, the team connects a test account with the same grant and tool list and attempts the approved tasks plus a set of out-of-scope requests, such as changing a service that should be blocked. Cloudflare documents that generated code runs in an isolated Dynamic Worker sandbox, but the team confirms the behavior in its own account. Done when every approved task succeeds, every out-of-scope request fails, and the results are filed for review.

  7. Retest after every change to grants or tools

    Any change to a role's grant, a tool toggle, a portal setting, or a server addition triggers the same test set again before the change reaches production. The security reviewer signs off on the retest result and confirms the production configuration still matches the approved record. Done when the retest results and the updated configuration record are both on file, and the production connection is approved against them.

What a security reviewer asks to see for Cloudflare MCP controls

This table lists the controls a security reviewer should request before approving Cloudflare's MCP servers, with the evidence to collect and where each control is set. Use it as a checklist during the review: each row names a control, the proof an assessor expects, and the person who should own it. Treat any row without written evidence as an open item before rollout.

ControlEvidence to collectWhere it comes fromOwner
Permissions granted per connectionSaved record of the scopes chosen on the OAuth consent screen for each client and userOAuth authorization step, where you select the permissions to grant to the agentIT or platform admin
Endpoint reach of the main serverConfirmed list of product areas the main Cloudflare API MCP server can reach, such as DNS, Workers, R2 and Zero TrustCloudflare Agents docs describing coverage of over 2,500 endpointsSecurity engineer
Sandbox design for generated codeWritten description of how generated JavaScript runs in an isolated Dynamic Worker, and what network and account access that sandbox hasCloudflare Agents docs on the Code Mode pattern and Dynamic Worker sandboxSecurity engineer
Portal tool and prompt settingsExport or screenshot of which individual tools and prompts are turned off in the MCP server portalMCP server portals docs sections on managing tools and promptsCloudflare One administrator
Optional servers enabledInventory of which product-specific servers (documentation, container, Browser Run, DEX, CASB) are connected and whyCloudflare docs stating these servers are optional and most users should use the main API serverPlatform owner
Open source version reviewedCommit or release reference of the cloudflare/mcp code reviewed, with the Apache-2.0 license notedGitHub repository for the Cloudflare API MCP serverAppsec or code review team

Questions buyers ask before approving Cloudflare MCP for agents

Does single sign-on apply when staff connect through the Cloudflare login?

Connections to Cloudflare's managed MCP servers use OAuth, so each user is redirected to Cloudflare to authorize the connection and select the permissions for that agent. Whether your identity provider governs that sign-in depends on how your Cloudflare account is configured, and the supplied materials do not settle it. Confirm with Cloudflare which login methods and identity provider settings apply to your account, whether enforced SSO covers OAuth authorizations for MCP clients, and what happens to an existing grant when a user leaves your identity provider. Ask for the answer in writing, then test a departing user account in a non-production setup. Your identity team should also confirm which Cloudflare role the authorizing user holds, because that role shapes what the agent can change.

Can we restrict the main Cloudflare API MCP server to one product?

The main server reaches more than 2,500 endpoints across DNS, Workers, R2, Zero Trust and other products, so a broad grant lets an agent change many services at once. The permissions you select at connection time are the first place to narrow access. Cloudflare's docs describe product-specific servers, including documentation, container, Browser Run, DEX and CASB, as optional, and recommend the main server for most people. If your need is one product, check whether that product's dedicated server fits before connecting the broad one. Confirm with Cloudflare whether a grant can be limited to a single product inside the main server, and how tools outside the grant behave. Record the chosen grant for each connection in your rollout notes so a reviewer can trace it later.

What does an MCP server portal add beyond the connection grant?

An MCP server portal is documented as a Cloudflare One (Access) feature, and it adds central control over which MCP servers and tools your users reach. The portal documentation includes sections on managing tools and prompts and on turning off individual tools or prompts, which is where tool-level restrictions are configured. Those controls sit on top of the grant each user selects, so a portal lets an administrator narrow what the connection can do without relying on each user's choices. Confirm with Cloudflare how portal access policies are assigned to users and groups, how changes to a portal are logged, and whether a disabled tool is blocked for every connected client. Test a turned-off tool from a live client before you tell staff it is blocked. Portals also depend on Cloudflare One, so confirm the plan and licensing that apply.

Can our own team set this up without an outside partner?

A small team can often handle the basic connection, because the authorization is a standard OAuth flow and the controls are documented in Cloudflare's own pages. The harder work is deciding the grant for each person, choosing which tools to turn off, and showing a security reviewer that the result holds. Your team needs a named owner for the grant list, a test that confirms a blocked write fails, and a current record of which accounts can reach the main server. Teams without AI security testing experience often miss prompt injection carried in documents or tool output, so an independent test is a common addition. DeployOpen tests agent and MCP setups, including tool permissions, credential handling and admin settings, and delivers a findings report with fixes and a retest under a fixed scope agreed in writing.

What drives the effort of a Cloudflare MCP security review?

Effort rises with the number of people and machines that connect, and with whether those machines are managed or personal. The breadth of each grant matters most, because every additional Cloudflare product an agent must touch adds configuration to review and test. Portal use adds work, since each managed tool and prompt needs a decision and a check that it is blocked where intended. A written inventory of accounts, roles and grants shortens the review, and a missing inventory usually lengthens it. Evidence requirements also add effort: a questionnaire or compliance file needs documented settings, test results and an owner for each control. Finally, decide early whether any automation will use OAuth connections or API tokens, because each path has its own review steps and its own owner.

What does a scoped Cloudflare MCP review cost, and what should the quote include?

DeployOpen does not publish a price list, and a quote follows from the written scope. The cost depends on which parts are in scope: the grant and tool review, testing of any portal configuration, prompt injection testing of the agent connection, the findings report, fixes and a retest. The initial review and fixes are one-time work, while retesting after grants change, new servers are added or new users onboard is recurring and can be covered by a retainer. Separately, Cloudflare sets its own plan and product fees, so confirm with Cloudflare which plan applies to your account. Ask the quote to name the servers and products covered, the number of connection paths tested, who performs each fix, the retest terms and the deliverables. Timing should appear as a plan agreed in writing.

Which risky tools on the main server should we review first?

Start with the tools that move from search to action. The main server exposes search() and execute() to find and call API endpoints, plus docs() to search Cloudflare developer documentation. The execute() path is the one that changes configuration, because the model writes JavaScript against a typed representation of the OpenAPI spec and that code runs inside an isolated Dynamic Worker sandbox. The sandbox isolates the generated code, but it does not by itself narrow what the granted permissions allow, so the grant remains the main control. Review which products each grant can reach, whether any write permissions are unnecessary, and whether portal settings can turn off execution for groups that only need documentation. Confirm these behaviors with Cloudflare before you approve a broad grant.

Primary sources to check each Cloudflare MCP claim

Before you approve the Cloudflare API MCP server, read each claim in this topic against the primary Cloudflare pages rather than against summaries, including this one. Start with Cloudflare's own MCP servers, which lists the managed remote servers, their /mcp Streamable HTTP endpoints, and the search(), execute() and docs() tools. Confirm the endpoint for the main server, the coverage the page states, and the note that most organizations should use the main server rather than the optional product-specific ones. Record the date you read the page, because Cloudflare's documentation changes between releases.

The page that governs your tool-level restrictions is MCP server portals. Read its sections on managing tools and prompts and on turning off individual tools or prompts. Confirm whether those settings apply to the main API server when it is reached through a portal, and what happens to a connection made directly to the endpoint without one. Also confirm that portals are documented as a Cloudflare One (Access) feature, which determines the plan and license you need to check with your account team. Then read Securing MCP servers to confirm how the guide describes OAuth 2.1 token validation and scope-based access control in practice, and compare that with the permission screen you see at connection time.

How DeployOpen tests and documents a Cloudflare MCP rollout

DeployOpen reviews Cloudflare MCP security as a fixed-scope engagement that covers what the connected agent can read and change, which permissions are granted at connection time, and which tools are turned off. Each step ends in written evidence that your security and platform teams can check and retest.

How we scope

  • Agree in writing which Cloudflare MCP servers, accounts and Cloudflare services are in the review.
  • Record the OAuth permissions each planned connection will request and who approves them.
  • Confirm which optional product servers are needed, so unused servers can be excluded from the rollout.

How we build

  • Test the search, execute and docs tools against prompt injection and unexpected API calls.
  • Check whether write actions across DNS, Workers, R2 and Zero Trust match the granted permissions.
  • Configure MCP server portals to turn off risky tools and prompts, then verify each change takes effect.

How we hand over

  • Deliver a findings report listing each risky tool, permission gap and recommended fix with its owner.
  • Document the approved permission set, portal tool settings and the steps to restore them after changes.
  • Run a retest after fixes so your reviewers see the locked-down state confirmed, not assumed.

How we support

  • Ongoing support is available as a retainer for reviewing new Cloudflare MCP servers as they are added.
  • Retainers can cover periodic retesting when permissions, portal rules or agent clients change.
  • Ask us to confirm any setting against the current Cloudflare documentation before your review closes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.