actors-mcp-server

Official

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Integrates with Facebook through the Facebook Posts Scraper Actor to extract data from Facebook posts from multiple pages/profiles.

  • Integrates with Google Search through the Google Search Results Scraper to scrape Google Search Engine Results Pages (SERPs).

  • Integrates with Google Maps through the Google Maps Email Extractor Actor to extract contact details from Google Maps listings.

Apify Model Context Protocol (MCP) Server

Implementation of an MCP server for all Apify Actors. This server enables interaction with one or more Apify Actors that can be defined in the MCP Server configuration.

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 💬 Tester MCP Client

🎯 What does Apify MCP server do?

The MCP Server Actor allows an AI assistant to use any Apify Actor as a tool to perform a specific task. For example, it can:

MCP Clients

To interact with the Apify MCP server, you can use MCP clients such as:

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.

🔄 What is the Model Context Protocol?

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 Model Context Protocol website or the blog post What is MCP and why does it matter?.

🤖 How is MCP Server related to AI Agents?

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: What are AI Agents? and browse Apify's curated AI Agent collection. 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.

🧱 Components

Tools

Actors

Any Apify Actor can be used as a tool. By default, the server is pre-configured with the Actors specified below, but this can be overridden by providing Actor input.

'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 RAG Web Browser.

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.

Helper tools

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 Apify Tester MCP Client Actor. To enable it, set 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.

Prompt & Resources

The server does not provide any resources and prompts. We plan to add Apify's dataset and key-value store as resources in the future.

⚙️ Usage

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.

🇦 MCP Server Actor

Standby web server

The Actor runs in Standby mode with an HTTP web server that receives and processes requests.

To start the server with default Actors, send an HTTP GET request with your Apify API token to the following URL:

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 task and specify the list of Actors you want to use.

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 Apify Store.

💬 Interact with the MCP Server over SSE

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 Tester MCP Client on Apify.

Claude Desktop currently lacks SSE support, but you can use it with Stdio transport; see MCP Server at a local host for more details. Note: The free version of Claude Desktop may experience intermittent connection issues with the server.

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.

  1. 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
  2. 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
  3. 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+\"...}}]}}

⾕ MCP Server at a local host

You can run the Apify MCP Server on your local machine by configuring it with Claude Desktop or any other MCP client. You can also use Smithery to install the server automatically.

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)

Make sure you have the node and npx installed properly:

node -v npx -v

If not, follow this guide to install Node.js: Downloading and installing Node.js and npm.

Claude Desktop

To configure Claude Desktop to work with the MCP server, follow these steps. For a detailed guide, refer to the Claude Desktop Users Guide.

  1. Download Claude for desktop
    • Available for Windows and macOS.
    • For Linux users, you can build a Debian package using this unofficial build script.
  2. Open the Claude Desktop app and enable Developer Mode from the top-left menu bar.
  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.
  4. 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" } } } }
  5. 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.
  6. Open the Claude Desktop chat and ask "What Apify Actors can I use?"
  7. ExamplesYou 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.

VS Code

For one-click installation, click one of the install buttons below:

Manual installation

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}" } } } }

VS Code

For one-click installation, click one of the install buttons below:

Manual installation

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}" } } } }

Debugging NPM package @apify/actors-mcp-server with @modelcontextprotocol/inspector

To debug the server, use the MCP Inspector tool:

export APIFY_TOKEN=your-apify-token npx @modelcontextprotocol/inspector npx -y @apify/actors-mcp-server

Installing via Smithery

To install Apify Actors MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @apify/actors-mcp-server --client claude

Stdio clients

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 the apify/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

👷🏼 Development

Prerequisites

  • 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

Local client (SSE)

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

Debugging

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.

ⓘ Limitations and feedback

The Actor input schema is processed to be compatible with most MCP clients while adhering to JSON Schema standards. The processing includes:

  • 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, submit an issue in Apify Console to let us know.

🚀 Roadmap (March 2025)

  • Add Apify's dataset and key-value store as resources.
  • Add tools such as Actor logs and Actor runs for debugging.

🐛 Troubleshooting

  • Make sure you have the node installed by running node -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

📚 Learn more

ID: 0sr3j8xoat