Skip to main content
Firecrawl turns arbitrary web pages into clean markdown an LLM can actually read: it renders JavaScript, strips navigation and ads, and follows links when you ask it to crawl rather than scrape a single page. It also shows the third authentication shape in this section — the key is a segment of the URL path, not a header or a query parameter.
Crawling is the expensive operation. It is billed per page and can walk a large site quickly. Scrape one page first; crawl only when you mean to.

Prerequisites

  • Python 3.10+
  • ANTHROPIC_API_KEY
  • FIRECRAWL_API_KEY — free tier at firecrawl.dev

Build it

1

Install and set both keys

2

Fail loudly when the key is missing

Because the key is part of the URL, a missing environment variable produces the URL https://mcp.firecrawl.dev/None/v2/mcp and a confusing connection error. Check for it up front:
3

Write a prompt that prefers scraping over crawling

Left alone, a model asked about a site will reach for the broadest tool available. This prompt pushes it toward the cheap one and forbids answering from memory:
4

Build the agent

5

Scrape one page and ask for quotes

Asking for quotes is a cheap correctness check: if the model paraphrases everything, it probably did not read the page.

The complete script

Which Firecrawl tool for which job

The order matters when you write the task: map then scrape is usually both cheaper and more accurate than crawl, because you choose which pages get read. Firecrawl reads pages well but finding the right page is a different job. A common two-stage setup gives the finder and the reader their own servers:
See MCP in a multi-agent workflow for why one server per agent beats giving both servers to one agent.

Next