Browser Tools
The Chrome extension exposes browser tools to agents via MCP (Model Context Protocol) using Streamable HTTP transport.
Browser tools require the Chrome extension. They are not available in the web client.
Available Tools
Usage Flow
A typical workflow for an AI agent:
- List tabs - Call
browser_tabsto discover available tabs and get their IDs - Read content - Call
browser_readwith atabIdto understand the page - Interact - Call
browser_executewith atabIdandscriptto interact
browser_tabs
Lists all open browser tabs. Call this first to get tab IDs.
Parameters: None
Returns:
browser_read
Reads the DOM content of a tab. Returns a simplified, agent-friendly representation.
Parameters:
tabId(number, required) - Tab ID frombrowser_tabs
Returns:
DOM Serialization
The extension uses a custom collectPageInfo() function that:
- Extracts semantic HTML structure (headings, links, buttons, forms)
- Removes scripts, styles, and hidden elements
- Preserves interactive elements with their attributes
- Returns a simplified representation optimized for AI understanding
The selection field contains any text the user has highlighted on the page. This is useful for "explain this" or "what does this mean" workflows.
browser_execute
Executes JavaScript in the page's main world context, giving access to the page's JavaScript environment.
Parameters:
tabId(number, required) - Tab ID frombrowser_tabsscript(string, required) - JavaScript code to execute
Execution Model
Your script runs as:
The last expression or explicit return statement becomes the tool result.
Return Value Pattern
Always return structured results:
Event Handling for Modern Frameworks
Standard DOM methods like element.click() or input.value = 'text' often don't work with React, Vue, or Angular because these frameworks use synthetic event systems.
Clicking Elements
Setting Input Values
Submitting Forms
Hover Effects
Keyboard Events
Always use dispatchEvent with { bubbles: true } for framework compatibility.
Example Script
A complete example that fills a form and submits it:
Security Considerations
- Scripts execute in the main world (same context as the page's JavaScript)
- The agent has full access to page variables, cookies, localStorage
- Be cautious when allowing execution on sensitive pages (banking, email, etc.)
- The extension only exposes tools when connected to a proxy server
Chrome Permissions
The extension requires these permissions in manifest.json:
