# Langflow → PDF with makesPDF

> For AI agents: a documentation index is available at https://makespdf.com/llms.txt — every docs page also has a markdown twin (append .md to the page URL), including this one: https://makespdf.com/docs/integrations/langflow.md

[Langflow](https://www.langflow.org/) is both an MCP server and an MCP client.
As a client it uses the **MCP Tools** component, which connects a flow to a
remote server so an agent built in Langflow can use that server's tools.
Register makesPDF once, then add the component and hand its toolset to an Agent.

## Connect

You need a makesPDF [API key](https://makespdf.com/settings/api-keys?ref=langflow).

1. Open **Settings** → **MCP Servers** (or **MCP** in the flow sidebar) and
   click **Add MCP Server**.
2. Choose the **HTTP/SSE** connection type, then set **Name** to anything you
   recognise and the URL to `https://makespdf.com/api/v1/mcp`.
3. Add a **Headers** key/value pair: `Authorization` and
   `Bearer <your key>`.
4. Save the server. When the connection succeeds, Langflow shows the number of
   tools the server exposes.
5. Drag the server's tile from the MCP sidebar onto the canvas. Langflow adds an
   **MCP Tools** component for it with the server already selected; if you add
   the component another way, pick the server in its **MCP Server** field.
6. In the component's header menu, turn on **Tool mode**, then connect its
   **Toolset** port to the **Tools** port of an **Agent** component.
7. Leave **Tool** blank to allow every tool the server exposes, or pick one. Make
   sure **Chat Input** and **Chat Output** are attached to the Agent, open the
   **Playground**, and ask for a PDF.

**Keep the key in a global variable.** Create a **Credential** global variable in
**Settings** → **Global Variables** and use its name as the header value:
Langflow resolves the name to the value before it calls the server, so the key
never sits in the server config. Langflow's own example shows that value must
include the `Bearer ` prefix.

## Render a PDF

The **MCP Tools** component returns the tool's response as a table, and the agent
uses it like any other tool result.

| Tool | Arguments | What it does |
| --- | --- | --- |
| `render_markdown` | `markdown`, optional `options` | Markdown → PDF (1 credit per 10 pages) |
| `render_template` | `templateId`, optional `data` | A stored or library template filled with your data |
| `validate_markdown` | `markdown` | Free accessibility check before you render |
| `list_templates` | optional `q`, `category`, `tags` | Find a library template such as `invoice-classic` |

The result carries `pageCount`, `creditsDeducted`, `artifactId` and a
`downloadUrl`.

## Get the file

`downloadUrl` is a signed link that needs no API key, so any step that can fetch
a URL can download the PDF. In Langflow it is a field of the tool response the
component returns, visible in the Playground and in a run through the API.

The link expires 15 minutes after the render. To fetch an older render, call
`get_render_download_url` with its `artifactId` for a fresh link (free).

## Billing and limits

Renders bill your makesPDF credits exactly like the API: 1 credit per 10 pages
on success, nothing on failure. Validation and listing tools are free. On the
Free and Hobbyist plans, unless the account holds Growth credits, each page
carries a small makespdf.com link. Langflow's own hosting and model charges are
separate. The full tool reference is on the [MCP page](https://makespdf.com/docs/mcp).
