Model Context Protocol (MCP) Server for the RAG Web Browser Actor 🌐

Model Context Protocol (MCP) Server for the RAG Web Browser Actor 🌐

site icon
2025.04.04 0
JavaScript网络浏览器AI工具浏览器自动化开发效率
该MCP服务器是为RAG Web Browser Actor实现的,作为一个大型语言模型(LLMs)和RAG管道的网络浏览器,类似于ChatGPT中的网络搜索功能。它允许AI助手执行网络搜索,抓取搜索结果中的前N个URL,并将其清理后的内容以Markdown格式返回,或者获取单个URL的内容并返回为Markdown。
View on GitHub

Overview

基本能力

产品定位

该MCP服务器是为RAG Web Browser Actor实现的,作为一个大型语言模型(LLMs)和RAG管道的网络浏览器,类似于ChatGPT中的网络搜索功能。

核心功能

  • 执行网络搜索,抓取搜索结果中的前N个URL,并将其清理后的内容以Markdown格式返回。
  • 获取单个URL的内容并返回为Markdown。

适用场景

  • AI助手需要获取网络信息时。
  • 需要从多个URL中提取和清理内容时。
  • 在RAG管道中需要网络搜索功能时。

工具列表

  • search: 查询Google搜索,抓取搜索结果中的前N个URL,并将其清理后的内容以Markdown格式返回。
  • 参数:
    • query (字符串, 必需): 搜索词或URL
    • max_results (数字, 可选): 要抓取的搜索结果的最大数量(默认: 1)

常见问题解答

  • 如何调试MCP服务器?
  • 使用MCP Inspector进行调试,可以通过以下命令启动: bash npx @modelcontextprotocol/inspector node ~/apify/mcp-server-rag-web-browser/build/index.js APIFY_API_TOKEN=your-apify-api-token

使用教程

使用依赖

  • MacOS或Windows
  • 最新版本的Claude Desktop(或其他MCP客户端)
  • Node.js(v18或更高版本)
  • Apify API Token(APIFY_API_TOKEN

安装教程

  1. 配置Claude Desktop以识别MCP服务器。
  2. 编辑Claude Desktop的配置文件:
    • macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
  3. 添加以下配置: json "mcpServers": { "mcp-server-rag-web-browser": { "command": "npx", "args": [ "/path/to/mcp-server-rag-web-browser/build/index.js", ] "env": { "APIFY-API-TOKEN": "your-apify-api-token" } } }
  4. 重启Claude Desktop。

调试方式

  1. 使用example_client测试服务器: bash node build/example_client.js
  2. 调用RAG Web Browser Actor进行测试: bash APIFY_API_TOKEN=your-apify-api-token node build/example_call_web_browser.js
  3. 使用MCP Inspector进行调试: bash npx @modelcontextprotocol/inspector node ~/apify/mcp-server-rag-web-browser/build/index.js APIFY_API_TOKEN=your-apify-api-token

许可证

该项目遵循 Apache-2.0 开源许可条款,请参阅 Apache-2.0 了解完整条款。