Overview
Web scraping and automation platform with 2500+ pre-built scrapers.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-apifyConfiguration
APIFY_API_TOKEN environment variableDocumentation
Apify MCP
Overview
Apify MCP is a Model Context Protocol server that provides access to Apify, a web scraping and automation platform with over 2,500 pre-built scrapers (actors). Apify enables AI agents to extract data from websites, automate browser interactions, and run web scraping jobs at scale.
With pre-built scrapers for popular platforms like Instagram, TikTok, Google Maps, Amazon, and thousands more, Apify MCP lets AI agents leverage battle-tested scrapers without writing custom scraping code.
Features
- 2,500+ Pre-Built Scrapers: Ready-to-use actors for popular websites
- Browser Automation: Headless Chrome/Firefox scraping
- Proxy Rotation: Built-in proxy management for anti-bot bypass
- Queue Management: Handle pagination and link following
- Data Export: JSON, CSV, Excel, and more
- Schedule Jobs: Run scrapers on a schedule
- API Access: Programmatic control of all Apify features
- Scalable Infrastructure: Cloud-based scraping at scale
Installation
npx -y @modelcontextprotocol/server-apify
Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"apify": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-apify"],
"env": {
"APIFY_API_TOKEN": "YOUR_APIFY_API_TOKEN"
}
}
}
}
Getting an Apify API Token
- Go to Apify Console
- Sign up or log in
- Go to Account → API tokens
- Create a new API token
- Add the token to your MCP configuration
Available Tools
| Tool | Description |
|---|---|
run_actor | Run a pre-built scraper (actor) |
get_dataset | Retrieve scraped data from a run |
get_request_queue | Get request queue status |
list_actors | List available pre-built scrapers |
search_actors | Search for actors by keyword |
get_actor_details | Get actor documentation and inputs |
Usage Examples
Run a Pre-Built Scraper
# Run Google Maps scraper
run_result = run_actor(
actor_id="apify/google-maps-scraper",
input={
"searchQueries": ["restaurants in New York", "cafes in San Francisco"],
"maxResults": 50,
}
)
print(f"Run ID: {run_result.run_id}")
print(f"Status: {run_result.status}")
Get Scraped Data
# Get results from a run
dataset = get_dataset(run_id=run_result.run_id)
for item in dataset.items:
print(f"{item.name}: {item.address}")
print(f" Rating: {item.rating}")
print(f" Phone: {item.phone}")
Search for Actors
# Search for Instagram scrapers
actors = search_actors(query="instagram")
for actor in actors:
print(f"{actor.name}: {actor.description}")
print(f" Uses: {actor.usage_count} runs")
Instagram Scraper Example
# Scrape Instagram profile
run_result = run_actor(
actor_id="apify/instagram-scraper",
input={
"startUrls": [{"url": "https://www.instagram.com/nasa/"}],
"profileResults": True,
"postsLimit": 50,
}
)
# Get results
posts = get_dataset(run_id=run_result.run_id)
for post in posts.items:
print(f"Post: {post.shortUrl}")
print(f" Likes: {post.likes}")
print(f" Caption: {post.caption[:100]}...")
E-Commerce Product Scraper
# Scrape Amazon products
run_result = run_actor(
actor_id="apify/amazon-scraper",
input={
"startUrls": [{"url": "https://www.amazon.com/s?k=laptops"}],
"maxItems": 100,
"includeReviews": True,
}
)
# Get and analyze products
products = get_dataset(run_id=run_result.run_id)
avg_price = sum(p.price for p in products.items if p.price) / len([p for p in products.items if p.price])
print(f"Average price: ${avg_price:.2f}")
# Find best rated
best = max(products.items, key=lambda p: p.rating or 0)
print(f"Best rated: {best.title} ({best.rating} stars)")
Batch Scraping
# Scrape multiple websites
websites = [
{"url": "https://example.com/products"},
{"url": "https://example.org/items"},
{"url": "https://example.net/catalog"},
]
for site in websites:
run_result = run_actor(
actor_id="apify/web-scraper",
input={
"startUrls": site,
"selector": ".product",
"extractData": {"title": "h2", "price": ".price"},
}
)
data = get_dataset(run_id=run_result.run_id)
print(f"{site['url']}: {len(data.items)} items found")
Popular Actors
| Actor | Purpose |
|---|---|
google-maps-scraper | Extract business listings from Google Maps |
instagram-scraper | Scrape Instagram profiles and posts |
tiktok-scraper | Scrape TikTok videos and profiles |
amazon-scraper | Extract Amazon product data |
youtube-scraper | Scrape YouTube videos and channels |
web-scraper | Generic website scraper with custom selectors |
serp-scraper | Scrape search engine results |
Pros
- ✅ 2,500+ Pre-Built Scrapers: Ready-to-use for popular sites
- ✅ No Scraping Code: Use battle-tested actors
- ✅ Proxy Management: Built-in proxy rotation
- ✅ Anti-Bot Bypass: Handles CAPTCHAs and bot detection
- ✅ Scalable: Cloud infrastructure for large jobs
- ✅ Multiple Export Formats: JSON, CSV, Excel
- ✅ Scheduling: Run scrapers on a schedule
Cons
- ❌ API Token Required: Need Apify account
- ❌ Cost: Free tier has limits, paid for heavy use
- ❌ Platform Dependency: Tied to Apify infrastructure
- ❌ Rate Limits: API rate limits apply
When to Use
Use Apify MCP when:
- You need to scrape popular websites without custom code
- You need reliable scraping with proxy rotation
- You're scraping at scale (hundreds/thousands of pages)
- You need to bypass anti-bot measures
- You want scheduled recurring scrapes
Avoid Apify MCP when:
- You can write custom scrapers easily
- You're on a tight budget (free tier limits)
- You need to scrape niche websites without pre-built actors
- You need real-time scraping (cloud latency)
