获取浏览器
强大的无头浏览器 MCP 服务器,使 AI 代理无需任何 API 密钥即可获取网页内容并执行 Google 搜索。它基于现代 Web 标准构建,旨在与 AI 平台无缝集成。
特征
- 无需 API 密钥:使用复杂的无头浏览器方法直接获取内容
- 智能谷歌搜索:
- 从 Google 搜索中提取结构化结果
- 支持网络和新闻结果
- 可配置结果数量(1-100)
- 获取搜索结果的全部内容
- 自动重试和错误处理
- 通用内容获取:
- 支持任何网页或 API 端点
- 多种输出格式(HTML、JSON、文本、Markdown)
- 自动内容类型检测
- 响应大小限制和超时保护
- 速率限制保护
- 格式转换:
- 清理 HTML 到 Markdown 的转换
- 漂亮打印的 JSON 响应
- 结构化 HTML 输出
- 具有正确格式的纯文本
工具
1. Google 搜索工具( google_search
)
执行 Google 搜索并获取结果的全部内容:
{
query: "your search query",
responseType: "markdown", // or "json", "html", "text"
maxResults: 10, // 1-100 results
topic: "web" // or "news"
}
2. URL 获取工具( fetch_url
)
从任何 URL 获取内容:
{
url: "https://example.com",
responseType: "markdown", // or "json", "html", "text"
timeout: 30000 // optional, in milliseconds
}
安装
通过史密斯里
# For Claude
npx -y @smithery/cli install @TheSethRose/fetch-browser --client claude
# For Cursor
npx -y @smithery/cli install @TheSethRose/fetch-browser --client cursor
# For TypeScript
npx -y @smithery/cli install @TheSethRose/fetch-browser --client typescript
手动安装
# Clone the repository
git clone https://github.com/TheSethRose/fetch-browser.git
cd fetch-browser
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
发展
# Watch mode with auto-rebuild
npm run watch
# Run with inspector
npm run inspector
# Debug mode
npm run debug
# Debug with watch mode
npm run debug:watch
响应格式
1. Markdown 格式
## [Page Title](https://example.com)
Content converted to clean markdown with:
- Lists
- **Bold text**
- *Italic text*
- [Links](https://example.com)
2. JSON格式
{
"url": "https://example.com",
"content": "Extracted content...",
"error": null
}
3. HTML格式
<div class="search-result">
<h2><a href="https://example.com">Page Title</a></h2>
<div class="content">
Original HTML content
</div>
</div>
4.文本格式
### https://example.com
Plain text content with preserved formatting
==========
错误处理
- 使用指数退避算法自动重试
- 速率限制保护
- 超时处理
- 详细错误消息
- 个别结果错误追踪
安全功能
- 响应大小限制
- 请求超时
- 速率限制保护
- 无需 API 密钥或秘密
- 正确的错误处理
致谢
由 Seth Rose 创建:
执照
MIT 许可证 - 详情请参阅许可证