Cloudflare MCP Server & CLI
A free, open source Cloudflare MCP server and CLI that lets Claude Code, Codex, Cursor and other AI agents manage your DNS records, clear the cache and change domain settings.
0.0(0 ratings)- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
claude mcp add cloudflare \
-e CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
In Claude Code, type /mcp. Cloudflare should show as connected.
/mcp
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
claude mcp add cloudflare -e CLOUDFLARE_API_TOKEN="YOUR_API_TOKEN" -- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
In Claude Code, type /mcp. Cloudflare should show as connected.
/mcp
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
claude mcp add cloudflare \
-e CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
In Claude Code, type /mcp. Cloudflare should show as connected.
/mcp
- 1Download the extension
Download the Claude Desktop extension.
- 2
Double-click it, and Claude Desktop installs it.
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
codex mcp add cloudflare \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Codex lists it.
codex mcp list
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
codex mcp add cloudflare --env CLOUDFLARE_API_TOKEN="YOUR_API_TOKEN" -- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Codex lists it.
codex mcp list
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
codex mcp add cloudflare \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Codex lists it.
codex mcp list
- 1
Open Cursor's settings, go to the MCP tab, and click Add new global MCP server.
- 2
Add the server.
Put your own API token in place of the example.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Open the MCP tab again. It should show 29 tools.
- 1
Open the Command Palette and run MCP: Open User Configuration.
- 2
Add the server to that mcp.json.
If the file already has servers, add only this one inside servers. Put your own API token in place of the example.
{
"servers": {
"cloudflare": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
}
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
copilot mcp add cloudflare \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Copilot CLI has it.
copilot mcp get cloudflare
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
copilot mcp add cloudflare --env CLOUDFLARE_API_TOKEN="YOUR_API_TOKEN" -- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Copilot CLI has it.
copilot mcp get cloudflare
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
copilot mcp add cloudflare \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN \
-- npx -y @thenavidm/cloudflare-mcp-cli@latest - 2
Check that Copilot CLI has it.
copilot mcp get cloudflare
- 1
Open your Gemini CLI settings.
~/.gemini/settings.json - 2
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own API token in place of the example.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Open your Gemini CLI settings.
%USERPROFILE%\.gemini\settings.json - 2
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own API token in place of the example.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Open your Gemini CLI settings.
~/.gemini/settings.json - 2
Add the server to settings.json.
If the file already has servers, add only this one inside mcpServers. Put your own API token in place of the example.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart Gemini CLI and type /mcp to check it.
/mcp
- 1
Open your OpenCode config.
~/.config/opencode/opencode.json - 2
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own API token in place of the example.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cloudflare": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"enabled": true,
"environment": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart OpenCode.
- 1
Open your OpenCode config.
%USERPROFILE%\.config\opencode\opencode.json - 2
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own API token in place of the example.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cloudflare": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"enabled": true,
"environment": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart OpenCode.
- 1
Open your OpenCode config.
~/.config/opencode/opencode.json - 2
Add the server under mcp.
If the file already has servers, add only this one inside mcp. Put your own API token in place of the example.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"cloudflare": {
"type": "local",
"command": ["npx", "-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"enabled": true,
"environment": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
} - 3
Restart OpenCode.
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
openclaw mcp add cloudflare \
--command npx \
--arg -y \
--arg @thenavidm/cloudflare-mcp-cli@latest \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN - 2
Check that it starts and lists its tools.
openclaw mcp doctor cloudflare --probe
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
openclaw mcp add cloudflare --command npx --arg -y --arg @thenavidm/cloudflare-mcp-cli@latest --env CLOUDFLARE_API_TOKEN="YOUR_API_TOKEN" - 2
Check that it starts and lists its tools.
openclaw mcp doctor cloudflare --probe
- 1
Add it with a single command in a terminal.
Put your own API token in place of the example.
openclaw mcp add cloudflare \
--command npx \
--arg -y \
--arg @thenavidm/cloudflare-mcp-cli@latest \
--env CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN - 2
Check that it starts and lists its tools.
openclaw mcp doctor cloudflare --probe
- 1
In the agent panel, click the … menu, then MCP Servers, Manage MCP Servers and View raw config.
- 2
Add the server to mcp_config.json.
If the file already has servers, add only this one inside mcpServers. Put your own API token in place of the example.
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "@thenavidm/cloudflare-mcp-cli@latest"],
"env": {
"CLOUDFLARE_API_TOKEN": "YOUR_API_TOKEN"
}
}
}
}
- 1
Open your Hermes config.
~/.hermes/config.yaml - 2
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own API token in place of the example.
mcp_servers:
cloudflare:
command: "npx"
args: ["-y", "@thenavidm/cloudflare-mcp-cli@latest"]
env:
CLOUDFLARE_API_TOKEN: "YOUR_API_TOKEN"
- 1
Open your Hermes config.
%USERPROFILE%\.hermes\config.yaml - 2
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own API token in place of the example.
mcp_servers:
cloudflare:
command: "npx"
args: ["-y", "@thenavidm/cloudflare-mcp-cli@latest"]
env:
CLOUDFLARE_API_TOKEN: "YOUR_API_TOKEN"
- 1
Open your Hermes config.
~/.hermes/config.yaml - 2
Add the server under mcp_servers.
If the file already has mcp_servers, add only this one under it. Put your own API token in place of the example.
mcp_servers:
cloudflare:
command: "npx"
args: ["-y", "@thenavidm/cloudflare-mcp-cli@latest"]
env:
CLOUDFLARE_API_TOKEN: "YOUR_API_TOKEN"
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
mkdir -p ~/.claude/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.claude/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Claude Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.claude\skills\cloudflare" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\cloudflare-mcp-cli\SKILL.md" "$HOME\.claude\skills\cloudflare\" - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Claude Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Claude Code the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Claude Code what each command does and which ones ask first.
mkdir -p ~/.claude/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.claude/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Claude Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Claude Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
mkdir -p ~/.agents/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.agents/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Codex to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.agents\skills\cloudflare" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\cloudflare-mcp-cli\SKILL.md" "$HOME\.agents\skills\cloudflare\" - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Codex to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Codex the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Codex what each command does and which ones ask first.
mkdir -p ~/.agents/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.agents/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Codex to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Codex finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Cursor to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Cursor to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Cursor to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Cursor finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask VS Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask VS Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask VS Code to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so VS Code finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
mkdir -p ~/.copilot/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.copilot/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Copilot CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.copilot\skills\cloudflare" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\cloudflare-mcp-cli\SKILL.md" "$HOME\.copilot\skills\cloudflare\" - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Copilot CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give Copilot CLI the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells Copilot CLI what each command does and which ones ask first.
mkdir -p ~/.copilot/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.copilot/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask Copilot CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Copilot CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Gemini CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Gemini CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Gemini CLI to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Gemini CLI finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
mkdir -p ~/.config/opencode/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.config/opencode/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenCode to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.config\opencode\skills\cloudflare" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\cloudflare-mcp-cli\SKILL.md" "$HOME\.config\opencode\skills\cloudflare\" - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenCode to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenCode the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenCode what each command does and which ones ask first.
mkdir -p ~/.config/opencode/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.config/opencode/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenCode to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenCode finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
mkdir -p ~/.openclaw/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.openclaw/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenClaw to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
New-Item -ItemType Directory -Force "$HOME\.openclaw\skills\cloudflare" | Out-Null
Copy-Item "$(npm root -g)\@thenavidm\cloudflare-mcp-cli\SKILL.md" "$HOME\.openclaw\skills\cloudflare\" - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenClaw to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Give OpenClaw the skill, so it knows every command.
The skill is the SKILL.md in the package. It tells OpenClaw what each command does and which ones ask first.
mkdir -p ~/.openclaw/skills/cloudflare
cp "$(npm root -g)/@thenavidm/cloudflare-mcp-cli/SKILL.md" ~/.openclaw/skills/cloudflare/ - 3
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 4
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 5
Ask OpenClaw to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so OpenClaw finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Antigravity to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Antigravity to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Antigravity to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Antigravity finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Hermes to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Hermes to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
Ask Hermes to use cloudflare-cli.
Running cloudflare-cli on its own lists every command, so Hermes finds the one it needs.
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.zshrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
List every command, then try one.
cloudflare-cli
cloudflare-cli list-zones
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
setx CLOUDFLARE_API_TOKEN "YOUR_API_TOKEN" - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
List every command, then try one.
cloudflare-cli
cloudflare-cli list-zones
- 1
Install the CLI. It needs Node 22 or newer.
npm install -g @thenavidm/cloudflare-mcp-cli@latest - 2
Save your Cloudflare details, so every new session has them.
Put your own API token in place of the example.
echo 'export CLOUDFLARE_API_TOKEN=YOUR_API_TOKEN' >> ~/.bashrc - 3
Check your setup.
It names anything that's wrong and the fix.
cloudflare-cli doctor - 4
List every command, then try one.
cloudflare-cli
cloudflare-cli list-zones
Needs Node 22 or newer and a Cloudflare API token. Make one in two minutes.
It's free and open source. If it saves you time, star it on GitHub, so more people find it.
This free Cloudflare MCP server and CLI gives your AI real access to your Cloudflare account: domains, DNS records, cache, domain settings, rulesets and analytics. It reads and changes DNS records, clears the cache, reads and changes domain settings and rulesets, lists your Workers and runs analytics queries.
It's one install with two ways in. Claude, Codex, Cursor or any other MCP app calls its 29 tools for you, and the same tools work as a CLI that agents like Claude Code, Codex and OpenCode run, or that you type yourself.
In this guide, I'll show you:
- What the Cloudflare MCP server & CLI is, and what you can ask it
- How to install it and check that it works
- When to use the MCP server, and when the CLI
- Every tool, and how to keep your account safe
Every tool on this page comes from the server itself, and every cost was measured in Claude Code.
Key takeaways
What is the Cloudflare MCP server & CLI?
The Cloudflare MCP server & CLI is a free, open source program that lets AI agents manage your Cloudflare domains for you, in two ways. The MCP server is what an AI app like Claude, Codex or Cursor connects to, through MCP (Model Context Protocol), the open standard AI apps use to call outside tools.
You ask in plain language. Your AI picks the right tool, and the server makes the call to Cloudflare's own API.
The CLI is the same program as commands. cloudflare-cli list-dns-records runs the same code your AI runs when you ask for a domain's DNS records, whether an agent like Claude Code runs it or you do.
In an AI OS, the layer that connects your AI to your context, your data and your tools, a server like this is how your AI reaches Cloudflare. I explain how the parts fit together in how to build an AI operating system, and here's how I use AI myself.
What can you ask it?
Once it's set up, you ask the way you'd ask an assistant. These are real prompts it handles:
Try askingList the DNS records for example.com, and tell me which ones are proxied.
Add the TXT record Google Search Console gave me for example.com.
Point blog.example.com at my new server's IP, without the proxy.
Clear the cache for my homepage and my pricing page.
Which SSL mode is example.com using?
How many requests did example.com get in the last 24 hours?
The second one shows why this is useful. Your AI adds the exact record Google asks for, and you approve it before it goes live, without hunting for the right screen in the dashboard.
It works well next to my WordPress MCP server and Google Search Console MCP server, so your AI can update the WordPress sites behind your domains and see how those sites do in Google in the same chat. Every server I've made is on my MCP servers page.
For the rest of your site, my free domain checker and SPF record generator help too. I compare building your own site on Cloudflare with the alternatives in the best website builders.
How to install the Cloudflare MCP server
Pick your app in the box at the top of this page. Each one is a single command or a pasted block, and they all run through npx, so there's nothing to install first.
Windsurf, Zed and Cline take the same server, though they don't have a tab in the box yet. Follow the box's Cursor tab, and put its block here instead:
| App | Where the block goes |
|---|---|
| Windsurf | In the Cascade panel, open the Actions menu (…) and choose Open MCP config file, then paste the block. |
| Cline | Click the MCP Servers icon in the Cline panel, open the Configure tab, click Configure MCP Servers, and paste the block. |
| Zed | Go to Settings, then AI, then MCP Servers, and choose Add Server, then Add Local Server. Enter the block's command, arguments and variables, and Zed saves them under context_servers. |
Watch out: Use an API token, never your Global API Key. A token can be limited to the domains and permissions you pick, and the server only accepts tokens.
Set up your Cloudflare account
It takes two minutes.
CLOUDFLARE_API_TOKEN in the command for your app.These are the permissions each kind of work needs:
| What you want | Permission to add |
|---|---|
| Read domains and DNS records | Zone: Read and DNS: Read |
| Change DNS records | DNS: Edit |
| Clear the cache | Cache Purge |
| Read or change domain settings | Zone Settings: Read or Edit |
| Read your Workers list | Workers Scripts: Read |
| Run analytics queries | Analytics: Read |
An account-owned token, made under Manage Account and then API Tokens, works too. Set CLOUDFLARE_TOKEN_KIND to account and CLOUDFLARE_ACCOUNT_ID to your account ID, so the doctor checks it the right way.
CLOUDFLARE_ZONE_ID and CLOUDFLARE_ACCOUNT_ID are optional defaults, so you don't have to name the domain every time. They don't limit what the token can reach, because the token's own settings do that.
To keep the token out of your app's config, save it alone in a file only you can read, and point CLOUDFLARE_TOKEN_FILE at that file's full path instead.
Check that it works
Run the doctor with --network. It checks your settings, then asks Cloudflare whether the token is active, without reading or changing a domain.
npx -y @thenavidm/cloudflare-mcp-cli doctor --networkWhen every line has a check mark, restart your app and ask it to list your domains. If the token is active but a domain read fails, the token doesn't include that domain or that permission.
In Claude Code, /mcp also shows whether the Cloudflare server is connected. It's one of the Claude Code commands worth knowing.
Use the Cloudflare CLI
The CLI is the same 29 tools as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal or a script.
Every tool name becomes a command with dashes, so list_dns_records runs as cloudflare-cli list-dns-records.
npm install -g @thenavidm/cloudflare-mcp-cli
cloudflare-cli
cloudflare-cli list-zones --per-page 10
cloudflare-cli list-dns-records --zone-id YOUR_ZONE_ID --type TXT
cloudflare-cli get-zone-setting --zone-id YOUR_ZONE_ID --setting-id ssl
cloudflare-cli purge-cache --zone-id YOUR_ZONE_ID --payload '{"files":["https://example.com/pricing"]}' --confirmThe bare cloudflare-cli lists every command, cloudflare-cli which <words> finds the command for a task, and cloudflare-cli <command> --help shows what a command takes. DNS changes, cache purges, setting changes and ruleset changes need --confirm, the terminal's version of your approval.
cloudflare-cli install <app> adds the server to Claude Code, Codex, Claude Desktop, Cursor, VS Code or Gemini CLI, in each app's own format.
These are the flags you'll use most:
| Flag | What it does |
|---|---|
--json | Prints JSON |
--compact | Prints the JSON on one line |
--select a,b.c | Keeps only those fields, and a dotted path goes deeper |
--agent | Machine mode: compact JSON, no prompts, and it never confirms anything |
--confirm | Lets a write that asks first go ahead |
--dry-run | Shows what a write would do, without doing it |
A script can branch on the exit code:
| Exit code | What it means |
|---|---|
| 0 | It worked |
| 1 | Something unexpected went wrong |
| 2 | The command was typed wrong, or a write needed --confirm |
| 3 | It wasn't found |
| 4 | Cloudflare rejected the credentials |
| 5 | Cloudflare failed or couldn't be reached |
| 7 | You hit a rate limit, so wait and try again |
| 10 | Nothing is set up yet |
MCP server or CLI: which one?
Both are the same program with the same 29 tools. The difference is when your AI pays for them, in the tokens it reads.
- MCP server
- 144,100 tokens
- CLI
- Nothing
- MCP server
- 610 tokens
- CLI
- Nothing
- MCP server
- Nothing more, or in Claude Code the tools it picks
- CLI
- 4,000 tokens, once
- MCP server
- 2,881,000 tokens
- CLI
- 4,000 tokens
- MCP server
- Yes
- CLI
- No, there's no terminal there
- MCP server
- No
- CLI
- Yes
An app that loads every tool up front sends the full list with every message, whether you mention Cloudflare or not. Claude Code doesn't by default: its tool search sends only the tool names and the server's instructions, and loads a tool's full definition when your AI reaches for it.
The CLI costs nothing until Cloudflare comes up. Then your agent reads its skill file once and runs the commands it needs. With the skill added, Claude Code also lists its one-line description with every message, about 60 tokens.
When the whole conversation is about Cloudflare, the gap closes. Then the MCP server is the better experience, because you ask in plain language and your AI never has to look up a command.
How to spend less
In Claude Code, leave tool search on, which it is unless you've set ENABLE_TOOL_SEARCH=false.
Turn the server off when you aren't working on your domains. In Claude Code that's the /mcp panel, and every AI app has its own switch. CLOUDFLARE_READ_ONLY=1 cuts it to the 18 reading tools.
Or install the CLI and connect the server later, on the days it earns its place. Every tool stays in reach, and the standing cost drops to nothing.
Every number here was measured on October 5, 2026 in Claude Code 2.1.286 with Claude Opus 5.5. It's the same one-line prompt with and without the server connected, once with tool search off so every tool loads, and once with Claude Code's default. The skill was measured the same way, and other apps and models count tokens a little differently.
Change DNS and the cache safely
Before a change, your AI reads the domain and the record, so it knows exactly what it's changing. update_dns_record changes only the fields you name, and overwrite_dns_record replaces the whole record, so a field you leave out goes back to its default.
For several changes at once, preview_dns_batch checks up to 50 of them on your computer and gives the batch a fingerprint. apply_dns_batch sends them only with that same fingerprint. Cloudflare applies a batch all together or not at all, though DNS around the world still takes a little while to catch up.
purge_cache clears cached files by URL, cache tag, hostname, URL prefix or the whole domain. A success means Cloudflare took the request, and the next visit to a cleared page shows MISS in its CF-Cache-Status header.
Rulesets are where redirects, custom rules and header changes live now. Your AI reads them, and changes them only with your approval. Old Page Rules can be read, to plan a move to rulesets, but not changed.
Watch out: This server doesn't deploy Workers or touch their code. It lists your Workers scripts, and Wrangler is still the tool for deploying them.
Every Cloudflare tool
The tables below list all 29 tools, grouped by what they're for. Of these, 18 only read, and 11 change something in your Cloudflare account.
Domains and settings
list_provider_accounts- What it does
- Lists the Cloudflare accounts your token can reach.
- Kind
- Reads
list_zones- What it does
- Lists your domains, with search and filters.
- Kind
- Reads
get_zone- What it does
- Reads one domain's status, nameservers and details.
- Kind
- Reads
get_zone_setting- What it does
- Reads one domain setting, like the SSL mode.
- Kind
- Reads
update_zone_setting- What it does
- Changes one domain setting.
- Kind
- Asks first
DNS records
list_dns_records- What it does
- Lists a domain's DNS records, with search and filters.
- Kind
- Reads
get_dns_record- What it does
- Reads one DNS record.
- Kind
- Reads
create_dns_record- What it does
- Adds a DNS record.
- Kind
- Asks first
update_dns_record- What it does
- Changes the fields you name on a DNS record.
- Kind
- Asks first
overwrite_dns_record- What it does
- Replaces a DNS record completely.
- Kind
- Asks first
delete_dns_record- What it does
- Deletes a DNS record.
- Kind
- Asks first
batch_dns_records- What it does
- Sends several DNS changes in one request, without a review fingerprint.
- Kind
- Asks first
preview_dns_batch- What it does
- Checks up to 50 DNS changes on your computer and gives the batch a fingerprint.
- Kind
- Reads
apply_dns_batch- What it does
- Sends a checked DNS batch, only with the fingerprint from its preview.
- Kind
- Asks first
Cache
purge_cache- What it does
- Clears cached files by URL, tag, hostname, prefix or the whole domain.
- Kind
- Asks first
Rulesets and Page Rules
list_zone_rulesets- What it does
- Lists a domain's rulesets.
- Kind
- Reads
get_zone_ruleset- What it does
- Reads one ruleset in full.
- Kind
- Reads
get_zone_entrypoint- What it does
- Reads a domain's main ruleset for one phase, like redirects or custom rules.
- Kind
- Reads
create_zone_ruleset- What it does
- Makes a new ruleset.
- Kind
- Asks first
update_zone_ruleset- What it does
- Changes a ruleset, as a new version.
- Kind
- Asks first
delete_zone_ruleset- What it does
- Deletes a ruleset and all its versions.
- Kind
- Asks first
list_page_rules- What it does
- Lists a domain's old Page Rules.
- Kind
- Reads
get_page_rule- What it does
- Reads one Page Rule.
- Kind
- Reads
Workers and analytics
list_workers- What it does
- Lists your Workers scripts, without their code.
- Kind
- Reads
analytics_query- What it does
- Runs one read-only GraphQL analytics query.
- Kind
- Reads
Your accounts and requests
list_accounts- What it does
- Lists the accounts you've set up, without their tokens.
- Kind
- Reads
get_operation_schema- What it does
- Shows every field Cloudflare accepts for one of these requests.
- Kind
- Reads
preview_operation- What it does
- Checks a request on your computer, before anything goes to Cloudflare.
- Kind
- Reads
query_pages- What it does
- Reads up to five pages of accounts, domains or DNS records at once.
- Kind
- Reads
Is the Cloudflare MCP server safe?
A DNS change can take a site or its email offline, and a purge sends every visitor back to your server for a moment. So 11 tools ask first: every DNS change, cache purge, setting change and ruleset change. They're the ones marked "Asks first" in the tool tables above.
The token is the real limit, though. Give it only the domains and permissions your work needs, and the server can't reach anything else.
When your AI calls one of them, the call needs a yes first. Where you use it decides who gives it:
- Claude Code (2.1.246 and later) asks you before every call, in every one of its permission modes.
- An app that can show forms asks you in a form.
- Any other app takes your AI's
confirm: trueas the yes, so tell your AI to check with you first. - An agent with no person to ask needs
CLOUDFLARE_CONFIRM=model, so itsconfirm: truecounts in every app. - In a terminal, you add
--confirmto the command.
If the answer is no, nothing reaches Cloudflare.
Make it read-only
Set CLOUDFLARE_READ_ONLY=1 and every tool that asks first disappears from the tool list, leaving 18 reading tools. A token with only Read permissions does the same at Cloudflare's end.
Keep a log of every write
Set CLOUDFLARE_AUDIT_LOG to a file path. The server writes one line per attempted write, allowed or blocked, with what it was about to do and who approved it.
Watch out: DNS TXT records and rule descriptions can be written by other people, and one can try to give your AI orders. Treat them as data, and use CLOUDFLARE_READ_ONLY=1 for an agent working on its own.
Your data
Your requests go straight to Cloudflare, with no server of ours in between and no tracking. Your token stays in your app's config, your shell or your token file.
DNS records and analytics can show private details about your sites, so keep anything you export out of public places.
To cut access, delete the token in My Profile, then API Tokens, and remove the server from your app's config.
Connect more than one Cloudflare account
Set CLOUDFLARE_ACCOUNTS to a JSON list with a name and a token, or a token file, for each account, plus an account ID, a zone ID and the token kind where you want them. CLOUDFLARE_DEFAULT_ACCOUNT picks the one that acts when a tool names none, and every tool takes an optional account.
An account never borrows another one's token, so a client's domains stay with the client's token.
Cloudflare MCP server settings
Every setting is an environment variable, in your app's config or your shell.
CLOUDFLARE_API_TOKEN- Default
- none
- What it does
- Holds your API token
CLOUDFLARE_TOKEN_FILE- Default
- none
- What it does
- Points at a private file holding the token, instead
CLOUDFLARE_ACCOUNTS- Default
- none
- What it does
- Lists several accounts, as JSON
CLOUDFLARE_DEFAULT_ACCOUNT- Default
- the first one
- What it does
- Picks the account that acts when a tool names none
CLOUDFLARE_ACCOUNT_ID- Default
- none
- What it does
- Fills in your account ID when a tool needs one and you don't name it
CLOUDFLARE_ZONE_ID- Default
- none
- What it does
- Fills in a domain's zone ID when you don't name one
CLOUDFLARE_TOKEN_KIND- Default
user- What it does
accountmakes the doctor check an account-owned token
CLOUDFLARE_REQUEST_TIMEOUT_MS- Default
30000- What it does
- Gives up on a Cloudflare request after this many milliseconds
CLOUDFLARE_MIN_REQUEST_INTERVAL_MS- Default
200- What it does
- Waits this many milliseconds between requests
CLOUDFLARE_READ_ONLY- Default
- off
- What it does
1hides every tool that changes something
CLOUDFLARE_ALLOW_DESTRUCTIVE- Default
- on
- What it does
0refuses the tools that ask first
CLOUDFLARE_AUDIT_LOG- Default
- none
- What it does
- Names a file that gets one line per attempted write
CLOUDFLARE_SURFACE- Default
full- What it does
searchlists three tools that find, describe and run the rest
CLOUDFLARE_TOOL_TIMEOUT_MS- Default
- none
- What it does
- Gives up on any tool after this many milliseconds
CLOUDFLARE_CONFIRM- Default
human- What it does
modellets your AI'sconfirm: trueapprove on its own, for an agent with no person to ask
CLOUDFLARE_HTTP_PORT- Default
8787- What it does
- Sets the port for
--http
CLOUDFLARE_HTTP_HOST- Default
127.0.0.1- What it does
- Sets the address for
--http, and any other needs a token
CLOUDFLARE_HTTP_TOKEN- Default
- none
- What it does
- Sets the bearer token every
--httprequest needs
CLOUDFLARE_HTTP_ALLOWED_ORIGINS- Default
- none
- What it does
- Lists other websites allowed to call
--http, comma separated
CLOUDFLARE_DEBUG- Default
- off
- What it does
1prints debug lines
Troubleshooting
Run the doctor first. It names the step that failed and the fix.
| What you see | What to do |
|---|---|
| The doctor says the token isn't active | It expired, or an IP filter blocks you. For an account-owned token, set CLOUDFLARE_TOKEN_KIND=account and your account ID |
| The token works, but a domain read fails | The token doesn't include that domain or that permission. Edit it in My Profile, then API Tokens |
| Cloudflare refuses a DNS change | Some records can't share a name, like an A record and a CNAME. Read the error and check the record type |
| A setting or rule won't change | Your plan may not include it. Read the setting first, and check that it can be edited |
| A 429 error | Cloudflare allows 1,200 requests every 5 minutes per token. Wait, then check before you try again |
| Analytics come back empty | Check the dataset, the time window and how long your plan keeps data. Some analytics are sampled |
| "…so it will not run without confirm: true" | That's the safety check working. Approve it when your app asks |
If the server doesn't show up in your app at all, run the command your app runs, in a terminal, and read the error.
More free tools for your sites
See how your pages do in Google, or manage your WordPress posts.
Free tools
FAQs about the Cloudflare MCP server & CLI
Here are the questions people ask most about the Cloudflare MCP server and CLI.
The Cloudflare MCP server & CLI is a free, open source program that lets an AI app like Claude, Codex or Cursor manage your Cloudflare domains.
It has 29 tools for domains, DNS records, cache, settings, rulesets, Workers and analytics, and the same tools run as a CLI that agents like Claude Code and Codex use, or that you type yourself.
An MCP server is a standard way to give an AI app real access to a tool, so it can act instead of guessing.
MCP stands for Model Context Protocol, and Claude, Codex, Cursor and many other AI apps speak it.
Every server I've made is on my MCP servers page.
The Cloudflare CLI is the same program as the Cloudflare MCP server, run as commands.
AI agents like Claude Code, Codex and OpenCode run them for you, and you can type them in a terminal or a script.
One npm package installs both.
Use the Cloudflare MCP server in an AI app with no terminal, like Claude Desktop's chat, and the CLI in a terminal, a script or a cron job.
In an AI app that can run commands, like Claude Code, Codex or Cursor, the CLI is the lighter choice, because it costs nothing until it runs.
Yes, the Cloudflare MCP server is free and open source under the AGPL-3.0-or-later license.
Cloudflare's API comes with every Cloudflare account, and what you can change depends on your plan.
Give the token only what your work needs: Zone: Read and DNS: Read to look around, DNS: Edit to change records, and Cache Purge to clear the cache.
Limit it to the domains you want it to reach.
No, the server only accepts API tokens.
A token can be limited to certain domains and permissions, and the Global API Key can't.
No, it only lists your Workers scripts.
Deploying them is still a job for Wrangler, Cloudflare's own CLI.
Yes, the Cloudflare MCP server connects as many accounts as you set up in CLOUDFLARE_ACCOUNTS, each with its own token.
Every tool takes an optional account, and an account never borrows another one's token.
To disconnect the Cloudflare MCP server, delete its token in My Profile, then API Tokens, which cuts access right away.
Then remove the server from your AI app's config.
The Cloudflare MCP server works with any app that speaks MCP.
That includes Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Cline, GitHub Copilot CLI, Gemini CLI, OpenCode, OpenClaw, Antigravity and Hermes.
I did.
I'm Navid Moazzez, and I made the Cloudflare MCP server & CLI as one of my free tools on navid.me.
You can read more about me.
The code is on GitHub under the AGPL-3.0-or-later license, and the package is on npm.
More MCP servers & CLIs
Related free tools
Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.
On this page
The most actionable AI newsletter for founders
Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.
No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.
P.S. Sign up now to get free access to my ultimate AI tools guide for creators.
