0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/browser/agent-browser
Cursor Agent 255e6424b1
Merge remote-tracking branch 'origin/main' into security/agent-browser-cli
# Conflicts:
#	browser/agent-browser/package.json
#	pnpm-lock.yaml
History 2026-11-05 17:49:27 +00:00
..
src fix(agent-browser): keep snapshot refs usable after re-render and navigation 2026-11-05 17:40:17 +00:00
.gitignore feat(browser): add browser SDK providers (agent-browser, stagehand) (#14938) 2026-04-02 17:56:12 -05:00
CHANGELOG.md chore: version - exit prerelease mode 2026-10-30 23:02:25 +00:00
lint-staged.config.js refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
package.json Merge remote-tracking branch 'origin/main' into security/agent-browser-cli 2026-11-05 17:49:27 +00:00
README.md feat(agent-browser): drive Chrome with Playwright only 2026-10-29 14:37:33 -04:00
tsconfig.build.json feat(browser): add browser SDK providers (agent-browser, stagehand) (#14938) 2026-04-02 17:56:12 -05:00
tsconfig.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
tsdown.config.ts chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts feat(browser): add browser SDK providers (agent-browser, stagehand) (#14938) 2026-04-02 17:56:12 -05:00

@mastra/agent-browser

Deterministic browser automation for Mastra agents using Playwright and accessibility-tree element refs.

Installation

npm install @mastra/agent-browser

Usage

import { Agent } from '@mastra/core/agent';
import { AgentBrowser } from '@mastra/agent-browser';

// Create an AgentBrowser instance
const browser = new AgentBrowser({
  headless: true,
});

// Create an agent with the browser
const agent = new Agent({
  name: 'web-agent',
  instructions: `You are a web automation assistant.
Use browser_snapshot to see the page structure,
then interact with elements using their refs (e.g., @e5).`,
  model: 'openai/gpt-5.4',
  browser,
});

// Use the agent to browse the web
const result = await agent.generate('Go to example.com and click the first link');

Documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.