Skip to main content
Connect Grok Build, 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:
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:
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:

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:
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.

Other connection modes

  • Try keyless MCP for Search, Scrape, and Parse without an account or key.
  • Configure 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.