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.
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.)
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.
terminalclaude mcp add --transport http orizu "https://orizustudio.co.uk/products/ai-invoice-generator/api/mcp"
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-codeclaude > /mcp > orizu → Authenticate > [browser pops · click Allow] > orizu — ✓ Connected
Step 3
Try a tool
Ask Claude to use orizu. The instructions string tells the assistant exactly which tool to call.
promptUsing 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/mcpAnthropic's CLI. The recommended install path — one terminal command, then run /mcp → orizu → Authenticate to trigger the browser OAuth flow.
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):
/.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 -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_invoiceCreate a new draft invoice from a freeform brief plus structured line items. Auto-fills From: fields from your saved profile.
get_invoiceFetch a single invoice by UUID or invoice number.
update_invoiceEdit any field on an existing invoice.
list_invoicesList invoices. Filter by status, client (partial match), or issue-date range.
list_overdue_invoicesUnpaid invoices whose due date has passed.
list_unpaid_invoicesAll not-yet-Paid invoices (Draft + Sent + Overdue).
mark_invoice_sentTransition Draft → Sent.
mark_invoice_paidTransition to Paid. Auto-evaluates any conditional discounts that depended on payment timing.
mark_invoice_unpaidUndo a Paid mark — defaults to reverting to Sent.
delete_invoicePermanently delete an invoice. Confirm with the user first.
attach_payment_linkMint a Stripe Payment Link and attach it to an invoice.
get_invoice_pdf_urlSigned Supabase URL to the rendered PDF (90-day expiry). Auto-regenerates if stale.
regenerate_invoice_pdfForce-render the PDF from current invoice state. Useful after a template change.
get_invoice_share_linkShort branded URL at /p/{slug} — never expires.
send_invoice_reminderSend 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_clientInsert or update a client in the address book. Pass id to update; omit to insert.
list_clientsQuery saved clients. Optional case-insensitive partial-match search.
get_clientFetch a single client by UUID.
list_recent_clientsClients 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_invoiceSet up a recurring schedule. Cadence: weekly / monthly / quarterly / yearly.
list_schedulesList active / paused / canceled schedules.
pause_schedulePause a schedule — the cron skips it until resumed.
resume_scheduleResume a paused schedule and re-arm the next run.
cancel_scheduleCancel 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_reminderAttach an auto-reminder cadence to an invoice (default: every 7 days, up to 3 sends, escalating friendly → neutral → firm).
list_reminder_schedulesList reminder schedules. Filter by status or invoice_id.
pause_reminder_schedulePause a reminder schedule — cron skips it until resumed.
resume_reminder_scheduleResume a paused reminder schedule and re-arm the next run.
cancel_reminder_scheduleCancel permanently. Already-sent reminders stay in the audit log.
Reporting
Aggregates over the user's invoice data plus live foreign-exchange.
get_period_summaryAggregate totals + top clients + currency mix for a date range.
fx_rateLive FX rate (ECB-backed) between two currencies. Optional amount → converted figure.
Account
Plan + diagnostic surface for the connected user.
get_usageCurrent billing-period PDF API + MCP usage vs plan caps.
doctorSelf-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:
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.”