Cloudflare runs a catalog of managed remote MCP servers which you can connect to using OAuth on clients like Claude ↗︎, Windsurf ↗︎, our own AI Playground ↗︎ or any SDK that supports MCP ↗︎.
These MCP servers allow your MCP client to read configurations from your account, process information, make suggestions based on data, and even make those suggested changes for you. All of these actions can happen across Cloudflare's many services including application development, security and performance.
Connect to each server's Streamable HTTP endpoint at /mcp. The servers support the MCP 2026-07-28 specification and stateless requests from 2025 Streamable HTTP clients.
The Cloudflare API MCP server ↗︎ at https://mcp.cloudflare.com/mcp is the only MCP server you need to work with Cloudflare. It provides access to the entire Cloudflare API — over 2,500 endpoints across DNS, Workers, R2, Zero Trust, and every other product — and to the Cloudflare developer documentation.
In default Code Mode, use search and execute to discover and call API endpoints, docs to search Cloudflare developer documentation, and whoami to identify the connected user or account.
To report a bug, feature request, or workaround to Cloudflare, use the submit_feedback tool.
It uses the search-and-execute Code Mode pattern, a technique where the model writes JavaScript against a typed representation of the OpenAPI spec and the Cloudflare API client, rather than loading individual tool definitions for each endpoint. The generated code runs inside an isolated Dynamic Worker sandbox.
This approach uses approximately 1,000 tokens regardless of how many API endpoints exist. An equivalent MCP server that exposed every endpoint as a native tool would consume over 1 million tokens — more than the entire context window of most foundation models.
| Approach | API tools | Token cost |
|---|---|---|
| Native MCP (full schemas) | 2,594 | ~1,170,000 |
| Native MCP (required params only) | 2,594 | ~244,000 |
| Code Mode | 2 | ~1,000 |
Add the following configuration to your MCP client:
{
"mcpServers": {
"cloudflare-api": {
"url": "https://mcp.cloudflare.com/mcp"
}
}
}When you connect, you will be redirected to Cloudflare to authorize via OAuth and select the permissions to grant to your agent.
For CI/CD or automation, you can create a Cloudflare API token ↗︎ with the permissions you need and pass it as a bearer token in the Authorization header. Both user tokens and account tokens are supported.
For more information, refer to the Cloudflare MCP repository ↗︎.
You can install the Cloudflare Skills plugin ↗︎, which bundles the Cloudflare MCP servers alongside contextual skills and slash commands for building on Cloudflare. The plugin works with any agent that supports the Agent Skills standard, including Claude Code, OpenCode, OpenAI Codex, and Pi.
Install using the plugin marketplace ↗︎:
/plugin marketplace add cloudflare/skillsInstall from the Cursor Marketplace, or add manually via Settings > Rules > Add Rule > Remote Rule (Github) with cloudflare/skills.
Install using the npx skills ↗︎ CLI:
npx skills add https://github.com/cloudflare/skillsClone the cloudflare/skills ↗︎ repository and copy the skill folders into the appropriate directory for your agent:
| Agent | Skill directory | Docs |
|---|---|---|
| Claude Code | ~/.claude/skills/ |
Claude Code skills ↗︎ |
| Cursor | ~/.cursor/skills/ |
Cursor skills ↗︎ |
| OpenCode | ~/.config/opencode/skills/ |
OpenCode skills ↗︎ |
| OpenAI Codex | ~/.codex/skills/ |
OpenAI Codex skills ↗︎ |
| Pi | ~/.pi/agent/skills/ |
Pi coding agent skills ↗︎ |
search and execute are separate MCP tools, not methods on a shared cloudflare object. Each takes a JSON object with a code string containing a JavaScript async arrow function (for example, async () => ...). For multi-account sessions, execute also accepts an optional account_id argument that binds accountId inside the sandbox.
The default Code Mode connection (https://mcp.cloudflare.com/mcp) provides the following tools:
| Tool | Purpose | Example arguments |
|---|---|---|
search |
Discovers endpoints and schemas in the local OpenAPI spec. Makes no API calls. |
{"code":"async () => spec.paths['/accounts'].get.summary"} |
execute |
Calls the Cloudflare API through cloudflare.request() using the connection credentials. |
{"code":"async () => (await cloudflare.request({ method: 'GET', path: '/accounts' })).result"} |
docs |
Searches Cloudflare developer documentation. | {"query":"List Cloudflare accounts"} |
whoami |
Returns an opaque profile id and, if available, a display email or name. |
{} |
If your MCP client runs its own Code Mode layer and needs a tool for each API operation instead of search and execute, connect to https://mcp.cloudflare.com/mcp?codemode=false. Both docs and whoami stay available in that mode. When enabled on the server, submit_feedback is also available in both modes to send feedback about Cloudflare products or the MCP server.
Cause: search runs JavaScript against the local OpenAPI spec in a sandbox without network access. It does not expose cloudflare.
Fix: Use search to look up paths and schemas in spec.paths, then call the endpoint with cloudflare.request() inside execute. Do not reconnect or add permissions to resolve this error.
Cause: GET /user/tokens/verify (Verify user token) and GET /accounts/{account_id}/tokens/verify (Verify account token) verify Cloudflare API tokens, not OAuth grants. With OAuth, calling either endpoint always returns HTTP 401 (code 1000) even when the MCP connection works. Calling the wrong verification endpoint for a user or account API token — or passing a mismatched account_id — returns the same error. The tool error may suggest reconnecting or checking token expiry even when your connection is healthy.
Fix: Do not reconnect for this error. Check identity and access based on how you connected. The MCP server attaches your credentials to API calls, so you do not need to paste tokens into chat.
- Connected identity (OAuth or API token): Call
whoamito get the connected profile. It returnsuser:<USER_ID>(andemail, if available) for OAuth and user API tokens, oraccount:<ACCOUNT_ID>(andname, if available) for account API tokens. Do not pass this profileidin API paths — useGET /accountsinexecutefor raw account IDs, or the pre-boundaccountIdvariable for single-account sessions. Neitherwhoaminor token verification lists your effective permissions. - OAuth access: Skip token verification. OAuth connections start with baseline
user:readandaccount:readscopes, soGET /accountslists visible account IDs but does not confirm access to other operations. Call the read endpoint you need inexecuteto check access to that operation. - API tokens: Match the verification endpoint to the token type shown by
whoami: inexecute, callGET /user/tokens/verifyfor a user token (user:) orGET /accounts/{account_id}/tokens/verifyfor an account token (account:).
If the MCP server can identify a missing OAuth scope and the call is safe to retry, it can return an insufficient_scope challenge. If your client supports scope challenge handling ↗︎, approve the prompt to grant that scope. If no prompt appears, check the tool error or HTTP 403 (insufficient_scope) response for the required scope, then reconnect and grant that scope (or choose a broader access preset on the consent screen). If the operation does not support OAuth, use an API token with the required permission.
The following product-specific MCP servers are available for targeted use cases. These are optional — the Cloudflare API MCP server already covers the full Cloudflare API. Most people should just use the main Cloudflare API MCP server.
| Server Name | Description | Server URL |
|---|---|---|
| Documentation server ↗︎ | Get up to date reference information on Cloudflare | https://docs.mcp.cloudflare.com/mcp |
| Container server ↗︎ | Spin up a sandbox development environment | https://containers.mcp.cloudflare.com/mcp |
| Browser Run server ↗︎ | Fetch web pages, convert them to markdown and take screenshots | https://browser.mcp.cloudflare.com/mcp |
| Digital Experience Monitoring server ↗︎ | Get quick insight on critical applications for your organization | https://dex.mcp.cloudflare.com/mcp |
| Cloudflare One CASB server ↗︎ | Quickly identify any security misconfigurations for SaaS applications to safeguard users & data | https://casb.mcp.cloudflare.com/mcp |
| Agents SDK Documentation server ↗︎ | Token-efficient search of the Cloudflare Agents SDK documentation | https://agents.cloudflare.com/mcp |
Check the GitHub page ↗︎ to learn how to use Cloudflare's remote MCP servers with different MCP clients.