# Cloudflare MCP server

> Lets an AI client search and call any Cloudflare API endpoint, run GraphQL analytics queries, and read Cloudflare developer docs.

- Repository: https://github.com/cloudflare/mcp
- Page: https://hostedmcp.org/servers/cloudflare/mcp
- Official: yes
- Transport: —
- Stars: 1096
- License: Apache-2.0

## Tools (4)

- `docs`
- `search`
- `execute`
- `whoami`

## FAQ

### Can I use a Cloudflare API token instead of OAuth?

Yes. Create a Cloudflare API token with the permissions you need; both user tokens and account tokens are supported. Account tokens need the Account Resources : Read permission so the account ID is auto-detected.

### Which Cloudflare products does the MCP server support?

It covers Workers, KV, R2, D1, Pages, DNS, Firewall, Load Balancers, Stream, Images, AI Gateway, Vectorize, Access, Gateway and more.

### How does code mode keep token usage low?

Instead of exposing thousands of tool schemas, the server keeps the OpenAPI spec on its side and exposes three tools; the agent writes JavaScript to search the spec and execute API calls.

### Can I turn off code mode?

Yes, append ?codemode=false to the MCP URL to register one tool per Cloudflare API method, though this greatly increases token cost.
