codex
title: Codex + Cloudflare description: "OpenAI coding agent available as a terminal CLI and desktop app. It reads and writes files, runs commands, and browses the web in a sandbox." template: splash pcx_content_type: how-to products:
- agent-setup
import { Steps, Tabs, TabItem, LinkCard } 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 Codex** Install the Codex CLI. macOS and Linux are fully supported; use WSL2 on Windows. For Homebrew or other install methods, see the [Codex CLI setup guide](https://developers.openai.com/codex/cli/).
```bash
npm install -g @openai/codex
```
2. **Launch Codex in your project**
Start Codex from the root of your project, where `wrangler.jsonc` or `cloudflare.config.ts` lives (if either exists).
```bash
codex
```
3. **Install the Cloudflare plugin**
Inside Codex, run `/plugins`, then search for and install **Cloudflare**. This installs Cloudflare Skills and registers the Cloudflare MCP servers.
```txt
/plugins
```
4. **Try a prompt**
For example:
<RandomPrompt />
</Steps>
</TabItem>
<TabItem label="Desktop">
<Steps>
1. **Download Codex**
Follow the download instructions for your operating system at [developers.openai.com/codex/app](https://developers.openai.com/codex/app).
2. **Install the Cloudflare plugin**
In the Codex app, go to **Plugins** and install **Cloudflare**.

</Steps>
</TabItem>
Cloudflare platform access
Example prompts
Tips
- The Cloudflare API MCP server uses Code Mode — Codex writes JavaScript against a typed API to reach any of 2,500+ endpoints in ~1,000 tokens.
FAQ
All three. Skills load Cloudflare knowledge into every Codex session (when to use Durable Objects, how to structure a Workers project, etc.). The Cloudflare API MCP server handles platform operations (DNS, WAF, Zero Trust). Wrangler handles local dev, deploys, and migrations. The bundled `wrangler` Skill teaches Codex when to run CLI commands vs. call the MCP API. For tasks across the whole Cloudflare API, Codex can also use the [Cloudflare CLI](/cf/), `cf`. Yes. The [Cloudflare CLI](/cf/), `cf`, is in beta and covers the whole Cloudflare API and prints JSON output. Install it with `npm install -g cf`, sign in with `cf auth login`, and tell Codex to prefer it in `AGENTS.md`. Refer to [Use cf with AI agents](/cf/agents/). The first time Codex calls a Cloudflare tool, you will be redirected to authorize via OAuth and choose permissions. Yes. Codex is open source and available on GitHub at github.com/openai/codex.Troubleshooting
Verify the server was added with `codex mcp add cloudflare --url https://mcp.cloudflare.com/mcp`. Run `codex mcp list` to confirm it appears, then use `/mcp` inside the Codex TUI to check its status. Point the agent directly at developers.cloudflare.com/llms.txt for a directory of every product, ordevelopers.cloudflare.com/<product>/llms.txt
for a product-specific index.
Remove and re-add the MCP server. Complete the OAuth flow in your browser
when prompted.
Build agents on Cloudflare
Other agents
谢谢你的反馈!