Skip to content

Documentation // MCP

Connect your AI agent to Orizu.

Orizu ships a native MCP server — 33 tools covering the full invoice lifecycle, accessible from Claude Code, Cursor, Codex, VS Code, Windsurf, or any MCP-capable client. OAuth 2.1, no API keys to copy, no headers to manage.

MCP-2025-06-18Streamable HTTPOAuth 2.1 + PKCE

Quick Start

Up and running in 30 seconds — install the MCP server in Claude Code, authenticate via browser sign-in, send your first prompt. (Tabs further down cover every other supported client.)

  1. Step 1

    Install the MCP server

    Run this in your terminal — no secrets in the command, so it's safe to paste into chat / screenshare.

    terminal
    claude mcp add --transport http orizu "https://orizustudio.co.uk/products/ai-invoice-generator/api/mcp"
  2. Step 2

    Authenticate

    Start an interactive Claude session, then trigger the OAuth flow. A browser window opens — sign in and click Allow. Token is cached locally; no copy-paste, no secrets in the transcript.

    claude-code
    claude
    > /mcp
    > orizu → Authenticate
    > [browser pops · click Allow]
    > orizu — ✓ Connected
  3. Step 3

    Try a tool

    Ask Claude to use orizu. The instructions string tells the assistant exactly which tool to call.

    prompt
    Using orizu, draft an invoice for Acme Design Collective
    for £6,500 — brand identity refresh, due in 30 days.

    The agent calls draft_invoice, auto-fills the From: block from your saved profile, and returns the invoice number + a public share link.

Installation

Pick your client below. The MCP server URL is the same for everyone — what differs is how each client expects to be told about it.

Server URL

https://orizustudio.co.uk/products/ai-invoice-generator/api/mcp

Anthropic's CLI. The recommended install path — one terminal command, then run /mcp → orizu → Authenticate to trigger the browser OAuth flow.

terminal
claude mcp add --transport http orizu "https://orizustudio.co.uk/products/ai-invoice-generator/api/mcp"

After install, run `claude` to start a session, then type `/mcp` and pick orizu → Authenticate. A browser window opens; click Allow and you're connected. Token is cached locally — re-auth only on a fresh machine.

Authentication

Two paths. Browser sign-in (OAuth 2.1) is recommended for interactive sessions; bearer keys exist for CI / scripted environments where popping a browser isn't feasible.

OAuth 2.1 (recommended)

Triggered automatically on the first tool call (or manually via /mcp → Authenticate in Claude Code). PKCE-only, dynamic client registration per RFC 7591, refresh-token rotation per RFC 6749 §6.

  • Access token TTL: 1 hour
  • Refresh token TTL: 30 days, single-use (rotated on each refresh)
  • Scope: invoices:rw
  • Revocation: from Developer → Connected apps

OAuth discovery endpoints (served at the host root per RFC 8414 §3.1):

oauth discovery
/.well-known/oauth-authorization-server/products/ai-invoice-generator
/.well-known/oauth-protected-resource/products/ai-invoice-generator

Bearer key (for CI / headless)

Mint a key from Developer → API keys. Keys are scoped per integration and revocable. Pass the key in the Authorization header on every request.

curl
curl -X POST "https://orizustudio.co.uk/products/ai-invoice-generator/api/mcp" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ozs_live_…" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Prefixes: ozs_live_ for production, ozs_test_ for sandbox. Never paste a key into a chat transcript — use OAuth instead.

Tools Reference

33 tools, grouped by lifecycle stage. The MCP server's tools/list endpoint returns these with full JSON Schema input definitions — your client renders them as typed parameters automatically.

For a single canonical version of this list as plain Markdown, see /agents.md.

Invoices

Draft, edit, read, and transition invoices through the lifecycle.

draft_invoice

Create a new draft invoice from a freeform brief plus structured line items. Auto-fills From: fields from your saved profile.

get_invoice

Fetch a single invoice by UUID or invoice number.

update_invoice

Edit any field on an existing invoice.

list_invoices

List invoices. Filter by status, client (partial match), or issue-date range.

list_overdue_invoices

Unpaid invoices whose due date has passed.

list_unpaid_invoices

All not-yet-Paid invoices (Draft + Sent + Overdue).

mark_invoice_sent

Transition Draft → Sent.

mark_invoice_paid

Transition to Paid. Auto-evaluates any conditional discounts that depended on payment timing.

mark_invoice_unpaid

Undo a Paid mark — defaults to reverting to Sent.

delete_invoice

Permanently delete an invoice. Confirm with the user first.

attach_payment_link

Mint a Stripe Payment Link and attach it to an invoice.

get_invoice_pdf_url

Signed Supabase URL to the rendered PDF (90-day expiry). Auto-regenerates if stale.

regenerate_invoice_pdf

Force-render the PDF from current invoice state. Useful after a template change.

get_invoice_share_link

Short branded URL at /p/{slug} — never expires.

send_invoice_reminder

Send a payment-reminder email to the client. Three tone presets (friendly / neutral / firm).

Clients

Address-book CRUD. Drafting an invoice with an existing client_id keeps history consistent.

upsert_client

Insert or update a client in the address book. Pass id to update; omit to insert.

list_clients

Query saved clients. Optional case-insensitive partial-match search.

get_client

Fetch a single client by UUID.

list_recent_clients

Clients synthesized from recent invoice history — useful when the address book is empty.

Schedules

Recurring invoice templates. A daily cron materializes one real invoice per due schedule and advances the next-run date by cadence.

schedule_invoice

Set up a recurring schedule. Cadence: weekly / monthly / quarterly / yearly.

list_schedules

List active / paused / canceled schedules.

pause_schedule

Pause a schedule — the cron skips it until resumed.

resume_schedule

Resume a paused schedule and re-arm the next run.

cancel_schedule

Cancel permanently. Already-issued invoices stay untouched.

Reminder schedules

Automated payment-reminder cadence per invoice. A daily cron sends one reminder per due cycle and auto-completes when the invoice is marked Paid.

schedule_reminder

Attach an auto-reminder cadence to an invoice (default: every 7 days, up to 3 sends, escalating friendly → neutral → firm).

list_reminder_schedules

List reminder schedules. Filter by status or invoice_id.

pause_reminder_schedule

Pause a reminder schedule — cron skips it until resumed.

resume_reminder_schedule

Resume a paused reminder schedule and re-arm the next run.

cancel_reminder_schedule

Cancel permanently. Already-sent reminders stay in the audit log.

Reporting

Aggregates over the user's invoice data plus live foreign-exchange.

get_period_summary

Aggregate totals + top clients + currency mix for a date range.

fx_rate

Live FX rate (ECB-backed) between two currencies. Optional amount → converted figure.

Account

Plan + diagnostic surface for the connected user.

get_usage

Current billing-period PDF API + MCP usage vs plan caps.

doctor

Self-diagnostic: confirms OAuth/key validity, profile completeness, and quota headroom.

Profile auto-fill

When an agent calls draft_invoice without explicit From: fields (company, name, email, phone, address, tax/VAT number), the server pulls them from your saved profile. Set those once in Account settings and every future invoice — drafted by you, by an agent, or by a recurring schedule — uses the same letterhead.

If the profile is empty for any required From: field, the server returns a structured response with missing_from_fields and a profile_edit_url. The instructions tell the assistant to either send the user to fill out the profile OR collect the missing fields in chat and re-call with explicit your_company / your_name / your_address args — which are then auto-saved to the profile so it's a one-time ask.

Conditional discounts

Drafting prompt: “Apply a 5% discount if the deposit lands within 7 days.” The MCP records the condition on the invoice. When mark_invoice_paid is called, the server checks whether the payment landed inside the window and auto-applies the discount — recalculating totals and stamping an audit JSONB on the invoice row.

Conditions are stored in discount_conditions on the invoice row. The audit landing in discount_applied (or stays empty when the condition wasn't met) is the proof you can show a client later.

Rate limits

Per-key (or per-OAuth-token) sustained rate is 120 tool calls per minute. Combined REST + MCP monthly cap is set by your plan tier:

Free0 — agent surface gated
Basic — £10/mo2,000 calls / month
Growth — £20/mo10,000 calls / month
Scale — £40/mo50,000 calls / month
Founder — £100 lifetimeUnlimited

Live usage: get_usage returns current-period counts plus a structured breakdown of PDF API vs MCP tool calls. Rate-limit responses include a Retry-After header.

Troubleshooting

Symptom

Server status: Needs authentication

Fix

Expected on first connect. Run /mcp in Claude Code, select orizu, choose Authenticate. Your browser pops — click Allow.

Symptom

Tool call returns 401 missing_authorization

Fix

OAuth token expired or wasn't cached. Re-run /mcp → Authenticate — the refresh-token flow handles silent renewal during the 30-day window, but if that's elapsed you'll need a fresh sign-in.

Symptom

draft_invoice returns missing_from_fields

Fix

Your profile is empty for the required From: fields. Either fill them in at /dashboard/account — a one-time setup — or pass them inline (your_company, your_name, etc.) to draft_invoice and they'll auto-save.

Symptom

HTTP 429 — rate limited

Fix

You've hit the 120-calls-per-minute sustained limit OR the monthly plan cap. Check get_usage for the breakdown. Upgrade plans at /dashboard/billing.

Symptom

OAuth discovery JSON parse error

Fix

Your MCP client is hitting a stale path. The discovery URLs are at the host root (RFC 8414 §3.1) — /.well-known/oauth-authorization-server/products/ai-invoice-generator. If your client computed a different URL, upgrade it or file an issue.

Still stuck?

The doctor tool returns a structured health check (OAuth state, profile completeness, quota headroom). Ask your agent to run it: “Using orizu, run the doctor tool and tell me what's wrong.”

Browse the full prompt cookbook