# Better Stack — Pipedream Connect

> Better Stack lets you see inside any stack, debug any issue, and resolve any incident.

- API slug: `better_stack` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Web & App Development
- Website: https://betterstack.com/
- This page (HTML): https://pipedream.com/apps/better-stack
- Tools: 3 actions · 0 triggers

## Connect via MCP (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: better_stack`

```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": "better_stack",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// e.g. run Acknowledge Incident:
const result = await mcp.callTool({
  name: "better_stack-acknowledge-incident",
  arguments: {
    incidentId: "Incident ID",
    acknowledgedBy: "Acknowledged By",
  },
})
```

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

## API proxy

For a Better Stack endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://uptime.betterstack.com/api/v2/monitors

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly91cHRpbWUuYmV0dGVyc3RhY2suY29tL2FwaS92Mi9tb25pdG9ycw?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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 result = await pd.actions.run({
  id: "better_stack-acknowledge-incident",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    better_stack: { authProvisionId: "apn_xxxxxxx" },
    incidentId: "Incident ID",
    acknowledgedBy: "Acknowledged By",
  },
})
```

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

## Actions (3)

### `better_stack-acknowledge-incident` — Acknowledge Incident (Write)

Acknowledges an incident, marking it as acknowledged in Better Stack. See the documentation

Full schema: https://pipedream.com/apps/better-stack/actions/acknowledge-incident.md

### `better_stack-create-incident` — Create Incident (Write)

Initiates an incident that signals the team. See the documentation

Full schema: https://pipedream.com/apps/better-stack/actions/create-incident.md

### `better_stack-resolve-incident` — Resolve Incident (Write)

Brings a closure to an incident by resolving it with optional resolution details. See the documentation

Full schema: https://pipedream.com/apps/better-stack/actions/resolve-incident.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
