> ## Agent Instructions
>
> Base URL: https://api.anysite.io
> Authentication: send the `access-token` header. Do NOT use `Authorization: Bearer`.
> Full endpoint catalog: https://app.anysite.io/docs
# n8n MCP Tool Examples

Real-world workflow examples using Anysite MCP in n8n

## Overview

These examples demonstrate how to use the Anysite MCP Tool in n8n workflows to extract and process social media data.

## Example 1: LinkedIn Profile Enrichment

Automatically enrich contact data with LinkedIn profile information.

### Workflow Structure

```mermaid
graph LR
    A[Webhook Trigger] --> B[MCP Client]
    B --> C[AI Agent]
    C --> D[Process Data]
    D --> E[Store in Database]
```

### Configuration

  
#### Setup Webhook Trigger

    Configure a webhook that accepts LinkedIn profile URLs:
    ```json
    {
      "linkedin_url": "https://linkedin.com/in/username"
    }
    ```
  

  
#### Configure MCP Client

    - Add MCP Client node
    - Set endpoint to your Anysite Direct URL
    - Include `linkedin_user` tool
  

  
#### Add AI Agent Node

    Configure the AI agent to use the MCP tool:
    ```
    Extract detailed profile information from: {{ $json.linkedin_url }}

    Use the linkedin_user tool to get:
    - Full name and headline
    - Current position and company
    - Experience history
    - Education
    - Skills
    ```
  

  
#### Process Results

    Use a Code node to structure the extracted data:
    ```javascript
    const profile = $input.item.json;

    return {
      name: profile.full_name,
      headline: profile.headline,
      current_company: profile.current_position?.company,
      location: profile.location,
      skills: profile.skills,
      profile_url: profile.linkedin_url
    };
    ```
  

### Use Cases
- CRM data enrichment
- Lead qualification
- Candidate screening
- Contact database updates

---

## Example 2: Reddit Content Monitoring

Monitor Reddit posts and extract detailed information for content analysis.

### Workflow Structure

```mermaid
graph LR
    A[Schedule Trigger] --> B[Reddit URLs]
    B --> C[MCP Client]
    C --> D[AI Agent]
    D --> E[Sentiment Analysis]
    E --> F[Send Alert]
```

### Configuration

  
#### Setup Schedule Trigger

    Run every hour to check new Reddit posts:
    ```
    Cron: 0 * * * *
    ```
  

  
#### Provide Reddit URLs

    Use a Set node with target post URLs or feed from a database.
  

  
#### Configure MCP Client

    - Include `reddit_post` tool
    - Set for processing multiple items
  

  
#### Extract Post Data

    AI agent prompt:
    ```
    Analyze this Reddit post: {{ $json.reddit_url }}

    Extract:
    - Post title and content
    - Author information
    - Upvotes and comments count
    - Top comments
    - Post timestamp
    ```
  

  
#### Analyze Sentiment

    Add another AI node to analyze sentiment:
    ```
    Analyze the sentiment of this post and its top comments.
    Classify as: Positive, Negative, or Neutral
    Extract key topics and themes.
    ```
  

### Use Cases
- Brand mention monitoring
- Community sentiment tracking
- Competitor analysis
- Trend identification

---

## Example 3: Instagram Profile Analysis

Extract and compare Instagram profiles for influencer research.

### Workflow Configuration

  
#### Input Instagram URLs

    Webhook or manual trigger with profile URLs:
    ```json
    {
      "profiles": [
        "https://instagram.com/influencer1",
        "https://instagram.com/influencer2"
      ]
    }
    ```
  

  
#### MCP Client Setup

    - Include `instagram_profile` tool
    - Enable batch processing
  

  
#### Extract Profile Data

    AI agent instruction:
    ```
    For each Instagram profile, extract:
    - Username and full name
    - Follower count and engagement rate
    - Bio and contact information
    - Recent posts count
    - Account type (business/personal)
    ```
  

  
#### Compare and Rank

    Use Code node to compare profiles:
    ```javascript
    const profiles = $input.all().map(item => item.json);

    // Calculate engagement scores
    profiles.forEach(profile => {
      profile.engagement_score =
        (profile.avg_likes + profile.avg_comments) /
        profile.followers * 100;
    });

    // Sort by engagement
    profiles.sort((a, b) =>
      b.engagement_score - a.engagement_score
    );

    return profiles;
    ```
  

### Use Cases
- Influencer selection
- Campaign planning
- Competitive analysis
- Audience research

---

## Example 4: Multi-Platform Data Aggregation

Collect data from multiple social platforms for comprehensive analysis.

### Workflow Overview

Combine LinkedIn, Instagram, and Reddit data for a person or brand.

  
#### Setup Input

    Provide multiple social media URLs:
    ```json
    {
      "linkedin": "https://linkedin.com/in/username",
      "instagram": "https://instagram.com/username",
      "reddit": "https://reddit.com/user/username"
    }
    ```
  

  
#### Parallel Processing

    Split workflow into parallel branches:
    - Branch 1: LinkedIn data extraction
    - Branch 2: Instagram data extraction
    - Branch 3: Reddit data extraction

    Each branch uses MCP Client with appropriate tool.
  

  
#### Merge Results

    Use Merge node to combine all data:
    ```
    Mode: Combine All
    Output: Single item with all social data
    ```
  

  
#### Generate Report

    AI agent creates unified analysis:
    ```
    Based on the social media data from LinkedIn, Instagram, and Reddit:

    1. Summarize professional background
    2. Analyze content themes and interests
    3. Evaluate audience engagement
    4. Identify key insights and patterns
    ```
  

### Use Cases
- Comprehensive background checks
- Brand presence analysis
- Content strategy research
- Cross-platform insights

---

## Example 5: Automated LinkedIn Company Research

Research companies automatically from a list.

### Configuration

  
#### Input Company List

    Provide company LinkedIn URLs via webhook or spreadsheet:
    ```json
    {
      "companies": [
        "https://linkedin.com/company/company1",
        "https://linkedin.com/company/company2"
      ]
    }
    ```
  

  
#### MCP Client

    Use `linkedin_company` tool for data extraction.
  

  
#### Extract Company Data

    ```
    For each company, extract:
    - Company name and industry
    - Size and location
    - Description and specialties
    - Employee count
    - Recent updates and posts
    ```
  

  
#### Export Results

    Format and export to:
    - Google Sheets
    - Airtable
    - CSV file
    - Database
  

### Use Cases
- Market research
- Lead generation
- Competitive intelligence
- Partnership opportunities

---

## Best Practices

  
#### Error Handling

    Add Error Trigger nodes to handle API failures gracefully and implement retry logic.
  

  
#### Rate Limiting

    Use Wait nodes between MCP calls to avoid hitting API rate limits.
  

  
#### Data Validation

    Validate extracted data before processing to ensure quality and completeness.
  

  
#### Logging

    Log all MCP operations for debugging and audit purposes.
  

## Tips for Optimization

1. **Batch Processing**: Group multiple URLs together to reduce workflow execution time
2. **Caching**: Store frequently accessed data to minimize API calls
3. **Parallel Execution**: Use Split In Batches node for processing large datasets
4. **Error Recovery**: Implement fallback mechanisms for failed API calls
5. **Monitoring**: Set up notifications for workflow failures or data anomalies

## Advanced Patterns

### Pattern 1: Conditional Tool Selection

Use IF nodes to dynamically select which MCP tool to use based on URL type:

```javascript
// Detect platform from URL
const url = $json.social_url;

if (url.includes('linkedin.com/in/')) {
  return { tool: 'linkedin_user' };
} else if (url.includes('linkedin.com/company/')) {
  return { tool: 'linkedin_company' };
} else if (url.includes('instagram.com')) {
  return { tool: 'instagram_profile' };
}
```

### Pattern 2: Incremental Updates

Track and update only changed data:

```javascript
// Compare with existing data
const existing = $('Database').first().json;
const fresh = $json;

const changes = {};
if (existing.followers !== fresh.followers) {
  changes.followers = fresh.followers;
  changes.follower_growth = fresh.followers - existing.followers;
}

return changes.followers ? changes : null;
```

### Pattern 3: Data Enrichment Pipeline

Chain multiple MCP tools for comprehensive enrichment:

```
LinkedIn User → Get Company → Get Company Employees → Analyze Network
```

## Resources

- [View All Available MCP Tools](/docs/mcp-server/tools)
- [n8n MCP Tool Installation](/docs/mcp-server/n8n-tool/installation)
- [n8n Official Documentation](https://docs.n8n.io/)
- [Anysite API Reference](/docs/api)

## Need Help?

#### Get Support

  Contact our support team for assistance with n8n MCP integration
