# MCP Web Search & Scrape in Codex CLI (/quickstarts/codex-cli)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 467 · updated: 2026-07-30 -->
Related: [Node.js](/quickstarts/nodejs.md), [Next.js](/quickstarts/nextjs.md), [Express](/quickstarts/express.md), [NestJS](/quickstarts/nestjs.md), [Fastify](/quickstarts/fastify.md), [Hono](/quickstarts/hono.md)

Add Firecrawl's search, scrape, crawl, and browser tools to [OpenAI Codex CLI](https://github.com/openai/codex) via MCP.

## Quick Setup [#quick-setup]

### 1. Get Your API Key [#1-get-your-api-key]

Sign up at [firecrawl.dev/app](https://www.firecrawl.dev/app) and copy your API key.

### 2. Add Firecrawl to Codex [#2-add-firecrawl-to-codex]

Codex reads MCP server config from `~/.codex/config.toml`. Add the Firecrawl server:

```toml
[mcp_servers.firecrawl]
command = "npx"
args = ["-y", "firecrawl-mcp"]

[mcp_servers.firecrawl.env]
FIRECRAWL_API_KEY = "fc-YOUR-API-KEY"
```

Replace `fc-YOUR-API-KEY` with your Firecrawl API key.

### 3. Start Codex [#3-start-codex]

```bash
codex
```

Codex discovers the Firecrawl tools on launch. Confirm they are loaded:

```bash
/mcp
```

You should see `firecrawl` listed with tools like `firecrawl_search`, `firecrawl_scrape`, `firecrawl_crawl`, and `firecrawl_extract`.

## Quick Demo [#quick-demo]

Try these prompts:

```
Search the web for the latest Next.js App Router release notes and summarize.
```

```
Scrape https://docs.firecrawl.dev and list the top-level sections.
```

```
Crawl https://example.com and save the markdown for every page under /blog.
```

## Remote Hosted URL (no Node.js required) [#remote-hosted-url-no-nodejs-required]

If you prefer not to run `npx` locally:

```toml
[mcp_servers.firecrawl]
url = "https://mcp.firecrawl.dev/v2/mcp-oauth"
```

## Troubleshooting [#troubleshooting]

* **Codex doesn't see the tools** — run `codex --version` to confirm you're on a version with MCP support, then restart the CLI after editing `config.toml`.
* **`spawn npx ENOENT`** — install Node.js 18+ and ensure `npx` is on your `PATH`, or switch to the remote hosted URL above.
* **401 / invalid key** — regenerate an API key at [firecrawl.dev/app/api-keys](https://www.firecrawl.dev/app/api-keys).
