agent-browser-mcp
Allows agents to interact with Baidu search results and other Baidu services through your real Chrome browser, maintaining login state and enabling page automation.
Connects to your local Chrome browser instance, allowing agents to interact with real tabs, maintain login states, execute JavaScript, control via Chrome DevTools Protocol, and perform physical input operations.
Provides MCP tools for Hermes Agent to directly operate your real Chrome browser, enabling reading from logged-in websites, page scanning, CDP control, and physical input automation.
Enables agents to read content from your logged-in Xiaohongshu (Little Red Book) account, scan recommendation feeds, and interact with the platform through real browser automation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-browser-mcp scan the current page and summarize the main content"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-browser-mcp
An MCP service that lets your Agent directly operate the "real Chrome you are currently using."
It is not a sandbox browser, nor a simple web scraper; it connects to the Chrome instance already open on your machine, preserving:
Login states
Cookies
Open tabs
Real page context
Suitable for scenarios such as:
Allowing Hermes to directly read your Xiaohongshu, backend systems, knowledge bases, or management console pages
Automating websites you are already logged into, rather than logging into a stateless browser again
Switching to CDP / real mouse and keyboard operations when standard browser automation is unstable
Having page scanning, JS execution, CDP control, screenshots, and physical input all in one MCP tool
In a nutshell:
This is a project that wraps "real browser automation" into a standard MCP, allowing Agents to move beyond sandbox browsers and truly enter your daily browser workflow.
Core Capabilities Overview
Real Chrome tab discovery and switching
Page scanning and simplified content extraction
In-page JavaScript execution
Native CDP single-command / batch execution
Page screenshots / Desktop screenshots
Cookie reading
Mouse movement, clicking, and dragging
Keyboard input and hotkeys
If you want Hermes, Claude Desktop, Cursor, or other MCP clients to directly operate your local real browser, this project is designed for that scenario.
Related MCP server: chrome-agent-browser
What this MCP can do
This project wraps real browser automation capabilities into standard MCP tools, with key features including:
1. Browser Tabs and Navigation
View currently connected real tabs
Switch to a specified tab
Open a URL in the current tab
Open a new tab
2. Page Reading
Scan current page content
Extract simplified HTML / text
Suitable for reading information feeds, post lists, and search result pages
3. Page Execution and CDP Control
Execute arbitrary JavaScript on the page
Directly call Chrome DevTools Protocol (CDP)
Support for single and batch commands
Can be used for screenshots, DOM queries, clicks, file uploads, and more complex operations
4. Screenshot Capabilities
Page screenshots (via CDP)
Desktop screenshots (for assisting with real desktop operations)
5. Real Physical Input
Mouse movement
Mouse clicking
Mouse dragging
Keyboard input
Hotkey sending
These capabilities are well-suited for handling:
Websites that must maintain a login state
Websites where standard browser automation tools are easily flagged by risk control
Scenarios requiring real clicks / real keyboard input
Scenarios requiring the reading of complex page structures
Suitable Scenarios
For example:
Using Hermes to read your current Xiaohongshu homepage recommendation feed
Opening a backend page in a real browser and scraping information
Calling CDP to take a page screenshot
Falling back to real mouse/keyboard operations when page JS is insufficient
Letting an Agent directly operate a site you are already logged into, instead of re-logging into a stateless browser
How it Works
The project consists of three layers:
Chrome Extension
Injected into real web pages
Accesses tabs / cookies / debugger / management via Chrome API
Communicates with the local bridge service
TMWebDriver Local Bridge
Default listening:
WebSocket:
127.0.0.1:18765HTTP:
127.0.0.1:18766
Responsible for connecting the extension, maintaining sessions, and forwarding execution results
MCP Service
Exposes browser capabilities as MCP tools
For direct invocation by clients like Hermes, Claude Desktop, and Cursor
Main Tools
Currently exposed main MCP tools include:
Browser/Tabs
get_setup_statuslist_tabsswitch_tabopen_urlopen_new_tabextension_pathlist_extensions
Page Reading/Execution
scan_pageexecute_js
CDP and Screenshots
cdp_commandcdp_batchget_cookiescapture_page_screenshotcapture_desktop_screenshot
Physical Input
mouse_movemouse_clickmouse_dragtype_texthotkeypointer_info
Installation Requirements
Recommended environment:
macOS or Windows
Python 3.10+
Google Chrome
Any MCP-compatible client, such as:
Hermes Agent
Claude Desktop
Cursor
Installation
After cloning locally, execute:
cd agent-browser-mcp
pip install -e .If you want to build the wheel before installing:
python -m pip install --upgrade build
python -m build
pip install dist/agent_browser_mcp-0.1.0-py3-none-any.whlCommand Line Tools
After installation, a CLI is provided:
agent-browser-mcpIt has several common subcommands:
Output Chrome Extension Directory
agent-browser-mcp extension-pathOutput Hermes Configuration Snippet
agent-browser-mcp print-hermes-configEnvironment Diagnostics
agent-browser-mcp doctorThis command outputs JSON to help you check:
Extension directory location
Whether
config.jsis generatedPort status
Number of currently connected tabs
Next steps/suggestions
Chrome Extension Installation
This project includes an unpacked Chrome extension that needs to be loaded manually once.
Step 1: Get the Extension Directory
agent-browser-mcp extension-pathStep 2: Load in Chrome
Open:
chrome://extensionsThen:
Enable "Developer mode"
Click "Load unpacked"
Select the directory output in the previous step
Step 3: Open a Normal Web Page
Note: Do not stay on about:blank.
Please open a normal web page in Chrome, such as:
https://www.baidu.comhttps://www.xiaohongshu.com
Otherwise, a valid session will not be established.
Hermes Configuration
Add the following to ~/.hermes/config.yaml:
mcp_servers:
agent_browser:
command: agent-browser-mcp
timeout: 120
connect_timeout: 60The project also includes an example file:
examples/hermes-config.yaml
After configuration, restart Hermes or reload the MCP.
You can verify with the following command:
hermes mcp list
hermes mcp test agent_browserIf the test is successful, Hermes will be able to discover and call these browser tools.
Claude Desktop / Cursor Configuration
Examples are also provided in the repository:
examples/claude-desktop-config.jsonexamples/cursor-mcp.json
The configuration structure is very simple; the core is:
{
"mcpServers": {
"agent_browser": {
"command": "agent-browser-mcp",
"args": []
}
}
}Typical Usage Workflow
Install the Python package
Load the extension in Chrome
Open a real web page
Connect this service in an MCP client
Start calling browser tools
For example, an Agent can:
Open the Xiaohongshu homepage
Read the recommendation feed
Scan the post list
Take a CDP screenshot of the page
Perform real mouse/keyboard operations when necessary
Security Warning
This project operates your real browser and real desktop.
This means:
Mouse movements are real
Clicks are real
Input is real
Hotkeys are real
Login states in the browser are also real
Please use this only in MCP client and Agent environments you trust.
FAQ
1. Hermes can see the MCP service, but is not connected to any tabs
Please check:
Whether the extension is already loaded in
chrome://extensionsWhether a normal web page is open in Chrome
Whether it is just stuck on
about:blank
You can also run:
agent-browser-mcp doctor2. connected_tabs is 0
Usually due to one of the following reasons:
The extension did not load successfully
No normal web page is currently open
The extension was just reloaded and the page has not refreshed yet
Suggestions:
Refresh the current page
Open a new normal URL
Run
doctoragain
3. Physical input does not work on macOS
Please grant system permissions to the terminal / MCP client:
Accessibility
Screen Recording (if you need desktop screenshots)
4. hermes mcp test agent_browser fails
Please check:
Whether the package was installed successfully
Whether
agent-browser-mcpis in the PATHWhether the Hermes configuration is correct
Run
agent-browser-mcp doctorto see diagnostic output
Acknowledgments
The browser automation capabilities of this project were extracted from the GenericAgent browser stack and re-packaged as an MCP service.
Special thanks to the GenericAgent project and its author for providing the original implementation ideas and core capabilities.
Original project address:
The following parts of this project are from or adapted from GenericAgent:
TMWebDriver.pysimphtml.pytmwd_cdp_bridgeChrome extension resources
If you continue to develop or publish based on this project, it is recommended to retain the acknowledgments and source attribution to GenericAgent.
License
MIT
Available Tools
20 toolscapture_desktop_screenshotB
Take a desktop screenshot of the whole screen using mss; useful for physical-input verification.
Inputs: save_path. Returns: object
capture_page_screenshotC
Capture a screenshot of the current page/tab via CDP and optionally save it to a file path.
Inputs: session_id, tab_id, format, save_path. Returns: object
cdp_batchC
Run a CDP bridge batch command; pass the full JSON command object as text.
Inputs: batch_json (required), session_id. Returns: object
cdp_commandC
Call a single Chrome DevTools Protocol command on the current or specified tab.
Inputs: method (required), params_json, session_id, tab_id. Returns: object
execute_jsC
Execute arbitrary JS in the current page context or send JSON CDP bridge commands through the page bridge.
Inputs: script (required), session_id, no_monitor. Returns: object
extension_pathA
Get absolute path to the unpacked Chrome extension directory for manual installation.
Inputs: no named parameters. Returns: object
get_cookiesC
Get cookies for the current page or specified tab via the Chrome extension bridge.
Inputs: session_id, tab_id. Returns: object
get_setup_statusA
Return extension path, bridge ports, and connection status for setup/diagnostics.
Inputs: no named parameters. Returns: object
hotkeyB
Send a hotkey chord like 'command,l' or 'ctrl,shift,p' via the real keyboard.
Inputs: keys_csv (required). Returns: object
list_extensionsB
List Chrome extensions visible to the CDP bridge extension itself.
Inputs: session_id. Returns: object
list_tabsB
List currently connected browser tabs/sessions.
Inputs: no named parameters. Returns: object
mouse_clickC
Click on the real desktop at screen coordinates.
Inputs: x, y, button, clicks, +1 more. Returns: object
mouse_dragC
Drag the real mouse from one point to another.
Inputs: x1 (required), y1 (required), x2 (required), y2 (required), +2 more. Returns: object
mouse_moveB
Move the real mouse cursor to screen coordinates.
Inputs: x (required), y (required), duration. Returns: object
open_new_tabA
Open a new browser tab with the given URL.
Inputs: url (required). Returns: object
open_urlB
Navigate the current tab to a URL using real-browser JS navigation.
Inputs: url (required), session_id, timeout. Returns: object
pointer_infoA
Report the current desktop mouse position and primary screen size.
Inputs: no named parameters. Returns: object
scan_pageA
Read the current page as simplified HTML/text, preserving login state from the real browser.
Inputs: session_id, text_only, cutlist, maxchars, +2 more. Returns: object
switch_tabB
Set the active browser tab by session id or URL substring.
Inputs: session_id, url_pattern. Returns: object
type_textB
Type text via the real keyboard, optionally after clicking a field.
Inputs: text (required), interval, click_x, click_y. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have distinct purposes, but some overlap exists: 'capture_desktop_screenshot' and 'capture_page_screenshot' could be confused for similar screenshot tasks, and 'cdp_batch' and 'cdp_command' both handle CDP commands with subtle differences. The descriptions help clarify, but an agent might occasionally misselect between these pairs.
All tool names follow a consistent snake_case verb_noun pattern, such as 'capture_desktop_screenshot', 'list_tabs', and 'open_new_tab'. This predictability makes it easy for agents to understand and use the tools without confusion from mixed naming conventions.
With 20 tools, the count is slightly high but reasonable for a browser automation server that covers desktop interaction, CDP commands, and page management. It feels comprehensive without being overly bloated, though it borders on the upper limit of typical scoping.
The tool set provides complete coverage for browser automation, including navigation, tab management, input simulation, screenshot capture, CDP access, and diagnostics. There are no obvious gaps; agents can perform core workflows like opening URLs, interacting with pages, and debugging without dead ends.
Maintenance
Related MCP Connectors
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Let your AI agent operate any website through a real, logged-in browser session.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control your existing Chrome browser via MCP, using your logged-in sessions for automation on authenticated sites. Provides high-level browser tools plus raw CDP and Chrome API access.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to directly operate a user's local Chrome browser with full login state and cookies, supporting 23 tools such as tab management, clicking, typing, screenshots, file upload, and network inspection through natural language.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control a real, authenticated Chrome browser through native tools for navigation, DOM interaction, form filling, scraping, screenshots, and human-in-the-loop checkpoints while minimizing tokens and latency.MIT
- AlicenseBqualityBmaintenanceEnables AI agents to control your installed Google Chrome through MCP or HTTP using compact text snapshots, exact pixel coordinates, and a visible cursor. It provides browser tools for navigation, clicking, typing, scrolling, tabs, forms, waiting, recording, and human handoff.3597 npm3MIT