# actors-mcp-server

> MCP Server

This repository implements an MCP server for Apify Actors, enabling AI assistants to use them as tools for tasks like data extraction and web scraping via HTTP or standard input/output.

## Overview

- **Category:** AI
- **Language:** TypeScript
- **Stars:** 3778
- **Forks:** 8
- **Owner:** apify
- **GitHub:** https://github.com/apify/actors-mcp-server
- **Homepage:** https://apify.com/apify/actors-mcp-server
- **Created:** 2025-01-02T15:43:09+00:00
- **Updated:** 2025-03-28T23:45:16+00:00
- **Source:** https://model-context-protocol.com/servers/apify-actors-model-context-protocol-server

## Setup

## Setup

**MCP Server Actor (via Apify platform):**

1.  Start server with default Actors by sending an HTTP GET request with your Apify API token to `https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>`. 
2.  Alternatively, create a task with a specific list of Actors and run it in Standby mode using a URL like `https://USERNAME--actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>`. 
3.  Interact with the server over SSE using the Tester MCP Client or `curl` commands.
4.  For SSE interaction, initiate SSE with `curl https://actors-mcp-server.apify.actor/sse?token=<APIFY_TOKEN>` and send messages with `curl -X POST "https://actors-mcp-server.apify.actor/message?token=<APIFY_TOKEN>&session_id=a1b" -H "Content-Type: application/json" -d '{...}'`.

**MCP Server at a local host:**

1.  Prerequisites: MacOS or Windows, Claude Desktop (or another MCP client), Node.js (v18+), Apify API Token (`APIFY_TOKEN`).
2.  Configure Claude Desktop: Enable Developer Mode, edit the configuration file (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%/Claude/claude_desktop_config.json` on Windows), and add the `mcpServers` configuration.
3.  Example `mcpServers` configuration:

    ```json
    {
     "mcpServers": {
       "actors-mcp-server": {
         "command": "npx",
         "args": ["-y", "@apify/actors-mcp-server"],
         "env": {
            "APIFY_TOKEN": "your-apify-token"
         }
       }
     }
    }
    ```
4.  Restart Claude Desktop and verify the connection with the ð icon.
5.  Alternatively, install via Smithery: `npx -y @smithery/cli install @apify/actors-mcp-server --client claude`.
6.  For Stdio clients, create a `.env` file with `APIFY_TOKEN` and optionally `ANTHROPIC_API_KEY`.
7.  Run `clientStdio.ts` or `clientStdioChat.ts` from the `examples` directory using `node dist/examples/clientStdio.js` or `node dist/examples/clientStdioChat.js`.
8.  Debugging: Use the MCP Inspector with `export APIFY_TOKEN=your-apify-token` and `npx @modelcontextprotocol/inspector node ./dist/index.js`.


## Tools

## Available Tools

1.  **Apify Actors** (Any Apify Actor can be used as a tool, pre-configured with `apify/instagram-scraper`, `apify/rag-web-browser`, and `lukaskrivka/google-maps-with-contact-details` by default).
2.  **`get-actor-details`** (Retrieves documentation, input schema, and details about a specific Actor).
3.  **`discover-actors`** (Searches for relevant Actors using keywords and returns their details).
4.  **`add-actor-as-tool`** (Adds an Actor by name to the available tools list without executing it).
5.  **`remove-actor-from-tool`** (Removes an Actor by name from the available tools list when it's no longer needed).

