MCP HubMCP Hub
apify

actors-mcp-server

by: apify

Model Context Protocol (MCP) Server for Apify's Actors

97created 02/01/2025
Visit
Apify
Protocol

📌Overview

Purpose: To provide a server framework that enables interaction with Apify Actors for AI applications and agents via the Model Context Protocol (MCP).

Overview: The Apify Model Context Protocol (MCP) Server offers a versatile environment for AI assistants to utilize various Apify Actors for tasks like web scraping and data extraction. It provides two operational modes: a hosted HTTP server and a local standard input/output (stdio) server. The MCP's structured interface allows for effective communication and task execution through integrated AI clients.

Key Features:

  • MCP Server Actor: An HTTP server enabling interaction through Server-Sent Events (SSE), facilitating real-time communication with AI assistants.

  • Dynamic Actor Integration: Supports various Apify Actors, allowing users to perform specialized tasks without needing to manage inputs or call details directly. Users can request data from configurable Actors such as scrapers for social media, search engines, and business directories.


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 defined in the MCP Server configuration.

Usage

The server can be used in two ways:

  • MCP Server Actor: HTTP server accessible via Server-Sent Events (SSE).
  • MCP Server Stdio: Local server available via standard input/output (stdio).

The MCP Server Actor allows an AI assistant to use any Apify Actor as a tool to perform specific tasks, such as:

  • Extracting data from Facebook posts using the Facebook Posts Scraper.
  • Extracting Google Maps contact details using the Google Maps Email Extractor.
  • Scraping Google Search Engine Results Pages using the Google Search Results Scraper.
  • Scraping Instagram posts, profiles, and comments using the Instagram Scraper.

MCP Clients

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

Usage Examples

You can ask:

  • "Search web and summarize recent trends about AI Agents"
  • "Find top 10 best Italian restaurants in San Francisco"

What is the Model Context Protocol?

The Model Context Protocol (MCP) allows AI applications to connect to external tools and data sources, enabling secure, controlled interactions.

Components

Tools

Actors

Any Apify Actor can be used as a tool. The MCP server can be pre-configured with specified Actors or customized by the user.

Helper Tools

The server provides tools for discovering available Actors and retrieving their details:

  • get-actor-details: Retrieves documentation and details about a specific Actor.
  • discover-actors: Searches for relevant Actors using keywords.

Usage of MCP Server

MCP Server Actor

Start server with default Actors by sending an HTTP GET request to:

https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>

Local MCP Server

Run the MCP Server on your local machine by configuring it with an MCP client. Ensure you have Node.js and the Apify API Token.

Installation

  1. Clone the repository:
    git clone git@github.com:apify/actor-mcp-server.git
    
  2. Navigate to the directory and install dependencies:
    cd actor-mcp-server
    npm install
    npm run build
    

Development

Prerequisites

  • Node.js (v18 or higher)
  • Python 3.9 or higher

Debugging

For best practices, use the MCP Inspector.

Limitations and Feedback

  • Context size limits and memory restrictions apply.
  • Submit any issues or feedback through the Apify Console.

Roadmap (March 2025)

  • Add Apify's dataset and key-value store as resources.

Learn More