# n8n-mcp (`nourishing_courier/web-data-for-ai`) Actor

n8n-mcp

- **URL**: https://apify.com/nourishing_courier/web-data-for-ai.md
- **Developed by:** [Ani Björkström](https://apify.com/nourishing_courier) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## n8n + AI MCP Bridge: Connect Claude, GPT & LLMs to 2000+ Web Scrapers

The ultimate **Model Context Protocol (MCP)** bridge that connects **n8n workflow automation**, **AI assistants** (Claude, GPT, LLMs), and **2000+ Apify web scrapers** into a single powerful integration.

> Execute any Apify Actor directly from AI conversations or n8n workflows via standardized MCP protocol.

### Why This Actor?

| Problem | Solution |
|---------|----------|
| AI can't access real-time web data | MCP Bridge connects AI to live web scrapers |
| n8n workflows can't use AI tools | MCP protocol enables AI-workflow integration |
| Complex API integrations | Simple HTTP calls with auto data transformation |
| Managing multiple scrapers | Single endpoint to 2000+ Apify Actors |

### Key Features

- **MCP Protocol**: Full Model Context Protocol implementation for AI tool calling
- **n8n Compatible**: Works with n8n HTTP Request nodes out of the box
- **AI Ready**: Integrates with Claude Desktop, OpenAI, LangChain, AutoGPT
- **2000+ Tools**: Access the entire Apify scraper and automation ecosystem
- **Session Management**: Support for 100+ concurrent MCP sessions
- **Data Transform**: Automatic conversion between n8n and MCP formats
- **Enterprise Ready**: Retry mechanisms, error handling, timeout management

### Use Cases

#### 1. AI-Powered Lead Generation

```
User: "Find restaurants in NYC and get their contact info"
AI → MCP Bridge → Google Maps Scraper → Contact data returned to AI
```

#### 2. Automated Research Pipelines

```
n8n Trigger → MCP Bridge → Web Scraper → AI Analysis → Report
```

#### 3. Real-Time Data for LLMs

```
User Question → AI Model → MCP Bridge → Fresh Web Data → AI Response
```

#### 4. No-Code AI Automation

```
n8n Workflow → MCP Tools → Execute Any Apify Actor → Process Results
```

### Quick Start

#### Step 1: Start the Actor

Run this Actor to get your MCP endpoint URL. The Actor runs in **Standby Mode** - always ready to receive requests.

#### Step 2: Connect from AI or n8n

**Create an MCP Session:**

```bash
curl -X POST https://[your-standby-url]/mcp/session \
  -H "Content-Type: application/json"
```

**List Available Tools:**

```bash
curl -X POST https://[your-standby-url]/mcp/tools/list \
  -H "Content-Type: application/json"
```

**Execute a Scraper:**

```bash
curl -X POST https://[your-standby-url]/mcp/tools/call \
  -H "Content-Type: application/json" \
  -d '{
    "name": "execute_actor",
    "arguments": {
      "actorId": "apify/web-scraper",
      "input": {"startUrls": [{"url": "https://example.com"}]}
    }
  }'
```

### MCP Tools Available

| Tool | Description | Example Use |
|------|-------------|-------------|
| `search_actors` | Search Apify Store for scrapers | Find the right tool for any task |
| `execute_actor` | Run any Apify Actor | Scrape websites, extract data |
| `get_actor_info` | Get Actor details | Check input schema before running |
| `list_loaded_actors` | Show pre-loaded Actors | See what's ready for fast execution |
| `add_actor` | Pre-load an Actor | Speed up repeated executions |
| `get_run_status` | Check run status | Monitor long-running tasks |
| `transform_n8n_data` | Convert n8n data | Auto-map workflow data to Actor input |

### MCP Protocol Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/mcp` | GET | Server info and capabilities |
| `/mcp/session` | POST | Create new MCP session |
| `/mcp/tools/list` | POST | List all available tools |
| `/mcp/tools/call` | POST | Execute an MCP tool |

### n8n Integration

#### HTTP Request Node Configuration

```json
{
  "method": "POST",
  "url": "https://[your-standby-url]/mcp/tools/call",
  "headers": {
    "Content-Type": "application/json",
    "X-MCP-Session": "{{$json.sessionId}}"
  },
  "body": {
    "name": "execute_actor",
    "arguments": {
      "actorId": "apify/google-maps-scraper",
      "input": {
        "searchStringsArray": ["{{$json.searchQuery}}"],
        "maxCrawledPlaces": 100
      }
    }
  }
}
```

#### Data Transformation

Convert n8n workflow data to Actor-compatible format:

```json
{
  "name": "transform_n8n_data",
  "arguments": {
    "workflowData": {
      "inputData": {
        "url": "https://example.com",
        "searchQuery": "products"
      }
    },
    "targetActorId": "apify/web-scraper"
  }
}
```

The bridge automatically maps common fields:

- `url/urls` → `startUrls`
- `searchQuery/search/keyword` → `queries`
- `maxResults/limit` → `maxItems`

### Claude Desktop Integration

Add to your Claude Desktop MCP config:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://[your-standby-url]/mcp"
    }
  }
}
```

### Legacy n8n Endpoints

For backwards compatibility:

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/health` | GET | Health check |
| `/actors` | GET | List loaded Actors |
| `/search` | POST | Search Apify Store |
| `/execute` | POST | Execute an Actor directly |
| `/transform` | POST | Transform n8n data |
| `/runs` | GET | List active runs |
| `/sessions` | GET | View session info |

### Configuration Options

| Parameter | Default | Description |
|-----------|---------|-------------|
| `apifyToken` | Auto | API token (auto-detected on Apify) |
| `defaultActors` | `[]` | Pre-load Actors on startup |
| `enableDynamicDiscovery` | `true` | Auto-discover Actors when requested |
| `maxConcurrentRuns` | `5` | Max parallel Actor executions |
| `defaultTimeout` | `300` | Default timeout in seconds |
| `maxSessions` | `100` | Max concurrent MCP sessions |
| `sessionTimeout` | `3600` | Session timeout in seconds |
| `webhookSecret` | - | Secure your endpoint |

### Security

- **Webhook Secret**: Protect endpoints with `X-Webhook-Secret` header
- **Session Isolation**: Each client gets an isolated session
- **Token Security**: Apify tokens stored as secrets, never exposed in logs

### Cost Estimation

| Component | Cost |
|-----------|------|
| Standby Mode (256MB) | ~$0.02/hour |
| Actor Execution | Varies by Actor used |
| MCP Sessions | Free (included) |

### Target Audience

- **AI Developers**: Connect LLMs to real-world web data via MCP
- **Automation Engineers**: Enhance n8n with AI-powered decision making
- **No-Code Builders**: Access AI scrapers without writing code
- **DevOps Teams**: Integrate AI capabilities into automation pipelines

### Resources

- [Apify Documentation](https://docs.apify.com)
- [MCP Specification](https://modelcontextprotocol.io)
- [n8n Documentation](https://docs.n8n.io)
- [Apify Store](https://apify.com/store) - Browse 2000+ Actors

### License

MIT License - Free for commercial and personal use.

***

**Keywords**: MCP, Model Context Protocol, n8n, AI, Claude, GPT, LLM, web scraper, automation, workflow, Apify, API, integration, AI tools, LangChain, AutoGPT, no-code, low-code

# Actor input Schema

## `testMode` (type: `boolean`):

Run a quick self-test and exit. Used for automated QA testing. Leave disabled for normal operation.

## `apifyToken` (type: `string`):

Your Apify API token. Leave empty when running on Apify platform (auto-detected). Only needed for external deployments.

## `defaultActors` (type: `array`):

Actors to load on startup for faster first execution. Format: username/actor-name

## `enableDynamicDiscovery` (type: `boolean`):

Automatically discover and load Actors when first requested via MCP. Recommended to leave enabled.

## `maxConcurrentRuns` (type: `integer`):

Maximum number of Actors that can run simultaneously across all MCP sessions.

## `defaultTimeout` (type: `integer`):

How long to wait for Actor execution before timing out. Can be overridden per MCP tool call.

## `maxSessions` (type: `integer`):

Maximum number of concurrent MCP client sessions. Each n8n workflow or AI client gets one session.

## `sessionTimeout` (type: `integer`):

How long an MCP session stays active without activity before being cleaned up.

## `webhookSecret` (type: `string`):

Optional secret to protect your MCP endpoint. If set, all requests must include X-Webhook-Secret header.

## `enableLogging` (type: `boolean`):

Enable verbose logging for troubleshooting MCP protocol issues. Not recommended for production.

## Actor input object example

```json
{
  "testMode": true,
  "defaultActors": [
    "apify/web-scraper",
    "apify/cheerio-scraper"
  ],
  "enableDynamicDiscovery": true,
  "maxConcurrentRuns": 5,
  "defaultTimeout": 300,
  "maxSessions": 100,
  "sessionTimeout": 3600,
  "enableLogging": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "testMode": true,
    "defaultActors": [],
    "maxConcurrentRuns": 5,
    "defaultTimeout": 300,
    "maxSessions": 100,
    "sessionTimeout": 3600
};

// Run the Actor and wait for it to finish
const run = await client.actor("nourishing_courier/web-data-for-ai").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "testMode": True,
    "defaultActors": [],
    "maxConcurrentRuns": 5,
    "defaultTimeout": 300,
    "maxSessions": 100,
    "sessionTimeout": 3600,
}

# Run the Actor and wait for it to finish
run = client.actor("nourishing_courier/web-data-for-ai").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "testMode": true,
  "defaultActors": [],
  "maxConcurrentRuns": 5,
  "defaultTimeout": 300,
  "maxSessions": 100,
  "sessionTimeout": 3600
}' |
apify call nourishing_courier/web-data-for-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nourishing_courier/web-data-for-ai"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tK4raoWRA1A7zGVHN/builds/ThNdsTMRV7HTOqdSE/openapi.json
