Claude Code & other clients
Headless clients authenticate with an API key sent in the x-api-key header.
- Create a key in Imprime: avatar → API Keys → New key (e.g.
Claude Code). Copy it. - Add the server to your client, as shown below.
- Restart the client (or reload its MCP servers) and check that the
imprimetools are listed.
Configuration
Section titled “Configuration”claude mcp add --transport http imprime https://app.imprime.io/api/mcp \ --header "x-api-key: <your-api-key>"Add --scope user to make it available in every project.
For Claude Code’s .mcp.json, and any client using the standard mcpServers format:
{ "mcpServers": { "imprime": { "type": "http", "url": "https://app.imprime.io/api/mcp", "headers": { "x-api-key": "<your-api-key>" } } }}With the official MCP TypeScript SDK:
import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const transport = new StreamableHTTPClientTransport(new URL('https://app.imprime.io/api/mcp'), { requestInit: { headers: { 'x-api-key': process.env.IMPRIME_API_KEY! } },});
const client = new Client({ name: 'my-agent', version: '1.0.0' });await client.connect(transport);
const { tools } = await client.listTools();const result = await client.callTool({ name: 'preview_template', arguments: { templateId: '6ada52d12b452e53f3c518e3', variableValues: { client: 'ACME Corp', total: '$205.00' }, },});Getting the PDF from an agent
Section titled “Getting the PDF from an agent”preview_template renders the pages as images and returns a link to the document, which you
open to view and print it.
When your agent only needs the PDF bytes — no design work, no review loop — call the REST export endpoint instead. It returns the PDF in a single request:
curl -X POST "https://app.imprime.io/api/export/$TEMPLATE_ID/pdf" \ -H "x-api-key: $IMPRIME_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "client": "ACME Corp" }' -o out.pdf