 ](https://smithery.ai/server/web-browser-mcp-server) ](https://www.python.org/downloads/)  ](https://pypi.org/project/web-browser-mcp-server/) ](https://pypi.org/project/web-browser-mcp-server/)
✨ 特性
🌐 使AI助手能够通过简单的MCP界面浏览和提取网络内容。
Web浏览器MCP服务器为AI模型提供了通过消息控制协议(MCP)浏览网站、提取内容和理解网页的能力。它支持使用CSS选择器和强大的错误处理进行智能内容提取。
✨ 核心功能
- 🎯 智能内容提取:使用CSS选择器精确定位所需内容
- ⚡ 迅速的:内置异步处理以获得最佳性能
- 📊 元数据:捕获标题、链接和结构化内容
- 🛡️ 坚固可靠:内置错误处理和超时管理
- 🌍 交叉平台的:适用于Python运行的所有地方
🚀 快速开始
通过Smithery安装
通过以下方式自动安装Claude Desktop的Web浏览器服务器 史密瑟里:
npx -y @smithery/cli install web-browser-mcp-server --client claude手动安装
使用紫外线进行安装:
uv tool install web-browser-mcp-server发展:
# Clone and set up development environment
git clone https://github.com/blazickjp/web-browser-mcp-server.git
cd web-browser-mcp-server
# Create and activate virtual environment
uv venv
source .venv/bin/activate
# Install with test dependencies
uv pip install -e ".[test]"🔌 MCP集成
将此配置添加到MCP客户端配置文件中:
{
"mcpServers": {
"web-browser-mcp-server": {
"command": "uv",
"args": [
"tool",
"run",
"web-browser-mcp-server"
],
"env": {
"REQUEST_TIMEOUT": "30"
}
}
}
}发展:
{
"mcpServers": {
"web-browser-mcp-server": {
"command": "uv",
"args": [
"--directory",
"path/to/cloned/web-browser-mcp-server",
"run",
"web-browser-mcp-server"
],
"env": {
"REQUEST_TIMEOUT": "30"
}
}
}
}💡 可用工具
服务器提供了一个强大的网络浏览工具:
浏览网页
使用可选的CSS选择器浏览和提取网页内容:
# Basic webpage fetch
result = await call_tool("browse_webpage", {
"url": "https://example.com"
})
# Target specific content with CSS selectors
result = await call_tool("browse_webpage", {
"url": "https://example.com",
"selectors": {
"headlines": "h1, h2",
"main_content": "article.content",
"navigation": "nav a"
}
})⚙️ 配置
通过环境变量进行配置:
| 变量 | 目的 | 默认值 |
|---|---|---|
REQUEST_TIMEOUT | 网页请求超时(秒) | 30 |
🧪 测试
运行测试套件:
python -m pytest📄 许可证
根据MIT许可证发布。有关详细信息,请参阅LICENSE文件。
______________________________________________________________________
由以下材料制成❤️ 梨实验室团队
