MCP Apify

MCP Apify

Enables AI assistants to interact with the Apify platform to manage actors, monitor runs, and retrieve scraped data from datasets. It supports natural language commands for executing web scrapers, managing tasks, and accessing key-value stores.

Category
访问服务器

README

MCP Apify

Python 3.10+ License: MIT MCP

A Model Context Protocol (MCP) server for the Apify platform. This server enables AI assistants like Claude to interact with your Apify account — managing actors, monitoring runs, retrieving datasets, and more.

Table of Contents

Features

  • Actors — List and inspect actors in your account
  • Runs — Start, monitor, abort, and resurrect actor runs
  • Tasks — Manage and execute saved actor configurations
  • Datasets — Retrieve scraped data and results
  • Key-Value Stores — Access stored records and outputs
  • Schedules — Monitor automated execution schedules

Prerequisites

Installation

Option 1: Install from source

git clone https://github.com/fvegah/mcp-apify.git
cd mcp-apify
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .

Option 2: Install with uv (recommended)

git clone https://github.com/fvegah/mcp-apify.git
cd mcp-apify
uv venv
source .venv/bin/activate
uv pip install -e .

Configuration

Step 1: Set your API token

Add your Apify API token to your shell profile (~/.zshrc, ~/.bashrc, or equivalent):

export APIFY_API_TOKEN="apify_api_xxxxxxxxxxxxxxxxxxxxx"

Reload your shell configuration:

source ~/.zshrc  # or source ~/.bashrc

Step 2: Configure your MCP client

Claude Desktop

Add the following to your Claude Desktop configuration file:

OS Path
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "apify": {
      "command": "/absolute/path/to/mcp-apify/.venv/bin/python",
      "args": ["-m", "mcp_apify.server"]
    }
  }
}

Important: Replace /absolute/path/to/mcp-apify with the actual path where you cloned the repository.

Claude Code (CLI)

Add to your Claude Code MCP settings (~/.claude/settings.json):

{
  "mcpServers": {
    "apify": {
      "command": "/absolute/path/to/mcp-apify/.venv/bin/python",
      "args": ["-m", "mcp_apify.server"]
    }
  }
}

Step 3: Restart your MCP client

After configuration, restart Claude Desktop or Claude Code to load the new MCP server.

Usage

Once configured, you can interact with Apify through natural language. The AI assistant will use the appropriate tools automatically.

Example prompts

"List my recent actor runs"
"Show me the status of run abc123def456"
"Get the results from my last web scraper run"
"Abort the currently running actor"
"Run the apify/web-scraper actor with URL https://example.com"
"Show me all my scheduled tasks"

Available Tools

User Information

Tool Description
get_user_info Get information about the authenticated user

Actors

Tool Description
list_actors List all actors (created or used by user)
get_actor Get details of a specific actor

Runs

Tool Description
list_actor_runs List runs for a specific actor
list_user_runs List all runs across all actors
get_run Get details of a specific run
get_last_run Get the most recent run of an actor
run_actor Start a new actor run with optional input
abort_run Stop a running actor execution
resurrect_run Restart a finished run
get_run_log Retrieve the log output of a run

Tasks

Tool Description
list_tasks List all saved actor tasks
get_task Get task configuration details
run_task Execute a task with optional input override
list_task_runs List runs for a specific task
get_task_last_run Get the most recent task run

Datasets

Tool Description
list_datasets List all datasets
get_dataset Get dataset metadata
get_dataset_items Retrieve items from a dataset
get_run_dataset_items Get items from a run's default dataset

Key-Value Stores

Tool Description
list_key_value_stores List all key-value stores
get_key_value_store Get store metadata
list_keys List keys in a store
get_record Retrieve a specific record
get_run_output Get the OUTPUT record from a run

Schedules

Tool Description
list_schedules List all schedules
get_schedule Get schedule configuration
get_schedule_log Get schedule execution history

Examples

List recent runs with status filter

Ask: "Show me my failed runs from the last week"

The assistant will use list_user_runs with status: "FAILED" to retrieve the information.

Run an actor with custom input

Ask: "Run the web scraper on https://news.ycombinator.com and wait for results"

The assistant will:

  1. Use run_actor with the appropriate input
  2. Use get_run with wait_for_finish to monitor completion
  3. Use get_run_dataset_items to retrieve the results

Monitor a running actor

Ask: "What's the status of my current scraping job?"

The assistant will use list_user_runs with status: "RUNNING" to find active runs.

Development

Project structure

mcp-apify/
├── pyproject.toml              # Package configuration
├── README.md                   # This file
├── .gitignore
└── src/
    └── mcp_apify/
        ├── __init__.py
        ├── client.py           # Apify API client
        └── server.py           # MCP server implementation

Running locally

# Activate virtual environment
source .venv/bin/activate

# Run the server directly (for testing)
python -m mcp_apify.server

Running tests

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

API Reference

This MCP server wraps the Apify API v2. For detailed information about request/response formats and available parameters, refer to the official documentation:

Troubleshooting

"APIFY_API_TOKEN environment variable is required"

Ensure the environment variable is set and exported in your shell profile, then restart your MCP client.

Server not appearing in Claude

  1. Verify the path to the Python executable is correct and absolute
  2. Check that the virtual environment has all dependencies installed
  3. Restart Claude Desktop/Code completely

API errors

Verify your API token is valid at Apify Console.

License

MIT License — see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选