The Apify Model Context Protocol (MCP) Server enables AI assistants to utilize Apify Actors as tools for specific tasks like web scraping, data extraction, and search. It works as both an HTTP server using Server-Sent Events (SSE) and a local server via standard input/output (stdio).
To use the pre-configured server on the Apify platform:
Access the server with your Apify API token:
https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>
For custom Actor configuration, create an Apify task and specify your Actor selection:
https://USERNAME--actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>
Clone the repository:
git clone [email protected]:apify/actor-mcp-server.git
Install dependencies:
cd actor-mcp-server
npm install
Build the project:
npm run build
Download and install Claude Desktop
Enable Developer Mode from the menu bar
Open Settings > Developer Option > Edit Config
Edit the configuration file:
{
"mcpServers": {
"actors-mcp-server": {
"command": "npx",
"args": ["-y", "@apify/actors-mcp-server"],
"env": {
"APIFY_TOKEN": "your-apify-token"
}
}
}
}
Alternatively, specify specific 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"
}
}
}
}
Restart Claude Desktop
Check for the 🔌 icon to confirm connection
You can also use Smithery for automatic installation:
smithery install @apify/actors-mcp-server
Connect to the server using MCP clients like:
When using SSE clients, provide this server configuration:
{
"mcpServers": {
"apify": {
"type": "sse",
"url": "https://actors-mcp-server.apify.actor/sse",
"env": {
"APIFY_TOKEN": "your-apify-token"
}
}
}
}
Initiate SSE connection:
curl https://actors-mcp-server.apify.actor/sse?token=<APIFY_TOKEN>
Send a message with the returned 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"
}
}'
apify/instagram-scraper
: Extract data from Instagramapify/rag-web-browser
: Web search and content extractionlukaskrivka/google-maps-with-contact-details
: Extract contact details from Google Mapsget-actor-details
: Get documentation and input schema for specific Actorsdiscover-actors
: Search for relevant Actors by keywordsadd-actor-as-tool
: Add an Actor to the available toolsremove-actor-from-tool
: Remove an Actor from the available toolsYou can ask the AI assistant connected to the MCP server:
For local testing, create a .env
file with:
APIFY_TOKEN=your-apify-token
The repository includes example clients:
clientStdio.ts
: Demonstrates direct tool callingclientStdioChat.ts
: Provides an interactive chat interfaceclientSse.ts
: Tests SSE connectionsFor debugging, use the MCP Inspector:
npx @modelcontextprotocol/inspector -- npx @apify/actors-mcp-server
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "actors-mcp-server" '{"command":"npx","args":["-y","@apify/actors-mcp-server"],"env":{"APIFY_TOKEN":"your-apify-token"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"actors-mcp-server": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server"
],
"env": {
"APIFY_TOKEN": "your-apify-token"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"actors-mcp-server": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server"
],
"env": {
"APIFY_TOKEN": "your-apify-token"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect