An invoice API your AI agents can actually call

Agents are starting to close real business loops: a deal wraps up, the agent drafts the email, updates the CRM, and then stalls, because producing the invoice means a human opening a billing tool. This guide connects that last step. In about a minute, Claude or any MCP client can generate finished, branded invoice and receipt PDFs as a native tool.

Why agents need a document tool

A language model cannot emit a valid PDF binary, and letting it improvise invoice arithmetic is how a rounding hallucination ends up on a customer document. The fix is the same one that works for every other agent capability: give the model a deterministic tool. With Slipstack, the agent supplies what it is good at, the who and the what:

  • who the invoice is from and to,
  • the line items with quantities and unit prices,
  • a tax rate and any discount.

The renderer does the rest: subtotals, tax, totals, layout, branding. Same JSON in, same PDF out, every time. The agent gets back a 24-hour download URL and the computed totals it can quote back to the user.

The tools your agent gets

  • create_invoice_pdf: generate an invoice PDF from JSON; returns a download URL plus computed totals.
  • create_receipt_pdf: generate a payment receipt with the same schema.
  • get_document_schema: lets the agent discover the accepted JSON shape and plan limits on its own.
  • get_account_usage: current usage and quota for an API key.

The read tools matter more than they look: an agent that can fetch the schema corrects its own malformed payloads instead of failing. Full details on the MCP server page.

Connect: Claude (web and desktop)

Settings, then Connectors, then Add custom connector, and paste this URL. No login required; the demo quota works immediately.

https://slipstack.dev/api/mcp

Then ask Claude something like: "Create an invoice from Acme Inc to Globex LLC for 12 hours of consulting at $150/hr, 8.5% tax." Claude calls create_invoice_pdf and replies with the download link and totals.

Connect: Claude Code

One line in your terminal:

claude mcp add --transport http slipstack https://slipstack.dev/api/mcp

# with an API key (plan quotas instead of the shared demo limit):
claude mcp add --transport http slipstack https://slipstack.dev/api/mcp \
  --header "Authorization: Bearer psk_live_..."

Connect: Cursor and other MCP clients

Add the server to your client's MCP configuration (for Cursor, .cursor/mcp.json):

{
  "mcpServers": {
    "slipstack": { "type": "http", "url": "https://slipstack.dev/api/mcp" }
  }
}

The demo quota, explained

Anonymous MCP use is metered at 10 documents per day per IP. That exists so you can evaluate the whole flow, from connector setup to a finished PDF, without creating an account. For production traffic, pass an API key as an Authorization: Bearer header or the optional api_key tool argument. The free plan covers 50 documents/month; paid plans start at $19/month for 1,000 documents on the pricing page.

REST fallback: no MCP required

If your agent framework does function calling but not MCP, wrap the REST endpoint as a tool. It is one POST, synchronous, PDF bytes in the response:

curl -X POST https://slipstack.dev/api/v1/pdf \
  -H "Authorization: Bearer $SLIPSTACK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice",
    "data": {
      "from": { "name": "Acme Inc", "email": "billing@acme.com" },
      "to":   { "name": "Globex LLC" },
      "number": "INV-2026-0142",
      "items": [
        { "description": "Agent workflow audit", "quantity": 1, "unitPrice": 1200 }
      ],
      "taxRate": 8.5
    }
  }' --output invoice.pdf

The JSON shape is identical to the MCP tools, so you can prototype over MCP and ship over REST, or the other way around. Full schema in the API docs.

Patterns that work today

  • Billing copilot: a support or sales agent that closes a conversation by generating the invoice and dropping the link in the thread.
  • Back-office automation: an agent watching a payments webhook generates the receipt PDF and attaches it to the confirmation email.
  • Personal workflows: freelancers asking Claude to invoice a client by name, with the agent pulling rates and hours from context.

FAQ

Why can't the LLM just write the invoice itself?

A language model can draft invoice text, but it cannot emit a well-formed PDF binary, and it should not be trusted with arithmetic that reaches a customer. Slipstack's MCP tools make the agent's job purely descriptive: it passes parties, line items, and a tax rate, and a deterministic renderer computes the totals and produces the PDF.

Do I need an API key to try MCP invoice generation?

No. Anonymous use is metered at 10 documents per day per IP, so you can add the connector and generate a real invoice without signing up. For production, pass a Slipstack API key: the free plan covers 50 documents/month and paid plans start at $19/month.

Which clients can connect to the Slipstack MCP server?

Any MCP client that speaks streamable HTTP: Claude on web and desktop (as a custom connector), Claude Code, Cursor, and most agent frameworks with MCP support. There is nothing to install; the server is remote.

What if my agent framework doesn't support MCP?

Use the REST API directly as a function-calling tool. One POST to /api/v1/pdf with the same JSON shape returns the finished PDF synchronously. The docs page has the full schema.

Where does the generated PDF go?

MCP tool calls return a download URL that is valid for 24 hours, plus the computed totals, so the agent can hand the link to a user or pass it to the next step. The REST API returns the PDF bytes directly in the response.

Give your agent a paper trail

Connect the MCP server in one minute, or grab a free API key: 50 documents a month, no card.

Related reading