MCP Browser Console Capture Service
About
A browser automation service for capturing console output, useful for tasks like public sentiment analysis.
Details
- Author
- ktrusteric
- Categories
- Web Scraping, Automation, Other
Jump to
Setup
Install MCP Browser Console Capture Service in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/ktrusteric/mcp_selenium
Follow the installation instructions in the repository README, then restart your MCP client.
A browser automation service for capturing console output, useful for tasks like public sentiment analysis.
MCP Browser Console Capture Service 是一个基于 FastMCP 框架的浏览器自动化服务,专门用于智能舆情分析系统。该服务提供了完整的浏览器控制、JavaScript 执行、控制台日志捕获和页面交互功能。
- FastMCP: MCP (Model Context Protocol) 服务框架
- Selenium: 浏览器自动化工具
- Chrome: 主要支持的浏览器
- ChromeDriver: Chrome 浏览器驱动程序
- Python 3.10.12+: 运行环境
- 启动和管理 Chrome/Firefox 浏览器实例
- 页面导航和 URL 访问
- 窗口大小调整和管理
- 多会话支持
- 在页面中执行自定义 JavaScript 代码
- 获取执行结果和返回值
- 支持异步脚本执行
- 实时捕获浏览器控制台日志
- 支持多种日志级别(INFO、WARNING、ERROR、DEBUG)
- 结构化日志数据返回
- 可配置日志数量限制(最多10000条)
- 支持test-token-eric特殊认证
- 默认管理员权限
- 完整的操作日志记录
# Ubuntu/Debian 系统 sudo apt update sudo apt install -y python3 python3-pip python3-venv # 安装必要的系统依赖 sudo apt install -y wget unzip curl
Google Chrome for Testing 137.0.7151.119 ChromeDriver 137.0.7151.119 (e0ac9d12dff5f2d33c935958b06bf1ded7f1c08c-refs/branch-heads/7151@{#2356})
请自行下载安装:json 源地址https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
/opt/chromedriver-linux64/chromedriver --version /opt/chrome-linux64/chrome --version
python3 -m venv venv source venv/bin/activate
{ "mcpServers": { "browser-console-capture": { "command": "/home/cooper/IntelligentPublicSentimentSystem/mcp_services/browser_console_capture/server.py", "args": [], "env": { "PYTHONPATH": "/home/cooper/IntelligentPublicSentimentSystem" } } } }
# 确保 Chrome 和 ChromeDriver 有执行权限 sudo chmod +x /opt/chrome-linux64/chrome sudo chmod +x /opt/chromedriver-linux64/chromedriver # 创建必要的目录 mkdir -p ./screenshots mkdir -p ./logs
# 测试 Chrome 启动 /opt/chrome-linux64/chrome --version --no-sandbox # 测试 ChromeDriver /opt/chromedriver-linux64/chromedriver --version # 测试 Python 依赖 python3 -c "import selenium; print('Selenium version:', selenium.__version__)" python3 -c "import fastmcp; print('FastMCP imported successfully')"
IntelligentPublicSentimentSystem/mcp_services/browser_console_capture$ fastmcp run server.py:mcp
2025-06-20 03:02:09,006 - server_module - INFO - 日志系统初始化完成,配置已加载 2025-06-20 03:02:09,010 - auth_utils - INFO - === 浏览器MCP认证配置 === 2025-06-20 03:02:09,010 - auth_utils - INFO - 默认用户: eric 2025-06-20 03:02:09,010 - auth_utils - INFO - 默认角色: admin 2025-06-20 03:02:09,010 - auth_utils - INFO - 特殊Token: test-token-eric 2025-06-20 03:02:09,011 - auth_utils - INFO - 浏览器MCP将自动使用eric用户身份进行认证 2025-06-20 03:02:09,011 - auth_utils - INFO - ========================== 2025-06-20 03:02:09,011 - server_module - INFO - 初始化FastMCP服务器... 2025-06-20 03:02:09,016 - server_module - INFO - FastMCP服务器初始化完成 2025-06-20 03:02:09,017 - server_module - INFO - 状态字典初始化完成
# 启动浏览器 start_browser(browser_type="chrome", headless=False) # 导航到页面 navigate_to_url("https://example.com") # 执行 JavaScript execute_javascript("console.log('Hello World'); return document.title;") # 获取控制台日志 get_console_logs(level="ALL", limit=100)
# 点击元素 click_element("#submit-button", by="css") # 输入文本 input_text("#search-input", "搜索内容", by="css") # 等待元素 wait_for_element(".loading-complete", condition="visible") # 截图 take_screenshot("page_screenshot.png", full_page=True)
- chrome_binary_path: Chrome 浏览器可执行文件路径
- chromedriver_path: ChromeDriver 可执行文件路径
- headless: 是否以无头模式运行
- window_size: 浏览器窗口大小
- log_level: 日志级别(DEBUG, INFO, WARNING, ERROR)
- log_file: 日志文件路径
- max_log_size: 最大日志文件大小
- page_load_timeout: 页面加载超时时间
- script_timeout: 脚本执行超时时间
- implicit_wait: 隐式等待时间
- 项目 Issues:GitHub Issues
- 邮箱:项目邮箱
- 文档:在线文档
MCP server for browser automation via Vercel agent-browser CLI
Convert any URL to LLM-ready Markdown via real Chrome browsers. 3 tools: scrape, crawl, search. Free via MCP, pay-per-use via x402.
An MCP server that allows AI agents to control a web browser using the browser-use library.
Exposes Chrome browser functionality to AI assistants for automation, content analysis, and semantic search via a Chrome extension.
Control a Chrome browser through the Chrome DevTools Protocol (CDP) from MCP clients for browsing, inspection, and automation workflows.
Stealthy, LLM-drivable browser engine — a Python library + 85-tool MCP server on stealth Chromium with full Chrome DevTools Protocol.
Multi-session browser MCP for AI agents — stealth mode, session pooling, humanization, 10x fewer tokens than Playwright
A Go-based MCP server for interacting with the Lightpanda Browser using the Chrome DevTools Protocol (CDP).
A browser automation agent using the Model Context Protocol (MCP) to enable browser interactions.
Control the Chrome browser for web automation using an AI model. Requires the MCP Chrome extension.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


