# Home Assistant + Thanks.io — Pipedream Connect

> Connect a user's Home Assistant and Thanks.io accounts and expose tools for both apps directly in your product or your agent.

- Apps: Home Assistant (`home_assistant`) + Thanks.io (`thanks_io`)
- This page (HTML): https://pipedream.com/apps/home-assistant/integrations/thanks-io
- One `external_user_id` owns both connected accounts, and each account stays independently revocable.

## One session, both toolsets (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: home_assistant,thanks_io`
- `x-pd-app-slug` takes a comma-separated list, so `home_assistant,thanks_io` is one session on one transport. Both toolsets arrive from a single `listTools()`, and a tool is called exactly as it would be in a single-app session.

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "home_assistant,thanks_io",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// One list, both toolsets: Home Assistant and Thanks.io tools arrive
// together, each keyed by its own app's slug.

// e.g. run Add Recipient:
const result = await mcp.callTool({
  name: "thanks_io-add-recipient",
  arguments: {
    subAccount: "Sub Account",
    mailingList: "Mailing List",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## Both apps from your backend

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const externalUserId = "{external_user_id}" // any stable ID for this user in your system

const [homeAssistantTools, thanksIoTools] =
  await Promise.all([
    pd.components.list({ app: "home_assistant" }),
    pd.components.list({ app: "thanks_io" }),
  ])

// One external user owns both connected accounts, so either app's tools
// run on their behalf with the same externalUserId.
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Home Assistant

- API slug: `home_assistant` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Smart Home Automation
- Website: https://home-assistant.io
- App page (HTML): https://pipedream.com/apps/home-assistant
- Tools: 0 actions · 0 triggers

Full tool list, API proxy, and SDK quickstart: https://pipedream.com/apps/home-assistant.md

## Thanks.io

- API slug: `thanks_io` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Marketing
- Website: https://thanks.io
- App page (HTML): https://pipedream.com/apps/thanks-io
- Tools: 12 actions · 3 triggers

Full tool list, API proxy, and SDK quickstart: https://pipedream.com/apps/thanks-io.md

### Actions (top 8 of 12)

- [Add Recipient](https://pipedream.com/apps/thanks-io/actions/add-recipient.md) — `thanks_io-add-recipient`
- [Delete Recipient](https://pipedream.com/apps/thanks-io/actions/delete-recipient.md) — `thanks_io-delete-recipient`
- [List Brand Options](https://pipedream.com/apps/thanks-io/actions/list-gift-card-brand-options.md) — `thanks_io-list-gift-card-brand-options`
- [List Handwriting Style Options](https://pipedream.com/apps/thanks-io/actions/list-handwriting-style-options.md) — `thanks_io-list-handwriting-style-options`
- [List Sub Account Options](https://pipedream.com/apps/thanks-io/actions/list-sub-account-options.md) — `thanks_io-list-sub-account-options`
- [Send Giftcard](https://pipedream.com/apps/thanks-io/actions/send-giftcard.md) — `thanks_io-send-giftcard`
- [Send Letter](https://pipedream.com/apps/thanks-io/actions/send-letter.md) — `thanks_io-send-letter`
- [Send Letter via Radius Search](https://pipedream.com/apps/thanks-io/actions/send-letter-radius-search.md) — `thanks_io-send-letter-radius-search`

### Triggers (3)

- [New Delivery](https://pipedream.com/apps/thanks-io/triggers/new-delivery.md) — `thanks_io-new-delivery`
- [New Order](https://pipedream.com/apps/thanks-io/triggers/new-order.md) — `thanks_io-new-order`
- [New Recipient](https://pipedream.com/apps/thanks-io/triggers/new-recipient.md) — `thanks_io-new-recipient`

---

- Home Assistant: https://pipedream.com/apps/home-assistant.md · Thanks.io: https://pipedream.com/apps/thanks-io.md
- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
