Heather8769/any-browser-mcp
If you are the rightful owner of any-browser-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Any Browser MCP is a cutting-edge browser automation tool that leverages the Model Context Protocol to directly control your existing browser, eliminating the need for isolated contexts.
browser_screenshot
Take screenshots of page or elements.
browser_navigate
Navigate to URLs.
browser_click
Click elements.
browser_fill
Fill inputs quickly.
browser_evaluate
Execute JavaScript in browser context.
Any Browser MCP ๐
Revolutionary Browser Automation via Model Context Protocol (MCP)
๐ฏ The Breakthrough: No Isolated Contexts
Unlike traditional browser automation tools that create separate, isolated browser instances, Any Browser MCP directly controls your existing browser - the one you can see and interact with!
โ Traditional Automation (Isolated)
Your Real Browser Automation Tool
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ ๐ Your tabs โ โ โ ๐ค Separate โ
โ โข Gmail โ โ โข Clean profile โ
โ โข Your data โ โ โข No bookmarks โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Any Browser MCP (Direct Control)
Your Real Browser (SAME BROWSER!)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Your tabs โ ๐ค MCP Controls โ
โ โข Gmail โ โ
Available โ
โ โข Your data โ โ
Available โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
A production-grade MCP (Model Context Protocol) server that directly controls your existing browser via the Chrome DevTools Protocol (CDP). No isolated contexts - it controls the actual browser windows you can see and interact with!
๐ Key Features
- ๐ Auto-Launch Chrome - Automatically starts Chrome with debugging when needed
- ๐ Direct Browser Control - Controls your actual visible browser tabs
- ๐ Profile Preservation - Uses your bookmarks, passwords, extensions
- ๐ ๏ธ 20+ Automation Tools - Complete browser automation toolkit
- ๐ฏ No Isolation - Works with your real browser, not a separate instance
- โก Chrome DevTools Protocol - Direct WebSocket communication for maximum performance
- ๐ Smart Detection - Finds existing Chrome or launches new instance
- ๐งน Graceful Cleanup - Proper connection management and cleanup
๐ฆ Installation
Quick Start (Recommended) - Direct Control
# Auto-launch Chrome and start MCP server:
npx any-browser-mcp-direct --verbose
Traditional MCP Server (Isolated Contexts)
# Original version with Playwright isolation:
npx any-browser-mcp@latest
Global Installation
npm install -g any-browser-mcp
Local Development
git clone <repository>
cd any-browser-mcp
npm install
๐ฏ Quick Start
1. Start Your Browser with Debugging
Chrome/Chromium:
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# Windows
chrome.exe --remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222
Edge:
# Windows
msedge.exe --remote-debugging-port=9223
# macOS
/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --remote-debugging-port=9223
Firefox:
# Enable in about:config
devtools.debugger.remote-enabled = true
devtools.debugger.remote-port = 9224
2. Run the MCP Server
Auto-detect running browser:
npx any-browser-mcp@latest
Connect to specific endpoint:
npx any-browser-mcp@latest --endpoint ws://127.0.0.1:9222/devtools/browser
Connect to specific browser:
npx any-browser-mcp@latest --browser chrome
3. Configure with Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"anybrowser": {
"command": "npx",
"args": ["any-browser-mcp@latest"]
}
}
}
๐ ๏ธ Available Tools
Browser Management
browser_screenshot
- Take screenshots of page or elementsbrowser_get_content
- Get HTML content or textbrowser_wait_for
- Wait for elements or conditionsbrowser_evaluate
- Execute JavaScript in browser context
Navigation
browser_navigate
- Navigate to URLsbrowser_back
/browser_forward
- Browser history navigationbrowser_reload
- Reload current pagebrowser_new_tab
- Open new tabsbrowser_list_tabs
- List all open tabsbrowser_switch_tab
- Switch between tabs
Interaction
browser_click
- Click elementsbrowser_type
- Type text with realistic timingbrowser_fill
- Fill inputs quicklybrowser_press_key
- Press keyboard keysbrowser_hover
- Hover over elementsbrowser_select_option
- Select from dropdownsbrowser_drag_and_drop
- Drag and drop elements
Utilities
browser_find_elements
- Find and inspect elementsbrowser_get_attribute
- Get element attributesbrowser_get_text
- Extract text contentbrowser_check_element
- Check element statesbrowser_get_page_info
- Get comprehensive page infobrowser_scroll
- Scroll page or elements
๐ Netlify Deployment
1. Environment Variables
Set in Netlify dashboard:
CDP_ENDPOINT=ws://your-browser-host:9222/devtools/browser
ALLOW_BROWSER_LAUNCH=true # Optional: allow launching browsers
NODE_ENV=production
2. Deploy
netlify init
netlify deploy --prod
3. Configure Claude Desktop for Remote
{
"mcpServers": {
"any-browser-remote": {
"endpoint": "https://your-site.netlify.app/.netlify/functions/any-browser-mcp",
"transportType": "http"
}
}
}
๐ง CLI Options
any-browser-mcp [options]
Options:
-e, --endpoint <url> Explicit CDP endpoint (ws://...)
-b, --browser <type> Browser preference (detect|chrome|edge|firefox)
-p, --port <number> Custom debugging port
--launch Launch browser if none found
-v, --verbose Enable verbose logging
--help Show help
๐ Examples
Basic Page Automation
// Navigate to a website
await browser_navigate({ url: "https://example.com" });
// Find and click a button
await browser_click({ selector: "button.submit" });
// Fill a form
await browser_fill({ selector: "#email", value: "user@example.com" });
await browser_fill({ selector: "#password", value: "password123" });
// Take a screenshot
await browser_screenshot({ fullPage: true, path: "result.png" });
Advanced Interaction
// Wait for dynamic content
await browser_wait_for({
selector: ".loading",
state: "hidden",
timeout: 10000
});
// Extract data from multiple elements
const elements = await browser_find_elements({
selector: ".product-card",
limit: 20,
includeText: true,
includeAttributes: true
});
// Execute custom JavaScript
const result = await browser_evaluate({
script: "return document.querySelectorAll('.item').length"
});
๐ Security Considerations
- Local Use: Browser debugging ports are only accessible locally by default
- Remote Deployment: Ensure proper network security when exposing CDP endpoints
- Session Management: Sessions auto-expire after 30 minutes of inactivity
- CORS: Properly configured for cross-origin requests in Netlify deployment
๐ Troubleshooting
Browser Not Found
# Check if browser is running with debugging enabled
curl http://localhost:9222/json/version
# Try explicit endpoint
any-browser-mcp --endpoint ws://127.0.0.1:9222/devtools/browser
# Launch new instance
any-browser-mcp --launch --verbose
Connection Issues
- Ensure no firewall blocking debugging ports
- Check browser isn't running in incognito/private mode
- Verify correct port numbers for your browser
- Use
--verbose
flag for detailed connection logs
Netlify Function Issues
- Check environment variables are set correctly
- Verify CDP endpoint is accessible from Netlify
- Monitor function logs for detailed error information
- Ensure CORS headers are properly configured
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request