MCP Browser Use - 网络浏览工具
赋予人工智能代理使用自然语言指令和 Selenium 进行网络浏览、自动化和数据抓取任务的能力,且所需监督最少。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcp_browser_use": {
"args": [
"/Users/janspoerer/code/mcp_browser_use/mcp_browser_use"
],
"command": "/Users/janspoerer/code/mcp_browser_use/.venv/bin/python"
}
}
}
该服务需要配置环境变量:headless
服务介绍
MCP 浏览器使用
通过此MCP可以实现什么
该项目旨在利用模型上下文协议(MCP)和Selenium,使AI代理能够执行网页使用、浏览器自动化、抓取和自动化。
我们的使命是让AI代理在最少的人类监督下完成任何网络任务——所有这些都是基于自然语言指令。
如何使用此MCP
请参考modelcontextprotocol.io上的MCP文档。
请注意,您需要在您的MCP配置文件所指向的Python环境中安装所有依赖项。例如,如果您指向python或python3可执行文件,那么您将指向全局Python环境。通常建议指向一个虚拟环境,如:
/Users/yourname/code/mcp_browser_use/.venv/bin/python
如果您已将此仓库克隆到本地的code文件夹中,您的MCP配置文件应如下所示:
{
"mcpServers": {
"mcp_browser_use": {
"command": "/Users/janspoerer/code/mcp_browser_use/.venv/bin/python",
"args": [
"/Users/janspoerer/code/mcp_browser_use/mcp_browser_use"
]
}
}
}
它将位于这里(在macOS中):/Users/janspoerer/Library/Application Support/Claude/claude_desktop_config.json。
请参阅requirements.txt以查看需要安装哪些依赖项。
重启Claude以检查JSON配置是否有效。如果有问题,Claude会引导您查看MCP的错误日志。
如果设置成功,在Claude的“新聊天”窗口右下角将会看到一个小锤子图标。锤子旁边将显示MCP提供的功能数量。
点击锤子,您将看到类似以下内容:
Available MCP Tools
Claude can use tools provided by specialized servers using Model Context Protocol. Learn more about MCP.
click_element
Click an element on the page. Args: session_id: Session ID of the browser selector: CSS selector, XPath, or ID of the element to click selector_type: Type of selector (css, xpath, id)
From server: mcp_browser_use
close_browser
Close a browser session. Args: session_id: Session ID of the browser to close
From server: mcp_browser_use
fill_text
Input text into an element. Args: session_id: Session ID of the browser selector: CSS selector, XPath, or ID of the input field text: Text to enter into the field selector_type: Type of selector (css, xpath, id) clear_first: Whether to clear the field before entering text
From server: mcp_browser_use
navigate
Navigate to a URL. Args: session_id: Session ID of the browser url: URL to navigate to
From server: mcp_browser_use
scroll
Scroll the page. Args: session_id: Session ID of the browser x: Horizontal scroll amount in pixels y: Vertical scroll amount in pixels
From server: mcp_browser_use
send_keys
Send keyboard keys to the browser. Args: session_id: Session ID of the browser key: Key to send (e.g., ENTER, TAB, etc.) selector: CSS selector, XPath, or ID of the element to send keys to (optional) selector_type: Type of selector (css, xpath, id)
From server: mcp_browser_use
start_browser
Start a new browser session. Args: headless: Whether to run the browser in headless mode
From server: mcp_browser_use
take_screenshot
Take a screenshot of the current page. Args: session_id: Session ID of the browser
From server: mcp_browser_use
