模型上下文协议 (mcp) 服务器用于 Rag 网页浏览器演员 🌐
概览
MCP服务器用于RAG网页浏览器是什么?
MCP服务器用于RAG网页浏览器是一个强大的工具,旨在增强网页抓取和自动化任务的功能。它作为一个后端服务器,促进RAG(检索增强生成)网页浏览器演员的操作,使用户能够高效地收集和处理网页数据。这个服务器特别适合需要强大网页数据提取和处理解决方案的开发者和数据科学家。
MCP服务器用于RAG网页浏览器的特点
- 无缝集成:MCP服务器与RAG网页浏览器无缝集成,允许顺畅的操作和数据检索。
- 可扩展性:设计用于同时处理多个请求,服务器可以根据用户需求进行扩展,适合小型和大型项目。
- 用户友好的界面:服务器提供直观的界面,简化了网页抓取任务的配置和管理。
- 强大的性能:通过优化算法,MCP服务器确保快速和可靠的数据处理,最小化停机时间并最大化效率。
- 支持多种数据格式:服务器可以处理不同的数据格式,使其在数据分析和报告的各种应用中具有多功能性。
如何使用MCP服务器用于RAG网页浏览器
- 安装:首先在本地机器或服务器上安装MCP服务器。按照文档中提供的安装说明进行操作。
- 配置:配置服务器设置以匹配您的项目需求。这包括设置API密钥、数据格式和其他偏好。
- 集成:将MCP服务器与RAG网页浏览器演员连接。此步骤对于启用数据检索和处理能力至关重要。
- 执行:启动服务器并执行您的网页抓取任务。监控性能并根据需要调整设置以优化结果。
- 数据管理:一旦收集到数据,使用服务器的工具管理、分析和以所需格式导出数据。
常见问题解答
问:MCP服务器用于RAG网页浏览器的主要用途是什么?
答:MCP服务器主要用于网页抓取和自动化任务,使用户能够高效地从各种网站收集和处理数据。
问:MCP服务器适合大规模项目吗?
答:是的,MCP服务器设计为可扩展,适合小型和大规模项目。
问:我可以自定义服务器设置吗?
答:当然可以!MCP服务器允许广泛自定义设置以满足特定项目需求。
问:服务器支持哪些类型的数据格式?
答:MCP服务器支持多种数据格式,包括JSON、CSV和XML,使其在不同应用中具有多功能性。
问:我在哪里可以找到有关MCP服务器的更多信息?
答:有关更详细的信息,您可以访问官方Apify文档或MCP服务器的GitHub存储库。
详情
Model Context Protocol (MCP) Server for the RAG Web Browser Actor 🌐
Implementation of an MCP server for the RAG Web Browser Actor. This Actor serves as a web browser for large language models (LLMs) and RAG pipelines, similar to a web search in ChatGPT.
<a href="https://glama.ai/mcp/servers/sr8xzdi3yv"><img width="380" height="200" src="https://glama.ai/mcp/servers/sr8xzdi3yv/badge" alt="mcp-server-rag-web-browser MCP server" /></a>
🎯 What does this MCP server do?
This server is specifically designed to provide fast responses to AI agents and LLMs, allowing them to interact with the web and extract information from web pages. It runs locally and communicates with the RAG Web Browser Actor in Standby mode, sending search queries and receiving extracted web content in response.
The RAG Web Browser Actor allows an AI assistant to:
- Perform web search, scrape the top N URLs from the results, and return their cleaned content as Markdown
- Fetch a single URL and return its content as Markdown
🧱 Components
Tools
- search: Query Google Search, scrape the top N URLs from the results, and returns their cleaned content as Markdown. Arguments:
query
(string, required): Search term or URLmaxResults
(number, optional): Maximum number of search results to scrape (default: 1)scrapingTool
(string, optional): Select a scraping tool for extracting web pages. Options: 'browser-playwright' or 'raw-http' (default: 'raw-http')outputFormats
(array, optional): Select one or more formats for the output. Options: 'text', 'markdown', 'html' (default: ['markdown'])requestTimeoutSecs
(number, optional): Maximum time in seconds for the request (default: 40)
🔄 What is the Model Context Protocol?
The Model Context Protocol (MCP) is a framework that enables AI applications, such as Claude Desktop, to connect seamlessly with external tools and data sources. For more details, visit the Model Context Protocol website or read the blog post What is MCP and why does it matter?.
🤖 How does the MCP Server integrate with AI Agents?
The MCP Server empowers AI Agents to perform web searches and browsing using the RAG Web Browser Actor. For a comprehensive understanding of AI Agents, check out our blog post: What are AI Agents? and explore Apify's Agents.
Interested in building and monetizing your own AI agent on Apify? Check out our step-by-step guide for creating, publishing, and monetizing AI agents on the Apify platform.
🔌 Related MCP servers and clients by Apify
This server operates over standard input/output (stdio), providing a straightforward connection to AI Agents. Apify offers several other MCP-related tools:
Server Options
- 🖥️ This MCP Server – A local stdio-based server for direct integration with Claude Desktop
- 🌐 RAG Web Browser Actor via SSE – Access the RAG Web Browser directly via Server-Sent Events without running a local server
- 🇦 MCP Server Actor – MCP Server that provides AI agents with access to over 4,000 specialized Apify Actors
Client Options
- 💬 Tester MCP Client – A user-friendly UI for interacting with any SSE-based MCP server
🛠️ Configuration
Prerequisites
- MacOS or Windows
- The latest version of Claude Desktop must be installed (or another MCP client)
- Node.js (v18 or higher)
- Apify API Token (
APIFY_TOKEN
)
Install
Follow the steps below to set up and run the server on your local machine: First, clone the repository using the following command:
git clone git@github.com:apify/mcp-server-rag-web-browser.git
Navigate to the project directory and install the required dependencies:
cd mcp-server-rag-web-browser
npm install
Before running the server, you need to build the project:
npm run build
Claude Desktop
Configure Claude Desktop to recognize the MCP server.
-
Open your Claude Desktop configuration and edit the following file:
- On macOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
- On 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" } } }
- On macOS:
-
Restart Claude Desktop
- Fully quit Claude Desktop (ensure it's not just minimized or closed).
- Restart Claude Desktop.
- Look for the 🔌 icon to confirm that the server is connected.
-
Examples
You can ask Claude to perform web searches, such as:
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.
Debug the server using the MCP Inspector
export APIFY_TOKEN=your-apify-api-token
npx @modelcontextprotocol/inspector npx -y @apify/mcp-server-rag-web-browser
👷🏼 Development
Local client (stdio)
To test the server locally, you can use example_client_stdio.ts
:
export APIFY_TOKEN=your-apify-api-token
node dist/example_client_stdio.js
The script will start the MCP server, fetch available tools, and then call the search
tool with a query.
Direct API Call
To test calling the RAG Web Browser Actor directly:
export APIFY_TOKEN=your-apify-api-token
node dist/example_call_web_browser.js
Debugging
Since MCP servers operate over standard input/output (stdio), debugging can be challenging. For the best debugging experience, use the MCP Inspector.
Build the mcp-server-rag-web-browser package:
npm run build
You can launch the MCP Inspector via npm
with this command:
export APIFY_TOKEN=your-apify-api-token
npx @modelcontextprotocol/inspector node dist/index.js
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Server配置
{
"mcpServers": {
"mcp-server-rag-web-browser": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--apify--mcp-server-rag-web-browser--mcp-server-rag-web-browser",
"npm run start"
],
"env": {
"APIFY_TOKEN": "apify-token"
}
}
}
}