> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anysite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n MCP Tool Installation

> Connect Anysite MCP Server to n8n workflows

## Overview

The Anysite MCP Tool for n8n provides seamless integration between n8n workflows and the Anysite API through the Model Context Protocol (MCP). This allows you to extract LinkedIn, Instagram, Reddit, and other social media data directly within your n8n automation workflows.

## Prerequisites

* Active n8n instance (cloud or self-hosted)
* Anysite API account with credentials
* MCP Client node installed in n8n (available in n8n version 1.0+)

## Step 1: Get Your Connection URL

First, you need to obtain the MCP connection URL from your Anysite dashboard:

1. Visit [anysite.io](https://anysite.io) and log in to your account
2. Navigate to **MCP Server Integration** section
3. You'll see two connection options:
   * **OAuth URL**: For clients that support OAuth authentication
   * **Direct URL**: Contains your API key directly in the URL

<img src="https://mintlify.s3.us-west-1.amazonaws.com/horizondatawave/public/imgs/n8n_cred.png" alt="Anysite MCP Server Integration" />

<Note>
  For n8n integration, use the **Direct URL** as it includes authentication credentials.
</Note>

4. In the "Or add to your client" section, select **n8n**
5. The "Auto" tab will display your complete connection URL
6. Click **Copy** to copy the URL (format: `https://api.anysite.io/mcp/direct?api_key=YOUR_KEY`)

<Warning>
  Keep your connection URL secure - it contains your API key. Never share it publicly or commit it to version control.
</Warning>

## Step 2: Configure MCP Client in n8n

Now add the MCP Client node to your n8n workflow:

1. **Add MCP Client Node**
   * Open your n8n workflow editor
   * Search for "MCP Client" node and add it to your canvas
2. **Configure Connection Parameters**

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/horizondatawave/imgs/n8n_mcp.png" alt="n8n MCP Client Configuration" />

   Set the following parameters in the node configuration:

   * **Endpoint**: Paste your Direct URL from Step 1

     ```
     https://api.anysite.io/mcp/direct?api_key=YOUR_KEY
     ```
   * **Server Transport**: Select `HTTP Streamable`
   * **Authentication**: Select `None` (Authentication is handled through the API key in the endpoint URL)
   * **Tools to Include**:
     * Select `Selected` if you want to use specific tools
     * Or leave as default to include all available tools
3. **Select Tools** (Optional)

   If you chose "Selected" for Tools to Include, you can specify which Anysite tools to use:

   * `linkedin_user` - Extract LinkedIn profile data
   * `linkedin_company` - Get company information
   * `linkedin_post` - Fetch post details
   * `instagram_profile` - Get Instagram profile data
   * `reddit_post` - Extract Reddit post content
   * And more...

## Step 3: Verify Connection

Test your MCP integration:

1. Click **Execute step** in the n8n MCP Client node
2. Check the execution log for successful connection
3. You should see available tools listed in the output

<Check>
  If the connection is successful, you'll see a list of available Anysite tools that can be used in your workflow.
</Check>

## Example Workflow Structure

Here's a typical workflow structure using the Anysite MCP Tool:

```
Trigger (Webhook/Schedule)
  ↓
MCP Client (Anysite)
  ↓
AI Agent Node (uses MCP tools)
  ↓
Process Results
  ↓
Output/Store Data
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timeout or authentication errors">
    * Verify your API key is valid and active
    * Check that your Anysite account has API access enabled
    * Ensure the connection URL is complete and correctly copied
    * Try regenerating the connection URL from the Anysite dashboard
  </Accordion>

  <Accordion title="MCP Client node not available">
    * Update n8n to the latest version (MCP support requires v1.0+)
    * Check if MCP Client node is enabled in your n8n instance
    * For self-hosted n8n, ensure all dependencies are installed
  </Accordion>

  <Accordion title="Tools not appearing or not working">
    * Verify your Anysite subscription includes the tools you need
    * Check API rate limits and quota in your Anysite account
    * Ensure the endpoint URL includes the `api_key` parameter
    * Try reconnecting by updating the endpoint URL
  </Accordion>

  <Accordion title="HTTP Streamable transport issues">
    * Confirm "Server Transport" is set to "HTTP Streamable"
    * Check network connectivity between n8n and api.anysite.io
    * For self-hosted n8n, verify firewall rules allow outbound HTTPS
  </Accordion>
</AccordionGroup>

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Secure Credentials" icon="shield-check">
    Never expose your API key. Use n8n environment variables or credentials management for sensitive data.
  </Card>

  <Card title="Access Control" icon="lock">
    Restrict n8n workflow access to authorized team members only.
  </Card>

  <Card title="Monitor Usage" icon="chart-line">
    Regularly check your Anysite dashboard for API usage and rate limits.
  </Card>

  <Card title="Rotate Keys" icon="rotate">
    Periodically regenerate your API keys and update n8n configurations.
  </Card>
</CardGroup>

## Next Steps

* [Explore n8n MCP Tool Examples](/mcp-server/n8n-tool/examples)
* [View All Available Tools](/mcp-server/tools)
* [Learn About Local Server Setup](/mcp-server/local-server/installation)
