<a href="https://glama.ai/mcp/servers/3hphahzvql"><img width="380" height="200" src="https://gips1.baidu.com/it/u=561741459,855680240&fm=3081&app=3081&f=PNG?w=760&h=400" alt="web-browser-mcp-server MCP server" /></a>
🌐 通过简单的MCP接口使AI助手能够浏览和提取网络内容。
Web Browser MCP Server 提供了通过消息控制协议(MCP)让AI模型浏览网站、提取内容并理解网页的能力。它支持使用CSS选择器进行智能内容提取,并具有强大的错误处理功能。
<div align="center"> </div>要通过Smithery自动安装Web Browser Server for Claude Desktop:
npx -y @smithery/cli install web-browser-mcp-server --client claude
使用uv安装:
uv tool install web-browser-mcp-server
对于开发:
# 克隆并设置开发环境
git clone https://github.com/blazickjp/web-browser-mcp-server.git
cd web-browser-mcp-server
# 创建并激活虚拟环境
uv venv
source .venv/bin/activate
# 安装测试依赖项
uv pip install -e ".[test]"
将此配置添加到您的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选择器:
# 基本网页抓取
result = await call_tool("browse_webpage", {
"url": "https://example.com"
})
# 使用CSS选择器定位特定内容
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文件。
由Pear Labs团队制作 ❤️
<a href="https://glama.ai/mcp/servers/04dtxi5i5n"><img width="380" height="200" src="https://gips0.baidu.com/it/u=2683012235,1234327861&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Web Browser MCP Server" /></a>
</div>