Chrome Extension
The victauri-browser crate provides MCP access to any website running in Chrome, Edge, Brave, or Arc — not just Tauri applications.
What It Does
The Chrome extension + native messaging host extends Victauri’s inspection capabilities to regular web pages. An AI agent can connect via MCP on localhost:7474 and get DOM snapshots, interact with elements, evaluate JavaScript, inspect styles, and more — all on arbitrary websites.
This is useful for:
- Web scraping with semantic understanding
- Cross-site testing workflows
- Automating web tasks that span both Tauri apps and web services
- General browser automation via MCP
Installation
1. Install the Native Host Binary
cargo install victauri-browser
Or build from source:
cargo build -p victauri-browser --release
2. Register the Native Messaging Host
victauri-browser install
This registers the native messaging host manifest with your browser (Chrome, Edge, Brave, or Arc are auto-detected). The manifest tells the browser how to launch the native host when the extension requests it.
To uninstall:
victauri-browser uninstall
3. Load the Chrome Extension
- Open your browser’s extension management page (
chrome://extensions) - Enable “Developer mode”
- Click “Load unpacked” and select the
extensions/chrome/directory from the Victauri repo
4. Connect via MCP
The native host starts an HTTP server on localhost:7474 (with fallback to 7475-7484 if the port is busy).
{
"mcpServers": {
"victauri-browser": {
"url": "http://127.0.0.1:7474/mcp"
}
}
}
Architecture
The communication flow:
MCP Client (Claude Code)
│
│ HTTP (localhost:7474)
▼
Native Host Binary (victauri-browser)
│
│ Chrome Native Messaging (stdio)
│ 32-bit LE length prefix + UTF-8 JSON
▼
Extension Service Worker (MV3)
│
│ chrome.tabs.sendMessage()
▼
Content Script (ISOLATED world)
│
│ CustomEvent (__victauri_command / __victauri_response)
▼
JS Bridge (MAIN world)
│
│ Direct DOM access
▼
Web Page
Components
Native Host Binary (victauri-browser)
- Dual role: HTTP server for MCP clients AND native messaging host for Chrome
- axum router serves
/mcp(MCP protocol),/api/tools(REST),/health,/info - Reads/writes Chrome native messaging format on stdio
BridgeDispatchsends UUID-tagged commands and resolves responses via oneshot channels
Service Worker (MV3 background script)
- Manages native messaging connection lifecycle
- Routes commands to the correct tab’s content script
- Handles tab lifecycle (creation, removal, navigation)
- Manages CDP sessions for advanced features
Content Script (ISOLATED world)
- Relay between service worker and MAIN world bridge
- Uses
CustomEventpattern to cross the world boundary - Injected into all pages matching the extension’s permissions
JS Bridge (MAIN world, 1700+ lines)
- Full DOM inspection, interactions, accessibility, performance
- Same Playwright-grade actionability checks as the Tauri plugin bridge
- CSS inspection, recording, element finding, scroll, hover, click
Available Tools (20)
| Tool | Description |
|---|---|
get_plugin_info | Extension version and status (handled locally) |
tabs.list | List open browser tabs (handled locally) |
dom_snapshot | Full accessible DOM tree of active tab |
find_elements | Search by CSS selector, text, or role |
eval_js | Evaluate JavaScript in page context |
click | Click an element by ref |
fill | Set input value |
type_text | Type characters one-by-one |
press_key | Dispatch keyboard event |
hover | Hover over element |
scroll_into_view | Scroll element into viewport |
get_styles | Computed CSS for an element |
get_bounding_boxes | Element dimensions and box model |
highlight_element | Draw debug overlay |
clear_highlights | Remove all overlays |
screenshot | Capture visible tab as PNG |
navigate | Go to URL |
get_cookies | Get cookies for current domain |
get_console_logs | Captured console entries |
get_network_log | Fetch/XHR request history |
Authentication
The native host supports Bearer token authentication:
# Set via environment variable
VICTAURI_AUTH_TOKEN=my-token victauri-browser serve
Security features:
- Constant-time token comparison
- Token-bucket rate limiter
- Security headers on all responses
- Origin guard (blocks non-localhost origins)
Port Behavior
Default port: 7474. If busy, tries 7475 through 7484. The victauri-browser serve command prints the actual port on startup.
Tab Management
The extension tracks tab state (URL, title, bridge readiness). Commands are sent to the active tab by default, or you can target a specific tab by ID using the tab_id parameter where supported.
Special behaviors:
- Navigation uses
chrome.tabs.update()(not content scriptwindow.location) for reliability - Cookies use
chrome.cookies.getAll()for httpOnly access - Screenshots use Chrome’s
chrome.tabs.captureVisibleTab()API