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

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

镜像

概述

这是为 RAG 网页浏览器 Actor 实现的 MCP 服务器,允许 AI 应用程序(如 Claude Desktop)执行网络搜索并获取网页内容。

核心功能

  • 执行网络搜索并抓取结果
  • 获取单个 URL 内容
  • 以 Markdown 格式返回清理后的内容

安装步骤

前提条件

  • MacOS 或 Windows
  • Claude Desktop 或其他 MCP 客户端
  • Node.js v18+
  • Apify API Token

配置 Claude Desktop

  1. 编辑 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
  2. 添加以下配置:

    "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"
        }
      }
    }
    
  3. 重启 Claude Desktop(完全退出后重新启动)

使用方法

向 Claude 询问需要网络搜索的问题,例如:

什么是 MCP 服务器以及如何使用它?
查找并分析关于 LLM 的最新研究论文。

开发与调试

本地测试

node build/example_client.js

调试

使用 MCP Inspector:

npm run build
npx @modelcontextprotocol/inspector node ~/apify/mcp-server-rag-web-browser/build/index.js APIFY_API_TOKEN=your-apify-api-token

直接调用 Actor 进行测试

APIFY_API_TOKEN=your-apify-api-token node build/example_call_web_browser.js

查看连接状态:启动 Claude Desktop 后,查找 🔌 图标确认 MCP 服务器已连接。