mcp-server-rag-web-browser

Official

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows querying Google Search through the search tool that returns cleaned content from search results as Markdown

RAG Web 浏览器 Actor 的模型上下文协议 (MCP) 服务器 🌐

RAG Web 浏览器 Actor实现 MCP 服务器。此 Actor 充当大型语言模型 (LLM) 和 RAG 流水线的 Web 浏览器,类似于 ChatGPT 中的 Web 搜索。

🎯 这个 MCP 服务器有什么作用?

该服务器专为快速响应 AI 代理和 LLM 而设计,允许它们与 Web 交互并从网页中提取信息。它在本地运行,并与处于待机模式RAG Web 浏览器执行器通信,发送搜索查询并接收提取的 Web 内容作为响应。

RAG Web 浏览器 Actor 允许 AI 助手:

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

🧱 组件

工具

  • search :查询 Google 搜索,从结果中抓取前 N 个 URL,并将其清理后的内容以 Markdown 格式返回。参数:
    • query (字符串,必需):搜索词或 URL
    • maxResults (数字,可选):要抓取的最大搜索结果数(默认值:1)
    • scrapingTool (字符串,可选):选择用于提取网页的抓取工具。选项:'browser-playwright' 或 'raw-http'(默认值:'raw-http')
    • outputFormats (数组,可选):选择一种或多种输出格式。选项:'text'、'markdown'、'html'(默认值:['markdown'])
    • requestTimeoutSecs (数字,可选):请求的最长时间(秒)(默认值:40)

🔄 什么是模型上下文协议?

模型上下文协议 (MCP) 是一个框架,它使 Claude Desktop 等 AI 应用程序能够与外部工具和数据源无缝连接。更多详情,请访问模型上下文协议网站或阅读博客文章“什么是 MCP?它为何重要?”

🤖 MCP 服务器如何与 AI 代理集成?

MCP 服务器支持 AI 代理使用RAG Web 浏览器 Actor执行网页搜索和浏览。如需全面了解 AI 代理,请参阅我们的博客文章:什么是 AI 代理?并探索 Apify 的代理

有兴趣在 Apify 上构建自己的 AI 代理并实现盈利吗?查看我们的分步指南,了解如何在 Apify 平台上创建、发布 AI 代理并实现盈利。

🔌 Apify 提供的相关 MCP 服务器和客户端

该服务器通过标准输入/输出 (stdio) 运行,提供与 AI 代理的直接连接。Apify 还提供其他一些与 MCP 相关的工具:

服务器选项

客户端选项

  • 💬 Tester MCP 客户端– 一个用户友好的用户界面,可与任何基于 SSE 的 MCP 服务器进行交互

🛠️ 配置

先决条件

  • MacOS 或 Windows
  • 必须安装最新版本的 Claude Desktop(或其他 MCP 客户端)
  • Node.js (v18 或更高版本)
  • Apify API 令牌APIFY_TOKEN

安装

按照以下步骤在本地计算机上设置并运行服务器:首先,使用以下命令克隆存储库:

git clone git@github.com:apify/mcp-server-rag-web-browser.git

导航到项目目录并安装所需的依赖项:

cd mcp-server-rag-web-browser npm install

在运行服务器之前,您需要构建项目:

npm run build

克劳德桌面

配置 Claude Desktop 以识别 MCP 服务器。

  1. 打开您的 Claude Desktop 配置并编辑以下文件:
    • 在 macOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • 在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
    "mcpServers": { "rag-web-browser": { "command": "npx", "args": [ "@apify/mcp-server-rag-web-browser" ], "env": { "APIFY_TOKEN": "your-apify-api-token" } } }
  2. 重启Claude桌面
    • 完全退出 Claude Desktop(确保它不仅仅是最小化或关闭)。
    • 重新启动 Claude Desktop。
    • 查找🔌图标以确认服务器已连接。
  3. 示例您可以要求 Claude 执行网络搜索,例如:
    What is an MCP server and how can it be used? What is an LLM, and what are the recent news updates? Find and analyze recent research papers about LLMs.

使用MCP 检查器调试服务器

export APIFY_TOKEN=your-apify-api-token npx @modelcontextprotocol/inspector npx -y @apify/mcp-server-rag-web-browser

👷🏼 开发

本地客户端(stdio)

要在本地测试服务器,您可以使用example_client_stdio.ts

export APIFY_TOKEN=your-apify-api-token node dist/example_client_stdio.js

该脚本将启动 MCP 服务器,获取可用工具,然后使用查询调用search工具。

直接 API 调用

要测试直接调用 RAG Web 浏览器 Actor:

export APIFY_TOKEN=your-apify-api-token node dist/example_call_web_browser.js

调试

由于 MCP 服务器通过标准输入/输出 (stdio) 运行,因此调试可能颇具挑战性。为了获得最佳调试体验,请使用MCP 检查器

构建 mcp-server-rag-web-browser 包:

npm run build

您可以使用以下命令通过npm启动 MCP Inspector:

export APIFY_TOKEN=your-apify-api-token npx @modelcontextprotocol/inspector node dist/index.js

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Tools

为 RAG Web 浏览器 Actor 实现 MCP 服务器。该 Actor 充当大型语言模型 (LLM) 和 RAG 流程的 Web 浏览器,类似于 ChatGPT 中的 Web 搜索。

  1. 🎯 What does this MCP server do?
    1. 🧱 Components
      1. Tools
    2. 🔄 What is the Model Context Protocol?
      1. 🤖 How does the MCP Server integrate with AI Agents?
        1. 🔌 Related MCP servers and clients by Apify
          1. Server Options
          2. Client Options
        2. 🛠️ Configuration
          1. Prerequisites
          2. Install
        3. 👷🏼 Development
          1. Local client (stdio)
          2. Direct API Call
          3. Debugging
        ID: sr8xzdi3yv