generateText and streamText.
Looking for Firecrawl tools packaged as AI SDK tools instead of an MCP connection? See the Vercel AI SDK guide.
Quick setup
Create a Firecrawl API key, then install the AI SDK and its MCP package:Authorization header:
firecrawl_scrape, firecrawl_search, firecrawl_map, and firecrawl_crawl. Pass tools to generateText or streamText as described in the AI SDK MCP guide, and close the client with await mcpClient.close() when the response is finished.
Prefer a local process? Use the AI SDK’s stdio transport with npx -y firecrawl-mcp and FIRECRAWL_API_KEY in env; the AI SDK recommends HTTP for production.
Try it
Call a tool directly to confirm the connection:Troubleshooting
- Authentication errors: confirm
FIRECRAWL_API_KEYis set in the process that runs the client and that the header readsBearer <key>. - Redirect errors: the AI SDK client rejects redirects by default; use the exact URL
https://mcp.firecrawl.dev/v2/mcp. - Open handles after a script ends: call
mcpClient.close()when you are done with the tools.

