> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Web Search & Scrape in Codex CLI

> Add Firecrawl web scraping and search to OpenAI Codex CLI

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

## Quick Setup

### 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

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

```toml theme={null}
[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

```bash theme={null}
codex
```

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

```bash theme={null}
/mcp
```

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

## 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)

If you prefer not to run `npx` locally:

```toml theme={null}
[mcp_servers.firecrawl]
url = "https://mcp.firecrawl.dev/fc-YOUR-API-KEY/v2/mcp"
```

## 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).
