Implementation of an MCP server for all
The server can be used in two ways:
- π¦
MCP Server Actor β HTTP server accessible via Server-Sent Events (SSE), see guide - βΎ MCP Server Stdio β Local server available via standard input/output (stdio), see guide
You can also interact with the MCP server using a chat-like UI with π¬
The MCP Server Actor allows an AI assistant to use any
- Use
Facebook Posts Scraper to extract data from Facebook posts from multiple pages/profiles - Use
Google Maps Email Extractor to extract Google Maps contact details - Use
Google Search Results Scraper to scrape Google Search Engine Results Pages (SERPs) - Use
Instagram Scraper to scrape Instagram posts, profiles, places, photos, and comments - Use
RAG Web Browser to search the web, scrape the top N URLs, and return their content
To interact with the Apify MCP server, you can use MCP clients such as:
Claude Desktop (only Stdio support) Visual Studio Code (Stdio and SSE support) LibreChat (Stdio and SSE support, yet without Authorization header) Apify Tester MCP Client (SSE support with Authorization headers) - Other clients at
https://modelcontextprotocol.io/clients - More clients at
https://glama.ai/mcp/clients
When you have Actors integrated with the MCP server, you can ask:
- "Search the web and summarize recent trends about AI Agents"
- "Find the top 10 best Italian restaurants in San Francisco"
- "Find and analyze the Instagram profile of The Rock"
- "Provide a step-by-step guide on using the Model Context Protocol with source URLs"
- "What Apify Actors can I use?"
The following image shows how the Apify MCP server interacts with the Apify platform and AI clients:
With the MCP Tester client you can load Actors dynamically but this is not yet supported by other MCP clients. We also plan to add more features, see Roadmap for more details.
The Model Context Protocol (MCP) allows AI applications (and AI agents), such as Claude Desktop, to connect to external tools and data sources. MCP is an open protocol that enables secure, controlled interactions between AI applications, AI Agents, and local or remote resources.
For more information, see the
The Apify MCP Server exposes Apify's Actors through the MCP protocol, allowing AI Agents or frameworks that implement the MCP protocol to access all Apify Actors as tools for data extraction, web searching, and other tasks.
To learn more about AI Agents, explore our blog post:
Any
'apify/instagram-scraper'
'apify/rag-web-browser'
'lukaskrivka/google-maps-with-contact-details'
The MCP server loads the Actor input schema and creates MCP tools corresponding to the Actors.
See this example of input schema for the
The tool name must always be the full Actor name, such as apify/rag-web-browser
.
The arguments for an MCP tool represent the input parameters of the Actor.
For example, for the apify/rag-web-browser
Actor, the arguments are:
{
"query": "restaurants in San Francisco",
"maxResults": 3
}
You don't need to specify the input parameters or which Actor to call; everything is managed by an LLM. When a tool is called, the arguments are automatically passed to the Actor by the LLM. You can refer to the specific Actor's documentation for a list of available arguments.
The server provides a set of helper tools to discover available Actors and retrieve their details:
get-actor-details
: Retrieves documentation, input schema, and details about a specific Actor.discover-actors
: Searches for relevant Actors using keywords and returns their details.
There are also tools to manage the available tools list. However, dynamically adding and removing tools requires the MCP client to have the capability to update the tools list (handle ToolListChangedNotificationSchema
), which is typically not supported.
You can try this functionality using the enableActorAutoLoading
parameter.
add-actor-as-tool
: Adds an Actor by name to the available tools list without executing it, requiring user consent to run later.remove-actor-from-tool
: Removes an Actor by name from the available tools list when it's no longer needed.
The server does not provide any resources and prompts.
We plan to add
The Apify MCP Server can be used in two ways: as an Apify Actor running on the Apify platform or as a local server running on your machine.
The Actor runs in
To start the server with default Actors, send an HTTP GET request with your
https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>
It is also possible to start the MCP server with a different set of Actors.
To do this, create a
Then, run the task in Standby mode with the selected Actors:
https://USERNAME--actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>
You can find a list of all available Actors in the
Once the server is running, you can interact with Server-Sent Events (SSE) to send messages to the server and receive responses.
The easiest way is to use
In the client settings, you need to provide server configuration:
{
"mcpServers": {
"apify": {
"type": "sse",
"url": "https://actors-mcp-server.apify.actor/sse",
"env": {
"APIFY_TOKEN": "your-apify-token"
}
}
}
}
Alternatively, you can use clientSse.ts script or test the server using curl
</> commands.
-
Initiate Server-Sent-Events (SSE) by sending a GET request to the following URL:
curl https://actors-mcp-server.apify.actor/sse?token=<APIFY_TOKEN>
The server will respond with a
sessionId
, which you can use to send messages to the server:event: endpoint data: /message?sessionId=a1b
-
Send a message to the server by making a POST request with the
sessionId
:curl -X POST "https://actors-mcp-server.apify.actor/message?token=<APIFY_TOKEN>&session_id=a1b" -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "arguments": { "searchStringsArray": ["restaurants in San Francisco"], "maxCrawledPlacesPerSearch": 3 }, "name": "lukaskrivka/google-maps-with-contact-details" } }'
The MCP server will start the Actor
lukaskrivka/google-maps-with-contact-details
with the provided arguments as input parameters. For this POST request, the server will respond with:Accepted
-
Receive the response. The server will invoke the specified Actor as a tool using the provided query parameters and stream the response back to the client via SSE. The response will be returned as JSON text.
event: message data: {"result":{"content":[{"type":"text","text":"{\"searchString\":\"restaurants in San Francisco\",\"rank\":1,\"title\":\"Gary Danko\",\"description\":\"Renowned chef Gary Danko's fixed-price menus of American cuisine ... \",\"price\":\"$100+\"...}}]}}
You can run the Apify MCP Server on your local machine by configuring it with Claude Desktop or any other
- 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
)
Make sure you have the node
and npx
installed properly:
node -v
npx -v
If not, follow this guide to install Node.js:
To configure Claude Desktop to work with the MCP server, follow these steps. For a detailed guide, refer to the
-
Download Claude for desktop
- Available for Windows and macOS.
- For Linux users, you can build a Debian package using this unofficial build script.
-
Open the Claude Desktop app and enable Developer Mode from the top-left menu bar.
-
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.
-
Open the configuration file and edit the following file:
- On macOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
- On Linux:
~/.config/Claude/claude_desktop_config.json
{ "mcpServers": { "actors-mcp-server": { "command": "npx", "args": ["-y", "@apify/actors-mcp-server"], "env": { "APIFY_TOKEN": "your-apify-token" } } } }
Alternatively, you can use the
actors
argument to select one or more Apify Actors:{ "mcpServers": { "actors-mcp-server": { "command": "npx", "args": [ "-y", "@apify/actors-mcp-server", "--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper" ], "env": { "APIFY_TOKEN": "your-apify-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 Actors MCP server is connected.
-
Open the Claude Desktop chat and ask "What Apify Actors can I use?"
-
Examples
You can ask Claude to perform tasks, such as:
Find and analyze recent research papers about LLMs. Find the top 10 best Italian restaurants in San Francisco. Find and analyze the Instagram profile of The Rock.
For one-click installation, click one of the install buttons below:
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.
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)
.
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "apify_token",
"description": "Apify API Token",
"password": true
}
],
"servers": {
"actors-mcp-server": {
"command": "npx",
"args": ["-y", "@apify/actors-mcp-server"],
"env": {
"APIFY_TOKEN": "${input:apify_token}"
}
}
}
}
}
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.
If you want to specify which Actors to load, you can add the --actors
argument:
{
"servers": {
"actors-mcp-server": {
"command": "npx",
"args": [
"-y", "@apify/actors-mcp-server",
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
],
"env": {
"APIFY_TOKEN": "${input:apify_token}"
}
}
}
}
For one-click installation, click one of the install buttons below:
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.
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)
.
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "apify_token",
"description": "Apify API Token",
"password": true
}
],
"servers": {
"actors-mcp-server": {
"command": "npx",
"args": ["-y", "@apify/actors-mcp-server"],
"env": {
"APIFY_TOKEN": "${input:apify_token}"
}
}
}
}
}
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.
If you want to specify which Actors to load, you can add the --actors
argument:
{
"servers": {
"actors-mcp-server": {
"command": "npx",
"args": [
"-y", "@apify/actors-mcp-server",
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
],
"env": {
"APIFY_TOKEN": "${input:apify_token}"
}
}
}
}
To debug the server, use the MCP Inspector tool:
export APIFY_TOKEN=your-apify-token
npx @modelcontextprotocol/inspector npx -y @apify/actors-mcp-server
To install Apify Actors MCP Server for Claude Desktop automatically via
npx -y @smithery/cli install @apify/actors-mcp-server --client claude
Create an environment file .env
with the following content:
APIFY_TOKEN=your-apify-token
In the examples
directory, you can find an example client to interact with the server via
standard input/output (stdio):
clientStdio.ts
This client script starts the MCP server with two specified Actors. It then calls theapify/rag-web-browser
tool with a query and prints the result. It demonstrates how to connect to the MCP server, list available tools, and call a specific tool using stdio transport.node dist/examples/clientStdio.js
Node.js (v18 or higher) - Python 3.9 or higher
Create an environment file .env
with the following content:
APIFY_TOKEN=your-apify-token
Build the actor-mcp-server package:
npm run build
To test the server with the SSE transport, you can use the script examples/clientSse.ts
:
Currently, the Node.js client does not support establishing a connection to a remote server with custom headers.
You need to change the URL to your local server URL in the script.
node dist/examples/clientSse.js
Since MCP servers operate over standard input/output (stdio), debugging can be challenging. For the best debugging experience, use the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
export APIFY_TOKEN=your-apify-token
npx @modelcontextprotocol/inspector node ./dist/stdio.js
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
The Actor input schema is processed to be compatible with most MCP clients while adhering to
- Descriptions are truncated to 500 characters (as defined in
MAX_DESCRIPTION_LENGTH
). - Enum fields are truncated to a maximum combined length of 200 characters for all elements (as defined in
ACTOR_ENUM_MAX_LENGTH
). - Required fields are explicitly marked with a "REQUIRED" prefix in their descriptions for compatibility with frameworks that may not handle JSON schema properly.
- Nested properties are built for special cases like proxy configuration and request list sources to ensure correct input structure.
- 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.
- Enum values and examples are added to property descriptions to ensure visibility even if the client doesn't fully support JSON schema.
Memory for each Actor is limited to 4GB.
Free users have an 8GB limit, 128MB needs to be allocated for running Actors-MCP-Server
.
If you need other features or have any feedback,
- Add Apify's dataset and key-value store as resources.
- Add tools such as Actor logs and Actor runs for debugging.
- Make sure you have the
node
installed by runningnode -v
- Make sure you have the
APIFY_TOKEN
environment variable set - Always use the latest version of the MCP server by setting
@apify/actors-mcp-server@latest
Model Context Protocol What are AI Agents? What is MCP and why does it matter? How to use MCP with Apify Actors Tester MCP Client AI agent workflow: building an agent to query Apify datasets - MCP Client development guide
How to build and monetize an AI agent on Apify