How-to Guides
Step-by-step guides for the most common AGENT BROWSER tasks. Start with Basic Navigation if you are new.
Automating a login flow
IntermediateNavigate to login page
agent-browser open https://app.example.com/loginStart with a fresh session for authentication flows.
Fill credentials
agent-browser snapshot
agent-browser fill @e2 "your@email.com"
agent-browser fill @e3 "yourpassword"Always take a snapshot first so you have the correct refs for the current page.
Submit the form
agent-browser click @e4
# or
agent-browser press EnterAfter clicking submit, wait for navigation before taking the next snapshot.
Save session for reuse
agent-browser open https://app.example.com/login --session myapp
# after login completes:
# session "myapp" now carries the auth cookiesNamed sessions persist auth state across multiple agent runs.
Extracting data from pages
IntermediateRead page as clean text
agent-browser read https://example.com/articleFetches and returns agent-readable text without launching Chrome. Great for articles and docs pages.
Get specific element text
agent-browser snapshot
agent-browser get text @e7Returns the text content of a specific element identified by its ref.
Get element attributes
agent-browser get attr @e2 href
agent-browser get attr @e5 data-idUseful for extracting URLs, data attributes, and other metadata.
Run custom JavaScript
agent-browser eval "document.querySelectorAll('h2').length"
agent-browser eval "window.__NEXT_DATA__"Evaluate arbitrary JS in the page context and get the result back.
Using the MCP server
AdvancedStart the MCP server
agent-browser mcpStarts an MCP stdio server that exposes all browser commands as tools to any MCP-compatible agent.
Configure Claude Desktop
{
"mcpServers": {
"agent-browser": {
"command": "agent-browser",
"args": ["mcp"]
}
}
}Add this to your Claude Desktop config at ~/Library/Application Support/Claude/claude_desktop_config.json
Configure Cursor
{
"mcp": {
"servers": {
"agent-browser": {
"command": "agent-browser",
"args": ["mcp"]
}
}
}
}Add to your .cursor/mcp.json or Cursor settings.
Looking for the full command reference or configuration options?