# Clerk + Lemon Squeezy — Pipedream Connect

> Connect a user's Clerk and Lemon Squeezy accounts and expose tools for both apps directly in your product or your agent.

- Apps: Clerk (`clerk`) + Lemon Squeezy (`lemon_squeezy`)
- This page (HTML): https://pipedream.com/apps/clerk/integrations/lemon-squeezy
- 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: clerk,lemon_squeezy`
- `x-pd-app-slug` takes a comma-separated list, so `clerk,lemon_squeezy` 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": "clerk,lemon_squeezy",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// One list, both toolsets: Clerk and Lemon Squeezy tools arrive
// together, each keyed by its own app's slug.

// e.g. run Create User:
const result = await mcp.callTool({
  name: "clerk-create-user",
  arguments: {
    externalId: "External Id",
    firstName: "First Name",
  },
})
```

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 [clerkTools, lemonSqueezyTools] =
  await Promise.all([
    pd.components.list({ app: "clerk" }),
    pd.components.list({ app: "lemon_squeezy" }),
  ])

// 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)

## Clerk

- API slug: `clerk` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Developer Tools
- Website: https://clerk.com/
- App page (HTML): https://pipedream.com/apps/clerk
- Tools: 7 actions · 0 triggers

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

### Actions (7)

- [Create User](https://pipedream.com/apps/clerk/actions/create-user.md) — `clerk-create-user`
- [Create User Invitation](https://pipedream.com/apps/clerk/actions/create-user-invitation.md) — `clerk-create-user-invitation`
- [Delete User](https://pipedream.com/apps/clerk/actions/delete-user.md) — `clerk-delete-user`
- [Get User](https://pipedream.com/apps/clerk/actions/get-user.md) — `clerk-get-user`
- [Get User Memberships](https://pipedream.com/apps/clerk/actions/get-user-membership.md) — `clerk-get-user-membership`
- [List User Id Options](https://pipedream.com/apps/clerk/actions/list-user-id-options.md) — `clerk-list-user-id-options`
- [Update User](https://pipedream.com/apps/clerk/actions/update-user.md) — `clerk-update-user`

## Lemon Squeezy

- API slug: `lemon_squeezy` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Commerce
- Website: https://www.lemonsqueezy.com/
- App page (HTML): https://pipedream.com/apps/lemon-squeezy
- Tools: 3 actions · 3 triggers

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

### Actions (3)

- [Retrieve A Customer](https://pipedream.com/apps/lemon-squeezy/actions/retrieve-customer.md) — `lemon_squeezy-retrieve-customer`
- [Retrieve A Product](https://pipedream.com/apps/lemon-squeezy/actions/retrieve-product.md) — `lemon_squeezy-retrieve-product`
- [Retrieve An Order](https://pipedream.com/apps/lemon-squeezy/actions/retrieve-order.md) — `lemon_squeezy-retrieve-order`

### Triggers (3)

- [New Order Created](https://pipedream.com/apps/lemon-squeezy/triggers/order-created.md) — `lemon_squeezy-order-created`
- [New Subscription Cancelled](https://pipedream.com/apps/lemon-squeezy/triggers/subscription-cancelled.md) — `lemon_squeezy-subscription-cancelled`
- [New Subscription Created](https://pipedream.com/apps/lemon-squeezy/triggers/subscription-created.md) — `lemon_squeezy-subscription-created`

---

- Clerk: https://pipedream.com/apps/clerk.md · Lemon Squeezy: https://pipedream.com/apps/lemon-squeezy.md
- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
