Give a Mastra Agent a Browser for Logged-in Pages with Firecrawl
Blog post from Firecrawl
Mastra’s @mastra/browser-firecrawl package lets agents operate authenticated, interactive websites through hosted Firecrawl browser sessions rather than a locally installed Chromium browser. Extending AgentBrowser, it provides the same tools for navigation, snapshots, typing, clicking, and element references, with agents instructed to take fresh snapshots after each action because references change between pages. The example demonstrates logging into Sauce Labs’ Swag Labs demo store, adding an item to a cart, completing checkout, and reading a confirmation message that requires a non-interactive snapshot. Browser sessions are scoped to Mastra memory threads by default, isolating users’ cookies, carts, and logins, while session lifetime is governed by total and idle TTL settings. Named Firecrawl profiles can preserve login state across sessions, allowing credentials to be entered once outside the model context; however, only one session can save changes to a profile at a time, so production use should save login state once and use read-only profile sessions for normal traffic. Setup requires the Firecrawl browser package, API keys, Mastra memory storage, and explicit session cleanup, while public pages can continue to use Firecrawl Search or Scrape instead of browser automation.
No tracked trend matches for this post yet.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.