无头浏览器服务

一个强大的无头浏览器MCP服务器,使AI代理能够获取网页内容并执行Google搜索,无需任何API密钥。

  • by TheSethRose
  • TypeScript
  • 本地部署
  • 24 星标
  • 更新于
在 GitHub 查看 TheSethRose/Fetch-Browser

使用说明

获取浏览器

功能强大的无头浏览器MCP服务器,使人工智能代理能够在不需要任何API密钥的情况下获取网络内容并执行谷歌搜索。基于现代网络标准构建,旨在与人工智能平台无缝集成。

特性

  • 不需要API密钥:使用复杂的无头浏览器方法直接获取内容

  • 智能谷歌搜索:

    • 从谷歌搜索中提取结构化结果
    • 支持网络和新闻结果
    • 可配置的结果数量(1-100)
    • 搜索结果的完整内容获取
    • 自动重试和错误处理
  • 通用内容获取:

    • 支持任何网页或API端点
    • 多种输出格式(HTML、JSON、文本、Markdown)
    • 自动内容类型检测
    • 响应大小限制和超时保护
    • 速率限制保护
  • 格式转换:

    • 干净的HTML到Markdown转换
    • 打印精美的JSON响应
    • 结构化HTML输出
    • 格式正确的纯文本

工具

1.谷歌搜索工具(google_search)

执行谷歌搜索并获取结果的全部内容:

{
  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密钥或机密
  • 正确的错误处理

鸣谢

由赛斯·罗斯创作:

许可证

MIT许可证-请参阅 许可证 详见