模型上下文协议 (mcp) 服务器 用于 Rag 网页浏览器演员 🌐
概覽
MCP伺服器是什麼?用於RAG網頁瀏覽器
MCP伺服器是為RAG(檢索增強生成)網頁瀏覽器設計的一個強大工具,旨在增強網頁抓取和自動化任務的功能。它作為一個後端伺服器,促進RAG網頁瀏覽器演員的運作,使得用戶能夠高效地收集和處理網頁數據。這個伺服器對於需要穩健的網頁數據提取和操作解決方案的開發者和數據科學家特別有用。
MCP伺服器的特點
- 無縫整合:MCP伺服器與RAG網頁瀏覽器無縫整合,實現流暢的操作和數據檢索。
- 可擴展性:設計能夠同時處理多個請求,伺服器可以根據用戶需求進行擴展,適合小型和大型項目。
- 用戶友好的介面:伺服器提供直觀的介面,簡化網頁抓取任務的配置和管理。
- 穩健的性能:通過優化算法,MCP伺服器確保快速和可靠的數據處理,最小化停機時間並最大化效率。
- 支持多種數據格式:伺服器能夠處理不同的數據格式,使其在數據分析和報告的各種應用中具有多樣性。
如何使用MCP伺服器進行RAG網頁瀏覽器
- 安裝:首先在您的本地機器或伺服器上安裝MCP伺服器。請按照文檔中提供的安裝說明進行操作。
- 配置:配置伺服器設置以匹配您的項目需求,包括設置API密鑰、數據格式和其他偏好設置。
- 整合:將MCP伺服器與RAG網頁瀏覽器演員連接。這一步對於啟用數據檢索和處理功能至關重要。
- 執行:啟動伺服器並執行您的網頁抓取任務。監控性能並根據需要調整設置以優化結果。
- 數據管理:一旦數據收集完成,使用伺服器的工具來管理、分析和以所需格式導出數據。
常見問題解答
問:MCP伺服器的主要用途是什麼?
答: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.
伺服器配置
{
"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"
}
}
}
}