Command Code + Cloudflare
import { Steps } from "/components";
import AgentHeader from "/components/agent-setup/AgentHeader.astro";
import PlatformAccess from "/components/agent-setup/PlatformAccessSection.astro";
import ExamplePromptsList from "/components/agent-setup/ExamplePromptsList.astro";
import RandomPrompt from "/components/agent-setup/RandomPrompt.astro";
import TipsList from "/components/agent-setup/TipsList.astro";
import FAQList from "/components/agent-setup/FAQList.astro";
import FAQItem from "/components/agent-setup/FAQItem.astro";
import TroubleshootingList from "/components/agent-setup/TroubleshootingList.astro";
import TroubleshootingItem from "/components/agent-setup/TroubleshootingItem.astro";
import BuildAgentsCallout from "/components/agent-setup/BuildAgentsCallout.astro";
import OtherAgents from "/components/agent-setup/OtherAgents.astro";
Quick start
1. **Install Command Code** Install [Command Code](https://commandcode.ai). For the full walkthrough, refer to the [Command Code quickstart](https://commandcode.ai/docs/quickstart).
```sh
npm i -g command-code@latest
```
This installs the `command-code` CLI, with the alias `cmd`. On Windows, the alias is `cmdc`. For the full list of models you can run, refer to [Available Models](https://commandcode.ai/docs/reference/cli/models).
2. **Open your Cloudflare project**
Change into the directory that contains your Cloudflare project, where `wrangler.jsonc` lives (if it already exists):
```sh
cd my-worker
```
3. **Install Cloudflare Skills**
```sh
cmd skills add https://github.com/cloudflare/skills
```
This installs the Cloudflare Skills into `.commandcode/skills/`, including `wrangler`, `workers-best-practices`, `durable-objects`, and `agents-sdk`. Pass `--skill <name>` to install a single skill, or `--global` to install into `~/.commandcode/skills/` for every project. For more information, refer to [Command Code Skills](https://commandcode.ai/docs/skills).
4. **Add the Cloudflare MCP server**
```sh
cmd mcp add --transport http cloudflare https://mcp.cloudflare.com/mcp
```
Complete the OAuth flow in your browser when Command Code prompts you, then choose the permissions to grant. For scopes, transports, and per-project configuration, refer to [Command Code MCP](https://commandcode.ai/docs/mcp).
5. **Start a session and try a prompt**
```sh
cmd
```
Ask Command Code to investigate a task, make changes, and run the relevant tests. Review its diffs and command output before keeping changes.
For example:
<RandomPrompt />
Cloudflare platform access
Example prompts
Tips
- Install Cloudflare Skills first. They give Command Code persistent Cloudflare knowledge without spending tokens on tool schemas, so reach for them before adding MCP servers.
cmd skills addwrites to.commandcode/skills/for the current project. Add--globalto install into~/.commandcode/skills/and make the skills available everywhere.- The MCP server is saved to your local config by default. Optionally, add
--scope projectto save it to.mcp.jsoninstead and share it with your team. - Use the Cloudflare API MCP server for account resources and domain-specific servers for focused workflows.
- Record project conventions in
AGENTS.mdso they carry across sessions. Refer to Memory for where Command Code reads and writes them.
FAQ
All three, and start with Skills. Skills give Command Code persistent Cloudflare expertise: when to reach for Durable Objects over KV, how to structure a Workers project, and when to call the CLI instead of the API. The Cloudflare API MCP server handles account operations, such as DNS, WAF, R2, and Zero Trust. Wrangler handles local development, deployments, and migrations. Command Code runs local shell commands, so it can call Wrangler directly. {/* Keep the cmd mcp add command on one line: wrapping it leaks the source indentation into the inline code span. */} {/* prettier-ignore */} Run `cmd mcp add --transport http cloudflare https://mcp.cloudflare.com/mcp`. When Command Code prompts you, complete the OAuth flow in your browser and choose the permissions to grant. Into `.commandcode/skills/` for the current project, or `~/.commandcode/skills/` when you pass `--global`. Run `cmd skills list` to confirm what is installed. Code Mode is how the Cloudflare API MCP server fits all 2,500+ API endpoints into about 1,000 tokens. Instead of exposing every endpoint as a separate tool, it exposes `search()` and `execute()`. Command Code writes JavaScript to call them. For more information, refer to [Code Mode](https://blog.cloudflare.com/code-mode-mcp/). Command Code works with models from Anthropic, OpenAI, Moonshot, DeepSeek, Z.ai, Alibaba, MiniMax, and others. Run `cmd --list-models` to see what is available to you, or `/model` to switch inside a session. For the current list, refer to [Available Models](https://commandcode.ai/docs/reference/cli/models). Through Taste. Every accept, reject, and edit becomes a signal, and the learned preferences are stored in taste packages that you can share across projects and with your team. For more information, refer to [Taste](https://commandcode.ai/docs/taste). Yes. Headless mode runs Command Code non-interactively, so it can lint, test, or deploy a Worker from a pipeline. For more information, refer to [Headless Mode](https://commandcode.ai/docs/headless). No. Command Code is a commercial product with a subscription plan. For details, refer to [Pricing and Limits](https://commandcode.ai/docs/resources/pricing-limits).Troubleshooting
Run `cmd mcp list` to check the server status. Confirm that the server URL is `https://mcp.cloudflare.com/mcp` and that you passed `--transport http`. Remove the server with `cmd mcp remove cloudflare` and add it again. Point Command Code to [developers.cloudflare.com/llms.txt](/llms.txt) for a directory of all products, or `developers.cloudflare.com//llms.txt` for a product-specific index. Remove and re-add the MCP server. When Command Code prompts you, complete the OAuth flow in your browser.Build agents on Cloudflare
Other agents
谢谢你的反馈!