# ChatPDF — Pipedream Connect

> ChatPDF Backend API - extract information and chat with PDFs.

- API slug: `chatpdf` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Productivity
- Website: https://www.chatpdf.com/
- This page (HTML): https://pipedream.com/apps/chatpdf
- 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: chatpdf`

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

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

const { tools } = await mcp.listTools()

// e.g. run Add PDF Via URL:
const result = await mcp.callTool({
  name: "chatpdf-add-pdf-via-url",
  arguments: {
    url: "PDF URL",
  },
})
```

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

## API proxy

For a ChatPDF 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://api.chatpdf.com/v1/sources/add-url

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuY2hhdHBkZi5jb20vdjEvc291cmNlcy9hZGQtdXJs?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: "chatpdf-add-pdf-via-url",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    chatpdf: { authProvisionId: "apn_xxxxxxx" },
    url: "PDF URL",
  },
})
```

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

## Actions (3)

### `chatpdf-add-pdf-via-url` — Add PDF Via URL (Write)

Adds a PDF from a publicly accessible URL to ChatPDF, returning a source ID for interactions. See the documentation

Full schema: https://pipedream.com/apps/chatpdf/actions/add-pdf-via-url.md

### `chatpdf-chat-with-pdf` — Chat With PDF (Write)

Sends messages to interact with a specific PDF using its source ID. Can handle single or multiple messages for complex queries. See the documentation

Full schema: https://pipedream.com/apps/chatpdf/actions/chat-with-pdf.md

### `chatpdf-delete-pdf` — Delete PDF (Write)

Deletes one or more PDFs from ChatPDF using their source IDs. See the documentation

Full schema: https://pipedream.com/apps/chatpdf/actions/delete-pdf.md

---

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