@apify/actors-mcp-server 0.2.15-beta.0 β 0.2.15-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -349
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,83 +1,126 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<a href="https://mcp.apify.com">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/apify_mcp_server_banner_dark.png">
|
|
5
|
+
<img alt="Apify MCP Server" src="docs/apify_mcp_server_banner.png" width="500">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<br>
|
|
9
|
+
<small><a href="https://mcp.apify.com">mcp.apify.com</a></small>
|
|
10
|
+
</h1>
|
|
11
|
+
|
|
12
|
+
<p align=center>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@apify/actors-mcp-server" rel="nofollow"><img src="https://img.shields.io/npm/v/@apify/actors-mcp-server.svg" alt="NPM latest version" data-canonical-src="https://img.shields.io/npm/v/@apify/actors-mcp-server.svg" style="max-width: 100%;"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@apify/actors-mcp-server" rel="nofollow"><img src="https://img.shields.io/npm/dm/@apify/actors-mcp-server.svg" alt="Downloads" data-canonical-src="https://img.shields.io/npm/dm/@apify/actors-mcp-server.svg" style="max-width: 100%;"></a>
|
|
15
|
+
<a href="https://github.com/apify/actors-mcp-server/actions/workflows/check.yaml"><img src="https://github.com/apify/actors-mcp-server/actions/workflows/check.yaml/badge.svg?branch=master" alt="Build Status" style="max-width: 100%;"></a>
|
|
16
|
+
<a href="https://apify.com/apify/actors-mcp-server"><img src="https://apify.com/actor-badge?actor=apify/actors-mcp-server" alt="Actor runs" style="max-width: 100%;"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
The Apify Model Context Protocol (MCP) Server at **mcp.apify.com** instantly connects AI applications and agents to thousands of readyβbuilt tools. It allows your AI assistant to use any [Apify Actor](https://apify.com/store) for web scraping, data extraction, and automation tasks in real time.
|
|
20
|
+
|
|
21
|
+
> **π Try the hosted Apify MCP Server!**
|
|
22
|
+
>
|
|
23
|
+
> For the easiest setup and most powerful features, including the ability to find and use any Actor from Apify Store, connect your AI assistant to our hosted server:
|
|
24
|
+
>
|
|
25
|
+
> **[`https://mcp.apify.com`](https://mcp.apify.com)**
|
|
26
|
+
>
|
|
27
|
+
> It supports OAuth, so you can connect from clients like Claude.ai or Visual Studio Code with just the URL.
|
|
2
28
|
|
|
3
|
-
|
|
29
|
+

|
|
4
30
|
|
|
5
|
-
|
|
6
|
-
|
|
31
|
+
## Table of Contents
|
|
32
|
+
- [π Introducing the Apify MCP server](#-introducing-the-apify-mcp-server)
|
|
33
|
+
- [π Quickstart](#-quickstart)
|
|
34
|
+
- [π€ MCP clients and examples](#-mcp-clients-and-examples)
|
|
35
|
+
- [πͺ Try Apify MCP instantly](#-try-apify-mcp-instantly)
|
|
36
|
+
- [π οΈ Tools, resources, and prompts](#-tools-resources-and-prompts)
|
|
37
|
+
- [π Troubleshooting (local MCP server)](#-troubleshooting-local-mcp-server)
|
|
38
|
+
- [βοΈ Development](#-development)
|
|
39
|
+
- [π€ Contributing](#-contributing)
|
|
40
|
+
- [π Learn more](#-learn-more)
|
|
7
41
|
|
|
8
|
-
|
|
9
|
-
- **π¦ [MCP Server Actor](https://apify.com/apify/actors-mcp-server)** β HTTP server accessible via Server-Sent Events (SSE), see [guide](#-mcp-server-actor)
|
|
10
|
-
- **βΎ MCP Server Stdio** β Local server available via standard input/output (stdio), see [guide](#-mcp-server-at-a-local-host)
|
|
42
|
+
# π Introducing the Apify MCP server
|
|
11
43
|
|
|
12
|
-
|
|
44
|
+
The Apify MCP Server allows an AI assistant to use any [Apify Actor](https://apify.com/store) as a tool to perform a specific task.
|
|
45
|
+
For example, it can:
|
|
46
|
+
- Use [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) to extract data from Facebook posts from multiple pages/profiles.
|
|
47
|
+
- Use [Google Maps Email Extractor](https://apify.com/lukaskrivka/google-maps-with-contact-details) to extract contact details from Google Maps.
|
|
48
|
+
- Use [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) to scrape Google Search Engine Results Pages (SERPs).
|
|
49
|
+
- Use [Instagram Scraper](https://apify.com/apify/instagram-scraper) to scrape Instagram posts, profiles, places, photos, and comments.
|
|
50
|
+
- Use [RAG Web Browser](https://apify.com/apify/web-scraper) to search the web, scrape the top N URLs, and return their content.
|
|
13
51
|
|
|
14
|
-
|
|
52
|
+
**Video tutorial: Integrate 5,000+ Apify Actors and Agents with Claude**
|
|
15
53
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
54
|
+
[](https://www.youtube.com/watch?v=BKu8H91uCTg)
|
|
55
|
+
|
|
56
|
+
# π Quickstart
|
|
57
|
+
|
|
58
|
+
You can use the Apify MCP Server in two ways:
|
|
59
|
+
|
|
60
|
+
**HTTPS Endpoint (mcp.apify.com)**: Connect from your MCP client via OAuth or by including the `Authorization: Bearer <APIFY_TOKEN>` header in your requests. This is the recommended method for most use cases. Because it supports OAuth, you can connect from clients like [Claude.ai](https://claude.ai) or [Visual Studio Code](https://code.visualstudio.com/) using just the URL: `https://mcp.apify.com`.
|
|
61
|
+
- `https://mcp.apify.com` (recommended) for streamable transport
|
|
62
|
+
- `https://mcp.apify.com/sse` for legacy SSE transport
|
|
63
|
+
|
|
64
|
+
**Standard Input/Output (stdio)**: Ideal for local integrations and command-line tools like the Claude for Desktop client.
|
|
65
|
+
- Set the MCP client server command to `npx @apify/actors-mcp-server` and the `APIFY_TOKEN` environment variable to your Apify API token.
|
|
66
|
+
- See `npx @apify/actors-mcp-server --help` for more options.
|
|
67
|
+
|
|
68
|
+
You can find detailed instructions for setting up the MCP server in the [Apify documentation](https://docs.apify.com/platform/integrations/mcp).
|
|
69
|
+
|
|
70
|
+
# π€ MCP clients and examples
|
|
71
|
+
|
|
72
|
+
To interact with the Apify MCP server, you can use various MCP clients, such as:
|
|
73
|
+
- [Claude Desktop](https://claude.ai/download)
|
|
74
|
+
- [Visual Studio Code](https://code.visualstudio.com/)
|
|
75
|
+
- [LibreChat](https://www.librechat.ai/)
|
|
76
|
+
- [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)
|
|
31
77
|
- Other clients at [https://modelcontextprotocol.io/clients](https://modelcontextprotocol.io/clients)
|
|
32
78
|
- More clients at [https://glama.ai/mcp/clients](https://glama.ai/mcp/clients)
|
|
33
79
|
|
|
34
|
-
|
|
35
|
-
- "Search the web and summarize recent trends
|
|
36
|
-
- "Find the top 10
|
|
37
|
-
- "Find and analyze the Instagram profile of The Rock"
|
|
38
|
-
- "Provide a step-by-step guide on using the Model Context Protocol
|
|
80
|
+
With MCP server integrated, you can ask your AI assistant things like:
|
|
81
|
+
- "Search the web and summarize recent trends in AI Agents."
|
|
82
|
+
- "Find the top 10 Italian restaurants in San Francisco."
|
|
83
|
+
- "Find and analyze the Instagram profile of The Rock."
|
|
84
|
+
- "Provide a step-by-step guide on using the Model Context Protocol, including source URLs."
|
|
39
85
|
- "What Apify Actors can I use?"
|
|
40
86
|
|
|
41
|
-
|
|
87
|
+
### Supported Clients Matrix
|
|
42
88
|
|
|
43
|
-
|
|
89
|
+
The following table outlines the tested MCP clients and their level of support for key features.
|
|
44
90
|
|
|
45
|
-
|
|
46
|
-
|
|
91
|
+
| Client | Dynamic Tool Discovery | Notes |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| **Claude.ai (web)** | β
Full | |
|
|
94
|
+
| **Claude Desktop** | π‘ Partial | Tools may need to be reloaded manually in the client. |
|
|
95
|
+
| **VS Code (Genie)** | β
Full | |
|
|
96
|
+
| **LibreChat** | β Untested | |
|
|
97
|
+
| **Apify Tester MCP Client** | β
Full | Designed for testing Apify MCP servers. |
|
|
47
98
|
|
|
48
|
-
|
|
99
|
+
*This matrix is a work in progress. If you have tested other clients, please consider contributing to this documentation.*
|
|
49
100
|
|
|
50
|
-
|
|
51
|
-
MCP is an open protocol that enables secure, controlled interactions between AI applications, AI Agents, and local or remote resources.
|
|
101
|
+
# πͺ Try Apify MCP Instantly
|
|
52
102
|
|
|
53
|
-
|
|
103
|
+
Want to try Apify MCP without any setup?
|
|
54
104
|
|
|
105
|
+
Check out [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)
|
|
55
106
|
|
|
56
|
-
|
|
107
|
+
This interactive, chat-like interface provides an easy way to explore the capabilities of Apify MCP without any local setup.
|
|
108
|
+
Just sign in with your Apify account and start experimenting with web scraping, data extraction, and automation tools!
|
|
57
109
|
|
|
58
|
-
|
|
110
|
+
# π οΈ Tools, resources, and prompts
|
|
59
111
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# π§± Components
|
|
64
|
-
|
|
65
|
-
## Tools
|
|
112
|
+
The MCP server provides a set of tools for interacting with Apify Actors.
|
|
113
|
+
Since the Apify Store is large and growing rapidly, the MCP server provides a way to dynamically discover and use new Actors.
|
|
66
114
|
|
|
67
115
|
### Actors
|
|
68
116
|
|
|
69
117
|
Any [Apify Actor](https://apify.com/store) can be used as a tool.
|
|
70
|
-
By default, the server is pre-configured with
|
|
118
|
+
By default, the server is pre-configured with one Actor, `apify/rag-web-browser`, and several helper tools.
|
|
119
|
+
The MCP server loads an Actor's input schema and creates a corresponding MCP tool.
|
|
120
|
+
This allows the AI agent to know exactly what arguments to pass to the Actor and what to expect in return.
|
|
71
121
|
|
|
72
|
-
```text
|
|
73
|
-
'apify/rag-web-browser'
|
|
74
|
-
```
|
|
75
|
-
The MCP server loads the Actor input schema and creates MCP tools corresponding to the Actors.
|
|
76
|
-
See this example of input schema for the [RAG Web Browser](https://apify.com/apify/rag-web-browser/input-schema).
|
|
77
122
|
|
|
78
|
-
|
|
79
|
-
The arguments for an MCP tool represent the input parameters of the Actor.
|
|
80
|
-
For example, for the `apify/rag-web-browser` Actor, the arguments are:
|
|
123
|
+
For example, for the `apify/rag-web-browser` Actor, the input parameters are:
|
|
81
124
|
|
|
82
125
|
```json
|
|
83
126
|
{
|
|
@@ -85,318 +128,60 @@ For example, for the `apify/rag-web-browser` Actor, the arguments are:
|
|
|
85
128
|
"maxResults": 3
|
|
86
129
|
}
|
|
87
130
|
```
|
|
88
|
-
You don't need to specify
|
|
131
|
+
You don't need to manually specify which Actor to call or its input parameters; the LLM handles this automatically.
|
|
89
132
|
When a tool is called, the arguments are automatically passed to the Actor by the LLM.
|
|
90
133
|
You can refer to the specific Actor's documentation for a list of available arguments.
|
|
91
134
|
|
|
92
135
|
### Helper tools
|
|
93
|
-
One of the powerful features of MCP with Apify is dynamic actor tooling β the ability for an AI agent to find new tools (Actors) as needed and incorporate them. Here are some special MCP operations and how Apify MCP Server supports them:
|
|
94
136
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
One of the most powerful features of using MCP with Apify is dynamic tool discovery.
|
|
138
|
+
It gives an AI agent the ability to find new tools (Actors) as needed and incorporate them.
|
|
139
|
+
Here are some special MCP operations and how the Apify MCP Server supports them:
|
|
140
|
+
|
|
141
|
+
- **Actor discovery and management**: Search for Actors, view their details, and dynamically add or remove them as available tools for the AI.
|
|
142
|
+
- **Apify documentation**: Search the Apify documentation and fetch specific documents to provide context to the AI.
|
|
143
|
+
- **Actor runs (*)**: Get lists of your Actor runs, inspect their details, and retrieve logs.
|
|
144
|
+
- **Apify storage (*)**: Access data from your datasets and key-value stores.
|
|
99
145
|
|
|
100
146
|
**Note**: Helper tool categories marked with (*) are not enabled by default in the MCP server and must be explicitly enabled using the `tools` argument (either the `--tools` command line argument for the stdio server or the `?tools` URL query parameter for the remote MCP server). The `tools` argument is a comma-separated list of categories with the following possible values:
|
|
101
147
|
|
|
102
148
|
- `docs`: Search and fetch Apify documentation tools.
|
|
103
|
-
- `runs`: Get Actor
|
|
149
|
+
- `runs`: Get Actor run lists, run details, and logs from a specific Actor run.
|
|
104
150
|
- `storage`: Access datasets, key-value stores, and their records.
|
|
105
151
|
- `preview`: Experimental tools in preview mode.
|
|
106
152
|
|
|
107
153
|
For example, to enable all tools, use `npx @apify/actors-mcp-server --tools docs,runs,storage,preview` or `https://mcp.apify.com/?tools=docs,runs,storage,preview`.
|
|
108
154
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
The server does not provide any resources and prompts.
|
|
112
|
-
We plan to add [Apify's dataset](https://docs.apify.com/platform/storage/dataset) and [key-value store](https://docs.apify.com/platform/storage/key-value-store) as resources in the future.
|
|
113
|
-
|
|
114
|
-
# βοΈ Usage
|
|
115
|
-
|
|
116
|
-
The Apify MCP Server can be used in two ways: **as an Apify Actor** running on the Apify platform
|
|
117
|
-
or as a **local server** running on your machine.
|
|
118
|
-
|
|
119
|
-
## π¦ MCP Server Actor
|
|
120
|
-
|
|
121
|
-
### Standby web server
|
|
155
|
+
### Prompt & Resources
|
|
122
156
|
|
|
123
|
-
The
|
|
157
|
+
The server does not yet provide any resources or prompts.
|
|
124
158
|
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>
|
|
128
|
-
```
|
|
129
|
-
It is also possible to start the MCP server with a different set of Actors.
|
|
130
|
-
To do this, create a [task](https://docs.apify.com/platform/actors/running/tasks) and specify the list of Actors you want to use.
|
|
131
|
-
|
|
132
|
-
Then, run the task in Standby mode with the selected Actors:
|
|
133
|
-
```shell
|
|
134
|
-
https://USERNAME--actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
You can find a list of all available Actors in the [Apify Store](https://apify.com/store).
|
|
138
|
-
|
|
139
|
-
#### π¬ Interact with the MCP Server over SSE
|
|
140
|
-
|
|
141
|
-
Once the server is running, you can interact with Server-Sent Events (SSE) to send messages to the server and receive responses.
|
|
142
|
-
The easiest way is to use [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) on Apify.
|
|
143
|
-
|
|
144
|
-
[Claude Desktop](https://claude.ai/download) currently lacks SSE support, but you can use it with Stdio transport; see [MCP Server at a local host](#-mcp-server-at-a-local-host) for more details.
|
|
145
|
-
Note: The free version of Claude Desktop may experience intermittent connection issues with the server.
|
|
146
|
-
|
|
147
|
-
In the client settings, you need to provide server configuration:
|
|
148
|
-
```json
|
|
149
|
-
{
|
|
150
|
-
"mcpServers": {
|
|
151
|
-
"apify": {
|
|
152
|
-
"type": "sse",
|
|
153
|
-
"url": "https://actors-mcp-server.apify.actor/sse",
|
|
154
|
-
"env": {
|
|
155
|
-
"APIFY_TOKEN": "your-apify-token"
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## βΎ MCP Server at a local host
|
|
163
|
-
|
|
164
|
-
You can run the Apify MCP Server on your local machine by configuring it with Claude Desktop or any other [MCP client](https://modelcontextprotocol.io/clients).
|
|
165
|
-
You can also use [Smithery](https://smithery.ai/server/@apify/actors-mcp-server) to install the server automatically.
|
|
166
|
-
|
|
167
|
-
### Prerequisites
|
|
168
|
-
|
|
169
|
-
- MacOS or Windows
|
|
170
|
-
- The latest version of Claude Desktop must be installed (or another MCP client)
|
|
171
|
-
- [Node.js](https://nodejs.org/en) (v18 or higher)
|
|
172
|
-
- [Apify API Token](https://docs.apify.com/platform/integrations/api#api-token) (`APIFY_TOKEN`)
|
|
173
|
-
|
|
174
|
-
Make sure you have the `node` and `npx` installed properly:
|
|
175
|
-
```bash
|
|
176
|
-
node -v
|
|
177
|
-
npx -v
|
|
178
|
-
```
|
|
179
|
-
If not, follow this guide to install Node.js: [Downloading and installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
|
|
180
|
-
|
|
181
|
-
#### Claude Desktop
|
|
182
|
-
|
|
183
|
-
To configure Claude Desktop to work with the MCP server, follow these steps. For a detailed guide, refer to the [Claude Desktop Users Guide](https://modelcontextprotocol.io/quickstart/user) or watch the [video tutorial](https://youtu.be/gf5WXeqydUU?t=440).
|
|
184
|
-
|
|
185
|
-
1. Download Claude for desktop
|
|
186
|
-
- Available for Windows and macOS.
|
|
187
|
-
- For Linux users, you can build a Debian package using this [unofficial build script](https://github.com/aaddrick/claude-desktop-debian).
|
|
188
|
-
2. Open the Claude Desktop app and enable **Developer Mode** from the top-left menu bar.
|
|
189
|
-
3. Once enabled, open **Settings** (also from the top-left menu bar) and navigate to the **Developer Option**, where you'll find the **Edit Config** button.
|
|
190
|
-
4. Open the configuration file and edit the following file:
|
|
191
|
-
|
|
192
|
-
- On macOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
|
|
193
|
-
- On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
194
|
-
- On Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"mcpServers": {
|
|
199
|
-
"actors-mcp-server": {
|
|
200
|
-
"command": "npx",
|
|
201
|
-
"args": ["-y", "@apify/actors-mcp-server"],
|
|
202
|
-
"env": {
|
|
203
|
-
"APIFY_TOKEN": "your-apify-token"
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
Alternatively, you can use the `actors` argument to select one or more Apify Actors:
|
|
210
|
-
```json
|
|
211
|
-
{
|
|
212
|
-
"mcpServers": {
|
|
213
|
-
"actors-mcp-server": {
|
|
214
|
-
"command": "npx",
|
|
215
|
-
"args": [
|
|
216
|
-
"-y", "@apify/actors-mcp-server",
|
|
217
|
-
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
|
|
218
|
-
],
|
|
219
|
-
"env": {
|
|
220
|
-
"APIFY_TOKEN": "your-apify-token"
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
```
|
|
226
|
-
5. Restart Claude Desktop
|
|
227
|
-
|
|
228
|
-
- Fully quit Claude Desktop (ensure it's not just minimized or closed).
|
|
229
|
-
- Restart Claude Desktop.
|
|
230
|
-
- Look for the π icon to confirm that the Actors MCP server is connected.
|
|
231
|
-
|
|
232
|
-
6. Open the Claude Desktop chat and ask "What Apify Actors can I use?"
|
|
233
|
-
|
|
234
|
-

|
|
235
|
-
|
|
236
|
-
7. Examples
|
|
237
|
-
|
|
238
|
-
You can ask Claude to perform tasks, such as:
|
|
239
|
-
```text
|
|
240
|
-
Find and analyze recent research papers about LLMs.
|
|
241
|
-
Find the top 10 best Italian restaurants in San Francisco.
|
|
242
|
-
Find and analyze the Instagram profile of The Rock.
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
To understand how to set up and run the MCP server on Claude, you can watch this short video tutorial β· on YouTube:
|
|
246
|
-
|
|
247
|
-
[Apify MCP Server Tutorial: Integrate 5,000+ Apify Actors and Agents Into Claude](https://www.youtube.com/watch?v=UOkJm9pTgMw)
|
|
248
|
-
|
|
249
|
-
#### VS Code
|
|
250
|
-
|
|
251
|
-
For one-click installation, click one of the install buttons below:
|
|
252
|
-
|
|
253
|
-
[](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D) [](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D&quality=insiders)
|
|
254
|
-
|
|
255
|
-
##### Manual installation
|
|
256
|
-
|
|
257
|
-
You can manually install the Apify MCP Server in VS Code. First, click one of the install buttons at the top of this section for a one-click installation.
|
|
258
|
-
|
|
259
|
-
Alternatively, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
|
|
260
|
-
|
|
261
|
-
```json
|
|
262
|
-
{
|
|
263
|
-
"mcp": {
|
|
264
|
-
"inputs": [
|
|
265
|
-
{
|
|
266
|
-
"type": "promptString",
|
|
267
|
-
"id": "apify_token",
|
|
268
|
-
"description": "Apify API Token",
|
|
269
|
-
"password": true
|
|
270
|
-
}
|
|
271
|
-
],
|
|
272
|
-
"servers": {
|
|
273
|
-
"actors-mcp-server": {
|
|
274
|
-
"command": "npx",
|
|
275
|
-
"args": ["-y", "@apify/actors-mcp-server"],
|
|
276
|
-
"env": {
|
|
277
|
-
"APIFY_TOKEN": "${input:apify_token}"
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace - just omit the top-level `mcp {}` key. This will allow you to share the configuration with others.
|
|
286
|
-
|
|
287
|
-
If you want to specify which Actors to load, you can add the `--actors` argument:
|
|
288
|
-
|
|
289
|
-
```json
|
|
290
|
-
{
|
|
291
|
-
"servers": {
|
|
292
|
-
"actors-mcp-server": {
|
|
293
|
-
"command": "npx",
|
|
294
|
-
"args": [
|
|
295
|
-
"-y", "@apify/actors-mcp-server",
|
|
296
|
-
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
|
|
297
|
-
],
|
|
298
|
-
"env": {
|
|
299
|
-
"APIFY_TOKEN": "${input:apify_token}"
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
#### VS Code
|
|
307
|
-
|
|
308
|
-
For one-click installation, click one of the install buttons below:
|
|
309
|
-
|
|
310
|
-
[](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D) [](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D&quality=insiders)
|
|
311
|
-
|
|
312
|
-
##### Manual installation
|
|
313
|
-
|
|
314
|
-
You can manually install the Apify MCP Server in VS Code. First, click one of the install buttons at the top of this section for a one-click installation.
|
|
315
|
-
|
|
316
|
-
Alternatively, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
|
|
317
|
-
|
|
318
|
-
```json
|
|
319
|
-
{
|
|
320
|
-
"mcp": {
|
|
321
|
-
"inputs": [
|
|
322
|
-
{
|
|
323
|
-
"type": "promptString",
|
|
324
|
-
"id": "apify_token",
|
|
325
|
-
"description": "Apify API Token",
|
|
326
|
-
"password": true
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
"servers": {
|
|
330
|
-
"actors-mcp-server": {
|
|
331
|
-
"command": "npx",
|
|
332
|
-
"args": ["-y", "@apify/actors-mcp-server"],
|
|
333
|
-
"env": {
|
|
334
|
-
"APIFY_TOKEN": "${input:apify_token}"
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace - just omit the top-level `mcp {}` key. This will allow you to share the configuration with others.
|
|
343
|
-
|
|
344
|
-
If you want to specify which Actors to load, you can add the `--actors` argument:
|
|
345
|
-
|
|
346
|
-
```json
|
|
347
|
-
{
|
|
348
|
-
"servers": {
|
|
349
|
-
"actors-mcp-server": {
|
|
350
|
-
"command": "npx",
|
|
351
|
-
"args": [
|
|
352
|
-
"-y", "@apify/actors-mcp-server",
|
|
353
|
-
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
|
|
354
|
-
],
|
|
355
|
-
"env": {
|
|
356
|
-
"APIFY_TOKEN": "${input:apify_token}"
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
#### Debugging NPM package @apify/actors-mcp-server with @modelcontextprotocol/inspector
|
|
159
|
+
### Debugging the NPM package
|
|
364
160
|
|
|
365
161
|
To debug the server, use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) tool:
|
|
366
162
|
|
|
367
163
|
```shell
|
|
368
|
-
export APIFY_TOKEN=your-apify-token
|
|
164
|
+
export APIFY_TOKEN="your-apify-token"
|
|
369
165
|
npx @modelcontextprotocol/inspector npx -y @apify/actors-mcp-server
|
|
370
166
|
```
|
|
371
167
|
|
|
372
|
-
#
|
|
168
|
+
# βοΈ Development
|
|
373
169
|
|
|
374
170
|
## Prerequisites
|
|
375
171
|
|
|
376
172
|
- [Node.js](https://nodejs.org/en) (v18 or higher)
|
|
377
|
-
- Python 3.9 or higher
|
|
378
173
|
|
|
379
|
-
Create an environment file `.env
|
|
174
|
+
Create an environment file, `.env`, with the following content:
|
|
380
175
|
```text
|
|
381
|
-
APIFY_TOKEN=your-apify-token
|
|
176
|
+
APIFY_TOKEN="your-apify-token"
|
|
382
177
|
```
|
|
383
178
|
|
|
384
|
-
Build the actor-mcp-server package:
|
|
179
|
+
Build the `actor-mcp-server` package:
|
|
385
180
|
|
|
386
181
|
```bash
|
|
387
182
|
npm run build
|
|
388
183
|
```
|
|
389
184
|
|
|
390
|
-
## Local client (SSE)
|
|
391
|
-
|
|
392
|
-
To test the server with the SSE transport, you can use the script `examples/clientSse.ts`:
|
|
393
|
-
Currently, the Node.js client does not support establishing a connection to a remote server with custom headers.
|
|
394
|
-
You need to change the URL to your local server URL in the script.
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
node dist/examples/clientSse.js
|
|
398
|
-
```
|
|
399
|
-
|
|
400
185
|
## Debugging
|
|
401
186
|
|
|
402
187
|
Since MCP servers operate over standard input/output (stdio), debugging can be challenging.
|
|
@@ -405,37 +190,39 @@ For the best debugging experience, use the [MCP Inspector](https://github.com/mo
|
|
|
405
190
|
You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:
|
|
406
191
|
|
|
407
192
|
```bash
|
|
408
|
-
export APIFY_TOKEN=your-apify-token
|
|
193
|
+
export APIFY_TOKEN="your-apify-token"
|
|
409
194
|
npx @modelcontextprotocol/inspector node ./dist/stdio.js
|
|
410
195
|
```
|
|
411
196
|
|
|
412
|
-
Upon launching, the Inspector will display a URL that you can
|
|
197
|
+
Upon launching, the Inspector will display a URL that you can open in your browser to begin debugging.
|
|
198
|
+
|
|
199
|
+
# π Troubleshooting (local MCP server)
|
|
200
|
+
|
|
201
|
+
- Make sure you have `node` installed by running `node -v`.
|
|
202
|
+
- Make sure the `APIFY_TOKEN` environment variable is set.
|
|
203
|
+
- Always use the latest version of the MCP server by using `@apify/actors-mcp-server@latest`.
|
|
413
204
|
|
|
414
|
-
##
|
|
205
|
+
## π‘ Limitations
|
|
415
206
|
|
|
416
207
|
The Actor input schema is processed to be compatible with most MCP clients while adhering to [JSON Schema](https://json-schema.org/) standards. The processing includes:
|
|
417
208
|
- **Descriptions** are truncated to 500 characters (as defined in `MAX_DESCRIPTION_LENGTH`).
|
|
418
209
|
- **Enum fields** are truncated to a maximum combined length of 200 characters for all elements (as defined in `ACTOR_ENUM_MAX_LENGTH`).
|
|
419
|
-
- **Required fields** are explicitly marked with a
|
|
420
|
-
- **Nested properties** are built for special cases like proxy configuration and request list sources to ensure correct input structure.
|
|
210
|
+
- **Required fields** are explicitly marked with a `REQUIRED` prefix in their descriptions for compatibility with frameworks that may not handle the JSON schema properly.
|
|
211
|
+
- **Nested properties** are built for special cases like proxy configuration and request list sources to ensure the correct input structure.
|
|
421
212
|
- **Array item types** are inferred when not explicitly defined in the schema, using a priority order: explicit type in items > prefill type > default value type > editor type.
|
|
422
|
-
- **Enum values and examples** are added to property descriptions to ensure visibility even if the client doesn't fully support JSON schema.
|
|
423
|
-
|
|
424
|
-
Memory for each Actor is limited to 4GB.
|
|
425
|
-
Free users have an 8GB limit, 128MB needs to be allocated for running `Actors-MCP-Server`.
|
|
426
|
-
|
|
427
|
-
If you need other features or have any feedback, [submit an issue](https://console.apify.com/actors/1lSvMAaRcadrM1Vgv/issues) in Apify Console to let us know.
|
|
213
|
+
- **Enum values and examples** are added to property descriptions to ensure visibility, even if the client doesn't fully support the JSON schema.
|
|
214
|
+
- **Rental Actors** are only available for use with the hosted MCP server at https://mcp.apify.com. When running the server locally via stdio, you can only access Actors that are already added to your local toolset. To dynamically search for and use any Actor from the Apify Storeβincluding rental Actorsβconnect to the hosted endpoint.
|
|
428
215
|
|
|
429
|
-
#
|
|
216
|
+
# π€ Contributing
|
|
430
217
|
|
|
431
|
-
|
|
432
|
-
- Add tools such as Actor logs and Actor runs for debugging.
|
|
218
|
+
We welcome contributions to improve the Apify MCP Server! Here's how you can help:
|
|
433
219
|
|
|
434
|
-
|
|
220
|
+
- **π Report issues**: Find a bug or have a feature request? [Open an issue](https://github.com/apify/actors-mcp-server/issues).
|
|
221
|
+
- **π§ Submit pull requests**: Fork the repo and submit pull requests with enhancements or fixes.
|
|
222
|
+
- **π Documentation**: Improvements to docs and examples are always welcome.
|
|
223
|
+
- **π‘ Share use cases**: Contribute examples to help other users.
|
|
435
224
|
|
|
436
|
-
|
|
437
|
-
- Make sure you have the `APIFY_TOKEN` environment variable set
|
|
438
|
-
- Always use the latest version of the MCP server by setting `@apify/actors-mcp-server@latest`
|
|
225
|
+
For major changes, please open an issue first to discuss your proposal and ensure it aligns with the project's goals.
|
|
439
226
|
|
|
440
227
|
# π Learn more
|
|
441
228
|
|
|
@@ -444,6 +231,6 @@ If you need other features or have any feedback, [submit an issue](https://conso
|
|
|
444
231
|
- [What is MCP and why does it matter?](https://blog.apify.com/what-is-model-context-protocol/)
|
|
445
232
|
- [How to use MCP with Apify Actors](https://blog.apify.com/how-to-use-mcp/)
|
|
446
233
|
- [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)
|
|
447
|
-
- [
|
|
234
|
+
- [Webinar: Building and Monetizing MCP Servers on Apify](https://www.youtube.com/watch?v=w3AH3jIrXXo)
|
|
448
235
|
- [MCP Client development guide](https://github.com/cyanheads/model-context-protocol-resources/blob/main/guides/mcp-client-development-guide.md)
|
|
449
236
|
- [How to build and monetize an AI agent on Apify](https://blog.apify.com/how-to-build-an-ai-agent/)
|