# Invoice MCP server for AI assistants

> Connect an AI assistant to Potion Papers over MCP: the server URL, how the OAuth connection works, every tool, and which actions wait for your approval.

Potion Papers runs a remote MCP server, so the assistant you already use can do your invoicing: find the customer, draft the invoice, finalize it and ask to send it. Nothing is emailed, marked paid or voided until you approve it.

Page: https://potionpapers.com/docs

## The server

Add it as a custom connector or MCP server in Claude, ChatGPT, Cursor or any other client that supports remote MCP servers with OAuth sign-in.

- Server URL: `https://potionpapers.com/mcp`
- Transport: Streamable HTTP
- MCP revisions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26
- Sign-in: OAuth 2.1 with PKCE, in your browser
- Authorization server: `https://potionpapers.com/api/auth`
- Scopes: `workspace:read`, `workspace:write`

## Connecting

1. Add `https://potionpapers.com/mcp` to your assistant as a remote MCP server. There is no key to copy.
2. The assistant registers itself and opens Potion Papers in your browser. Sign in. A guest workspace cannot connect an assistant, so create a free account first.
3. Read the consent screen. It lists the businesses the connection covers and says whether the assistant asked to read only or to read and edit. Approve it.
4. The assistant can now call the tools below. To cut it off, open Settings and disconnect it under Connected assistants; it loses access at once.

For example, in Claude Code:

```bash
claude mcp add --transport http potionpapers https://potionpapers.com/mcp
```

| Scope | What it allows |
| --- | --- |
| `workspace:read` | Read your businesses, customers, invoices and credit balance. |
| `workspace:write` | Create and edit customers and invoice drafts, finalize invoices, and file requests that wait for your approval. |

If you are writing a client: a request without a token gets `401` and a `WWW-Authenticate` header that names the protected resource metadata. Identify the client with a Client ID Metadata Document or dynamic client registration. Access tokens are bound to the server URL above, so connect through exactly that URL.

- [Server card](https://potionpapers.com/.well-known/mcp/server-card.json)
- [Protected resource metadata](https://potionpapers.com/.well-known/oauth-protected-resource)
- [Authorization server metadata](https://potionpapers.com/.well-known/oauth-authorization-server)
- [API catalog](https://potionpapers.com/.well-known/api-catalog)

## What it can do

One connection covers every business you own, so every tool except `list_accounts` takes an `accountId` naming the business it acts on.

### Reads (8)

- `list_accounts` (List accounts): List the user's Potion Papers accounts (billing entities they invoice from), with names and invoice numbering. Every other tool takes an accountId from here: when the user names a business ("invoice Fluent from Samyak"), match it to an account name. Ask when the account is unclear instead of guessing. Inputs: none.
- `get_account` (Get account): Get one account's name and invoice numbering. Inputs: `accountId`.
- `list_customers` (List customers): List or search an account's customers by name, email, phone, or id. Results are paged: pass nextOffset as offset to continue. Inputs: `accountId`, `query` (optional), `limit` (optional), `offset` (optional).
- `get_customer` (Get customer): Get one customer by id, as returned by list_customers. Inputs: `accountId`, `customerId`.
- `list_invoices` (List invoices): List an account's invoices, newest first, without line items. Filter by exact customerId, status, or period (previous_calendar_month for "last month's invoice"), or search by number or customer. Resolve the customer with list_customers first. Amounts are integer minor units. Paged like list_customers. Inputs: `accountId`, `customerId` (optional), `status` (optional), `period` (optional), `query` (optional), `limit` (optional), `offset` (optional).
- `get_invoice` (Get invoice): Get one invoice with its line items, customer, totals (integer minor units), and website and PDF links. Inputs: `accountId`, `invoiceId`.
- `get_credit_balance` (Get credit balance): Get an account's prepaid credit balance. Sending invoice email costs credits; check before a send if the balance may be low. Inputs: `accountId`.
- `get_approval` (Get approval): Check a request filed by send_invoice_email, mark_invoice_paid, or void_invoice: pending, declined, expired, executed (with the result), or failed (with the reason). Pass waitSeconds to wait briefly for the owner's decision. Inputs: `accountId`, `approvalId`, `waitSeconds` (optional).

### Changes it makes directly (3)

- `save_customer` (Save customer): Create a customer, or update one by passing its customerId. Check list_customers first to avoid duplicates. Inputs: `accountId`, `customerId` (optional), `name`, `email` (optional), `phone` (optional), `currency` (optional).
- `prepare_invoice` (Prepare invoice draft): Create, duplicate, revise, or reissue an invoice draft. Drafts are never sent or numbered until finalize_invoice. Reissue moves an open invoice to a different customer: the draft keeps the original's number and the original is voided when the draft is finalized. Prices and discounts are integer minor units; dates are YYYY-MM-DD. Show the user the draft and its pageUrl. Inputs: `accountId`, `operation`, `customerId` (optional), `sourceInvoiceId` (optional), `replacesInvoiceId` (optional), `invoiceId` (optional), `issueDate` (optional), `dueDate` (optional), `dueDays` (optional), `lineItems` (optional), `discountMinor` (optional), `extraHeaderFields` (optional).
- `finalize_invoice` (Finalize invoice): Finalize a draft invoice: assigns its invoice number and makes the PDF available. Only when the user clearly asks to finalize; state which draft first. Inputs: `accountId`, `invoiceId`, `numberOverride` (optional).

### Requests that wait for you (3)

- `send_invoice_email` (Request invoice email): Ask the owner to approve emailing a finalized invoice (PDF attached) to its customer or `to`. Nothing is sent until the owner approves at the returned approvalUrl; then call get_approval. Sending costs credits. Use mode resend only when the user asks to resend. Inputs: `accountId`, `invoiceId`, `mode` (optional), `to` (optional), `bcc` (optional).
- `mark_invoice_paid` (Request mark paid): Ask the owner to approve recording that an open invoice was paid. Use only when the user says payment was received. It records status only; it does not collect money. Nothing changes until the owner approves at the returned approvalUrl. Inputs: `accountId`, `invoiceId`.
- `void_invoice` (Request void): Ask the owner to approve voiding an issued invoice. To move an invoice to a different customer use prepare_invoice with operation reissue instead. Nothing changes until the owner approves at the returned approvalUrl. Inputs: `accountId`, `invoiceId`.

## What waits for you

Emailing an invoice, marking an invoice paid and voiding an invoice never happen on an assistant's say-so. Those tools only file a request and hand back a link. You open it, signed in, and see which assistant asked, what it wants to do and to which invoice; then you approve or decline. A request you leave alone expires after 24 hours.

Without your approval, an assistant with edit access can call `save_customer`, `prepare_invoice` and `finalize_invoice`: it can add or change customers, prepare drafts and finalize a draft. Finalizing gives the invoice its number, so if you want to look at drafts first, say so. An assistant with read access can only look.

No tool deletes a customer or an invoice, buys credits, changes your settings or collects a payment. Marking an invoice paid records that the money arrived; it does not move any.

A connection may make 120 requests every 60 seconds. Past that the server answers `429` with a `Retry-After` header. Tool calls are not charged for. An email the assistant asks to send costs 1 credit per recipient once you approve it.

## A worked example

You say: “Invoice Acme Studio for three days of design at $1,400 a day, due in two weeks, and email it to them.” The assistant makes these calls.

### 1. list_accounts

Find the business to invoice from. One connection covers every business you own.

```json
{}
```

Returns: Your businesses, each with an id and the number its next invoice will get.

### 2. list_customers

Find the customer by name instead of guessing an id.

```json
{
  "accountId": "account_01m8dtar08ev6tak0cm4h4yqk0",
  "query": "Acme"
}
```

Returns: One match, Acme Studio, with its id, email and currency.

### 3. prepare_invoice

Create a draft. Money is in minor units, so $1,400.00 is 140000.

```json
{
  "accountId": "account_01m8dtar08ev6tak0cm4h4yqk0",
  "operation": "create",
  "customerId": "customer_01m8dtar08fqv83vcqhtpbzjvc",
  "dueDays": 14,
  "lineItems": [
    {
      "description": "Design, per day",
      "quantity": "3",
      "unitPriceMinor": 140000
    }
  ]
}
```

Returns: The draft with its totals (420000, which is $4,200.00) and a pageUrl the assistant shows you. A draft has no number and has not been sent.

### 4. finalize_invoice

You said to send it, so the draft is finalized: it gets its number and a PDF.

```json
{
  "accountId": "account_01m8dtar08ev6tak0cm4h4yqk0",
  "invoiceId": "invoice_01m8dtar08fwrt3mmd19v9tw7g"
}
```

Returns: The invoice, now open, numbered INV-0008, with a pdfUrl.

### 5. send_invoice_email

Ask to email it. This does not send anything.

```json
{
  "accountId": "account_01m8dtar08ev6tak0cm4h4yqk0",
  "invoiceId": "invoice_01m8dtar08fwrt3mmd19v9tw7g"
}
```

Returns: A pending request and the approvalUrl where you approve or decline it, signed in to Potion Papers.

```json
{
  "status": "pending_approval",
  "approvalId": "approval_01m8dtar08e4e85k16wj5gdryq",
  "approvalUrl": "https://potionpapers.com/approvals/approval_01m8dtar08e4e85k16wj5gdryq",
  "expiresAt": "2026-11-28T09:30:00.000Z",
  "invoice": {
    "id": "invoice_01m8dtar08fwrt3mmd19v9tw7g",
    "number": "INV-0008",
    "status": "open",
    "customer": {
      "id": "customer_01m8dtar08fqv83vcqhtpbzjvc",
      "name": "Acme Studio",
      "email": "accounts@acme.example",
      "phone": null,
      "currency": "USD"
    },
    "issueDate": "2026-11-27",
    "dueDate": "2026-12-11",
    "subtotalMinor": 420000,
    "discountMinor": 0,
    "totalMinor": 420000,
    "sentAt": null,
    "pageUrl": "https://potionpapers.com/invoices/invoice_01m8dtar08fwrt3mmd19v9tw7g",
    "pdfUrl": "https://potionpapers.com/invoices/invoice_01m8dtar08fwrt3mmd19v9tw7g/pdf"
  },
  "message": "Nothing has happened yet. Ask the owner to approve sending this invoice at https://potionpapers.com/approvals/approval_01m8dtar08e4e85k16wj5gdryq, then call get_approval with this approvalId."
}
```

### 6. get_approval

Wait for your decision, then report only what it confirms.

```json
{
  "accountId": "account_01m8dtar08ev6tak0cm4h4yqk0",
  "approvalId": "approval_01m8dtar08e4e85k16wj5gdryq",
  "waitSeconds": 20
}
```

Returns: Once you approve, the status is executed and the result holds the invoice as sent. If you decline, or the request expires, nothing was sent.

## Conventions

- Amounts are integers in minor currency units: USD 125.50 is 12550.
- Dates are ISO 8601, YYYY-MM-DD.
- Ids come from the list tools. Call `list_accounts` first and never invent an id.
- Show the user a draft and its pageUrl before finalizing, and finalize only when they ask.
- After a request that waits for approval, give the user the approvalUrl, call `get_approval` and report only what it confirms.

This page as markdown: [/docs.md](https://potionpapers.com/docs.md). The whole site in one file: [/llms-full.txt](https://potionpapers.com/llms-full.txt).
