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

# HoopAI MCP + n8n

> Connect the HoopAI MCP server to n8n workflows using the MCP Client node and HTTP Streamable transport.

Use n8n's native MCP Client node to call any of HoopAI's 36 MCP tools directly inside your workflows — no custom code or API wrappers needed.

<Note>
  **Requires n8n v1.104 or later.** The MCP Client node with HTTP Streamable transport was introduced in that release. Update before proceeding.
</Note>

## Prerequisites

* n8n v1.104+
* A HoopAI Private Integration Token (see [API Keys](/developer/getting-started/api-keys))
* Your HoopAI Location ID (see [Finding your Location ID](/developer/getting-started/location-id))

## Step 1: Add the MCP Client node

In your n8n workflow, search for and add the **MCP Client** node.

<Frame caption="Add the MCP Client node from the node panel">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/hoopai-84ec0cdc/images/n8n-mcp-client-node.png" alt="n8n MCP Client node" />
</Frame>

## Step 2: Configure the connection

Set the following fields in the MCP Client node:

| Field            | Value                                       |
| ---------------- | ------------------------------------------- |
| **MCP URL**      | `https://services.leadconnectorhq.com/mcp/` |
| **Transport**    | HTTP Streamable                             |
| **Auth type**    | Header-based                                |
| **Header key**   | `Authorization`                             |
| **Header value** | `Bearer YOUR_API_KEY`                       |

## Step 3: Pass your Location ID

You have two options for providing the Location ID:

**Option A — Add as a second header (recommended for single-account workflows):**

In the MCP Client node headers, add:

```
Key: locationId
Value: YOUR_LOCATION_ID
```

**Option B — Set it in the LLM system prompt (best for multi-account workflows):**

If you're using an AI Agent node before the MCP Client, add this to the system prompt:

```
The location id is YOUR_LOCATION_ID
```

The MCP server will extract it from context automatically.

## Step 4: Select a tool and run

Once connected, the MCP Client node will fetch the list of available tools from HoopAI. Select the tool you want to call, provide the required parameters, and execute.

**Example — Get recent contacts:**

```json theme={null}
{
  "tool": "contacts_get-contacts",
  "parameters": {
    "limit": 10,
    "sortBy": "date_added",
    "sortDirection": "desc"
  }
}
```

## Example workflow

A common pattern: **AI Agent + MCP Client** for conversational automation.

```
Webhook trigger
  → AI Agent node (with system prompt + locationId)
    → MCP Client node (HoopAI tools)
      → Set node (format response)
        → Respond to Webhook
```

The AI Agent node receives a natural language request, decides which MCP tool to call, and passes structured parameters to the MCP Client node.

**System prompt template for the AI Agent:**

```
You are a HoopAI assistant. You have access to MCP tools for contacts,
conversations, calendars, opportunities, payments, social media, and more.

The location id is {{ $json.locationId }}

Always confirm before creating or updating records.
Return results in a clear, structured format.
```

## Multi-account workflows

For workflows that handle multiple HoopAI accounts, pass the Location ID dynamically rather than hardcoding it:

1. Accept `locationId` as a parameter in your webhook or form trigger
2. Store it in a workflow variable or pass it as `{{ $json.locationId }}`
3. Inject it into the AI Agent system prompt dynamically:

```
The location id is {{ $('Webhook').item.json.body.locationId }}
```

This lets a single workflow serve multiple accounts without duplication.

## Troubleshooting

| Error              | Cause                    | Fix                                                         |
| ------------------ | ------------------------ | ----------------------------------------------------------- |
| `401 Unauthorized` | Invalid or expired token | Regenerate your Private Integration Token                   |
| `403 Forbidden`    | Missing scope            | Add the required scope in Private Integrations settings     |
| `400 Bad Request`  | Missing locationId       | Add locationId as a header or in the AI Agent system prompt |
| Tools not loading  | n8n version too old      | Update to n8n v1.104+                                       |
| Empty tool list    | Wrong MCP URL            | Verify URL is `https://services.leadconnectorhq.com/mcp/`   |

## Next steps

<CardGroup cols={2}>
  <Card title="All 36 MCP tools" icon="table" href="/developer/mcp/platform-mcp-server">
    Browse the full tool reference with endpoint names and required scopes
  </Card>

  <Card title="Build a multi-agent system" icon="robot" href="/developer/mcp/subagents">
    LangGraph patterns for advanced HoopAI automation
  </Card>
</CardGroup>
