Cloudflare MCP — Auth Setup
Cloudflare uses scoped API tokens and an account ID to authenticate requests to your account.
1. Get your credentials
- Open the Cloudflare API tokens page (opens Cloudflare — we never see your token)
- Click Create Token and choose a template or custom permissions
- Copy the token after creation — it will not be shown again
- Your Account ID is shown in the right sidebar of the Cloudflare dashboard overview page
2. Set environment variables
macOS / Linux — add to ~/.zshrc or ~/.bashrc:
export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN_HERE
export CLOUDFLARE_ACCOUNT_ID=YOUR_ACCOUNT_ID_HERE
Then run source ~/.zshrc (or open a new terminal).
Windows — run in Command Prompt (then restart):
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN_HERE"
setx CLOUDFLARE_ACCOUNT_ID "YOUR_ACCOUNT_ID_HERE"
3. Verify
npx claude-skills doctor
You should see ✅ next to the Cloudflare MCP entry. If you see ❌, confirm the token is set: echo $CLOUDFLARE_API_TOKEN.
4. Restart Claude Code
Quit and reopen Claude Code (or run /mcp list inside Claude Code to confirm the Cloudflare MCP appears).

