# Actors 微云服务器
## 基本信息
- Slug: `apify-actors-mcp-server`
- Source: modelscope
- Publisher: @apify/actors-mcp-server
- Categories: browser-automation / social-media / ecommerce-and-retail
- Hosted: No
- License: Apache License 2.0
- Source URL: https://www.modelscope.cn/mcp/servers/@apify/actors-mcp-server
## 简介
使用 Apify 提供的 3,000 多种预构建云工具（称为 Actors），从网站、电子商务平台、社交媒体、搜索引擎、地图等提取数据。
## 安装提示

```bash
MCP 服务器加载 Actor 输入模式，并根据 Actors 创建相应的 MCP 工具。 请参阅 [RAG Web Browser](https://apify.com/apify/rag-web-browser/input-schema) 的输入模式示例。 工具名称必须始终是完整的 Actor 名称，例如 `apify/rag-web-browser`。 MCP 工具的参数代表 Actor 的输入参数。 例如，对于 `apify/rag-web-browser` Actor，其参数为：
```

## MCP Server 详情

# Apify Model Context Protocol (MCP) 服务器

[![Actors MCP Server](https://apify.com/actor-badge?actor=apify/actors-mcp-server)](https://apify.com/apify/actors-mcp-server)
[![smithery badge](https://smithery.ai/badge/@apify/actors-mcp-server)](https://smithery.ai/server/@apify/actors-mcp-server)

为所有 [Apify Actors](https://apify.com/store) 实现的 MCP 服务器。
此服务器允许与一个或多个在 MCP 服务器配置中定义的 Apify Actors 进行交互。

服务器可以通过两种方式使用：
- **🇦 [MCP 服务器 Actor](https://apify.com/apify/actors-mcp-server)** – 通过 Server-Sent Events (SSE) 可访问的 HTTP 服务器，参见 [指南](#-mcp-server-actor)
- **⾕ MCP 服务器 Stdio** – 通过标准输入/输出 (stdio) 可用的本地服务器，参见 [指南](#-mcp-server-at-a-local-host)

还可以使用类似聊天界面的 💬 [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) 与 MCP 服务器进行交互。

# 🎯 Apify MCP 服务器的作用是什么？

MCP 服务器 Actor 允许 AI 助手将任何 [Apify Actor](https://apify.com/store) 作为工具来执行特定任务。例如它可以：
- 使用 [Facebook 帖子抓取器](https://apify.com/apify/facebook-posts-scraper) 从多个页面/个人资料中提取 Facebook 帖子的数据
- 使用 [Google 地图电子邮件提取器](https://apify.com/lukaskrivka/google-maps-with-contact-details) 提取 Google 地图联系信息
- 使用 [Google 搜索结果抓取器](https://apify.com/apify/google-search-scraper) 抓取 Google 搜索引擎结果页 (SERPs)
- 使用 [Instagram 抓取器](https://apify.com/apify/instagram-scraper) 抓取 Instagram 帖子、个人资料、地点、照片和评论
- 使用 [RAG 网页浏览器](https://apify.com/apify/web-scraper) 搜索网络，抓取前 N 个 URL，并返回其内容

# MCP 客户端

要与 Apify MCP 服务器交互，可以使用以下 MCP 客户端：
- [Claude Desktop](https://claude.ai/download)（仅支持 Stdio）
- [LibreChat](https://www.librechat.ai/)（支持 stdio 和 SSE（但尚不支持 Authorization 头））
- [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)（支持带有 Authorization 头的 SSE）
- 其他客户端请访问 [https://modelcontextprotocol.io/clients](https://modelcontextprotocol.io/clients)
- 更多客户端请访问 [https://glama.ai/mcp/clients](https://glama.ai/mcp/clients)

此外，您还可以使用 [examples](https://github.com/apify/actor-mcp-server/tree/main/src/examples) 目录中的简单示例客户端。

当您的 Actors 与 MCP 服务器集成后，您可以询问：
- "搜索网络并总结关于 AI 代理的最新趋势"
- "找到旧金山排名前十的最佳意大利餐厅"
- "查找并分析 The Rock 的 Instagram 个人资料"
- "提供使用 Model Context Protocol 并附带源 URL 的分步指南。"
- "我可以使用哪些 Apify Actors？"

下图展示了 Apify MCP 服务器如何与 Apify 平台和 AI 客户端进行交互：

![Actors-MCP-server](https://raw.githubusercontent.com/apify/actors-mcp-server/refs/heads/master/docs/actors-mcp-server.png)

使用 MCP 测试客户端，您可以动态加载 Actors，但其他 MCP 客户端尚不支持此功能。
我们还计划添加更多功能，详情请参见 [路线图](#-roadmap-march-2025)。

# 🔄 什么是模型上下文协议？

模型上下文协议（MCP）允许 AI 应用程序（和 AI 代理），如 Claude Desktop，连接到外部工具和数据源。
MCP 是一种开放协议，可实现 AI 应用程序、AI 代理与本地或远程资源之间安全可控的交互。

欲了解更多信息，请访问 [模型上下文协议](https://modelcontextprotocol.org/) 网站或博客文章 [什么是 MCP 以及它为什么重要？](https://blog.apify.com/what-is-model-context-protocol/)。

# 🤖 MCP 服务器与 AI 代理有何关系？

Apify MCP 服务器通过 MCP 协议暴露了 Apify 的 Actors，使实现 MCP 协议的 AI 代理或框架能够将所有 Apify Actors 作为数据提取、网络搜索等任务的工具来使用。

要了解更多关于 AI 代理的信息，请探索我们的博客文章：[什么是 AI 代理？](https://blog.apify.com/what-are-ai-agents/) 并浏览 Apify 策划的 [AI 代理集合](https://apify.com/store/collections/ai_agents)。
有兴趣在 Apify 上构建并货币化您自己的 AI 代理吗？请查看我们在 Apify 平台上创建、发布和货币化 AI 代理的 [分步指南](https://blog.apify.com/how-to-build-an-ai-agent/)。

# 🧱 组件

## 工具

### Actors

任何 [Apify Actor](https://apify.com/store) 都可以用作工具。
默认情况下，服务器预配置了以下指定的 Actors，但可以通过提供 Actor 输入来覆盖。

```text
'apify/instagram-scraper'
'apify/rag-web-browser'
'lukaskrivka/google-maps-with-contact-details'
```


MCP 服务器加载 Actor 输入模式，并根据 Actors 创建相应的 MCP 工具。
请参阅 [RAG Web Browser](https://apify.com/apify/rag-web-browser/input-schema) 的输入模式示例。

工具名称必须始终是完整的 Actor 名称，例如 `apify/rag-web-browser`。
MCP 工具的参数代表 Actor 的输入参数。
例如，对于 `apify/rag-web-browser` Actor，其参数为：

```json
{
  "query": "restaurants in San Francisco",
  "maxResults": 3
}
```


您无需指定输入参数或调用哪个 Actor，一切均由 LLM 管理。
当调用工具时，LLM 会自动将参数传递给 Actor。
您可以参考特定 Actor 的文档以获取可用参数列表。

### 辅助工具

服务器提供了一组辅助工具来发现可用的 Actors 并检索它们的详细信息：
- `get-actor-details`：检索特定 Actor 的文档、输入模式及详细信息。
- `discover-actors`：使用关键词搜索相关 Actors 并返回它们的详细信息。

还有一些工具可以管理可用工具列表。然而，动态添加和删除工具需要 MCP 客户端具备更新工具列表的能力（处理 `ToolListChangedNotificationSchema`），这通常是不受支持的。

您可以使用 [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) Actor 来尝试这一功能。
要启用该功能，请设置 `enableActorAutoLoading` 参数。

- `add-actor-as-tool`: 按名称将一个 Actor 添加到可用工具列表中，但不执行它，需要用户同意才能在稍后运行。
- `remove-actor-from-tool`: 当不再需要某个 Actor 时，按名称从可用工具列表中移除。

## 提示与资源

服务器不提供任何资源和提示。
我们计划在未来添加 [Apify 的数据集](https://docs.apify.com/platform/storage/dataset) 和 [键值存储](https://docs.apify.com/platform/storage/key-value-store) 作为资源。

# ⚙️ 使用方法

Apify MCP 服务器可以通过两种方式使用：**作为 Apify 平台上的 Apify Actor** 或作为在您的机器上运行的 **本地服务器**。

## 🇦 MCP 服务器 Actor

### 待机 Web 服务器

Actor 以带有 HTTP Web 服务器的 [**待机模式**](https://docs.apify.com/platform/actors/running/standby) 运行，该服务器接收并处理请求。

使用默认 Actor 启动服务器。要使用一组默认 Actor 来使用 Apify MCP 服务器，请向以下 URL 发送带有 [Apify API 令牌](https://console.apify.com/settings/integrations) 的 HTTP GET 请求。
```
https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>
```
也可以使用不同的 Actor 集合来启动 MCP 服务器。为此，创建一个 [任务](https://docs.apify.com/platform/actors/running/tasks) 并指定您想要使用的 Actor 列表。

然后，在待机模式下使用选定的 Actor 运行任务。
```shell
https://USERNAME--actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>
```

您可以在 [Apify Store](https://apify.com/store) 中找到所有可用 Actor 的列表。

#### 💬 通过 SSE 与 MCP 服务器交互

一旦服务器运行起来，您可以使用 Server-Sent Events (SSE) 与服务器进行交互，发送消息并接收响应。最简单的方法是在 Apify 上使用 [Tester MCP 客户端](https://apify.com/jiri.spilka/tester-mcp-client)。

大多数 MCP 客户端目前（截至 2025 年 3 月）还不支持 SSE，但这可能会改变。[Claude Desktop](https://claude.ai/download) 尚不支持 SEE，但您可以使用 Stdio 传输方式，详情请参阅 [本地主机上的 MCP 服务器](#-mcp-server-at-a-local-host)。

在客户端设置中，您需要提供服务器配置：
```json
{
    "mcpServers": {
        "apify": {
            "type": "sse",
            "url": "https://actors-mcp-server.apify.actor/sse",
            "env": {
                "APIFY_TOKEN": "your-apify-token"
            }
        }
    }
}
```
或者，您可以使用简单的 Python [client_see.py](https://github.com/apify/actor-mcp-server/tree/main/src/examples/client_sse.py) 客户端或使用 `curl` 命令测试服务器。</>

1. 通过向以下URL发送GET请求来启动服务器发送事件（SSE）：
    ```
    curl https://actors-mcp-server.apify.actor/sse?token=<APIFY_TOKEN>
    ```
    服务器将响应一个`sessio…

