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

# MCP Web Search & Scrape in Grok Build

> Add Firecrawl web scraping and search to xAI Grok Build

Connect [Grok Build](https://docs.x.ai/build/overview), the xAI coding agent CLI (`grok`), to Firecrawl through the hosted MCP server. OAuth is the recommended interactive setup. With OAuth, the key does not go into the command line, project files, or conversation.

## Quick setup

### 1. Add Firecrawl

Run:

```bash theme={null}
grok mcp add --transport http firecrawl https://mcp.firecrawl.dev/v2/mcp-oauth
```

`https://mcp.firecrawl.dev/v2/mcp-oauth` is a client configuration value, not a page to open directly in a browser.

### 2. Sign in and verify

Start Grok Build:

```bash theme={null}
grok
```

Enter `/mcps`, select `firecrawl`, and press `i` to start the browser sign-in. Choose a team and approve the connection. Grok keeps the OAuth tokens in `~/.grok/mcp_credentials.json`.

Confirm that only one `firecrawl` server is active, then try:

```text theme={null}
Search the web for the latest Next.js release notes and summarize the sources.
```

```text theme={null}
Scrape https://docs.firecrawl.dev and list the top-level sections.
```

## Local MCP with an API key

Use the local server only when you need a local process or a self-hosted Firecrawl API. The local package requires Node.js 22 or newer.

Set `FIRECRAWL_API_KEY` in the environment that starts Grok. Then add this block to `~/.grok/config.toml`:

```toml theme={null}
[mcp_servers.firecrawl]
command = "npx"
args = ["-y", "firecrawl-mcp@3.23.7"]
env = { FIRECRAWL_API_KEY = "${FIRECRAWL_API_KEY}" }
startup_timeout_sec = 60
```

Grok expands `${FIRECRAWL_API_KEY}` when it loads the configuration, so the key does not go into the file. Keep the secret outside agent chat and source control. Use only one `firecrawl` entry: remove the hosted server first with `grok mcp remove firecrawl`.

For self-hosted settings, see [Run MCP locally](/mcp-server/local).

## Other connection modes

* [Try keyless MCP](/mcp-server/keyless#try-keyless) for Search, Scrape, and Parse without an account or key.
* [Configure an API key](/mcp-server/keyless#add-an-api-key) for unattended use of the hosted server. Keep the secret outside agent chat and use an environment-variable reference.

## Troubleshooting

* **A Firecrawl server already exists:** run `grok mcp remove firecrawl`, add the intended connection once, then start a new session.
* **Grok shows a second `firecrawl` server:** Grok also loads MCP servers from `~/.claude.json`, `.cursor/mcp.json`, and project `.mcp.json` files. Run `grok inspect` to see where each server comes from, then remove the duplicate.
* **The server shows `401`:** enter `/mcps`, select `firecrawl`, and press `i` to sign in again. Do not paste an API key into the conversation or the OAuth URL.
* **The local server does not connect:** run `grok mcp doctor firecrawl`. Grok writes the server errors to `~/.grok/logs/mcp/firecrawl.stderr.log`. If `npx` downloads the package on first start, increase `startup_timeout_sec`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.