Cash Runway MCP server
@cashrunway/mcp is a Model Context Protocol server that hands your Cash Runway data to any MCP-capable AI client (Claude Desktop, Cursor, Continue, your own agent harness) over stdio. The server is read-only — it never writes to your Cash Runway account.
Once configured, you can ask the agent things like:
- "How's my business doing today?"
- "What's my YTD revenue?"
- "Who are my top 5 customers?"
- "What invoices are overdue?"
- "How much have I spent on AWS this quarter?"
The server registers a set of tools that map 1:1 onto the Agent API. LLMs are biased toward the first few tools in the list — the three new summary tools sit at the top so an agent asking "how much…" or "who's top…" reaches for an aggregate endpoint before paging through individual records (50× cheaper on tokens).
Install
npm install -g @cashrunway/mcpRequires Node.js ≥ 20. Or run without installing globally via npx -y @cashrunway/mcp.
Get an API token
Sign in to Cash Runway.
Open Settings → API keys and click Create API key.
Give the key a label (e.g. "Claude — finance assistant").
Tick the scopes the agent needs. Pick the narrowest set that does the job — every scope is a separate decision:
Scope What it unlocks READ_BANKBank accounts and balances. READ_FORECASTCash position + 13-week forecast. READ_PIPELINEProjected revenue (pipeline view). READ_INVOICESAR invoices + AP bills, with optional line-item expansion. READ_CONTACTSCustomer / supplier list and the per-contact drill (LTV, cadence, ABC). READ_SUMMARYThe composite daily-summaryendpoint plus the three new aggregate summaries (revenue/summary,expenses/summary,contacts/summary). Strongly recommended starting point.READ_SENSITIVEDanger zone. Lifts the redaction filter on accounts / contacts the operator has flagged sensitive (wages, equity, director loans). Off by default — only enable for keys you fully trust. Copy the secret. The token starts with
cr_live_…and is shown once — Cash Runway stores a one-way hash and cannot reveal it again. See API keys for rotation, audit, and the sensitive-data toggle.
Configure your MCP client
The server reads two environment variables:
| Variable | When | Example |
|---|---|---|
CASHRUNWAY_API_URL | Always | https://api.cashrunway.ai |
CASHRUNWAY_API_KEY | Single company (most users) | cr_live_xxxxxxxxxxxxxxxxxxxx |
CASHRUNWAY_API_KEYS | Multiple companies (advanced) | {"acme":"cr_live_…","globex":"cr_live_…"} |
Set exactly one of CASHRUNWAY_API_KEY or CASHRUNWAY_API_KEYS — setting both is a configuration error.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"cashrunway": {
"command": "cashrunway-mcp",
"env": {
"CASHRUNWAY_API_URL": "https://api.cashrunway.ai",
"CASHRUNWAY_API_KEY": "cr_live_xxxxxxxxxxxxxxxxxxxx"
}
}
}
}If you'd rather not install globally, swap "command": "cashrunway-mcp" for "command": "npx" with "args": ["-y", "@cashrunway/mcp"]. Restart Claude Desktop — the tools appear under the 🔧 icon.
Cursor
Edit ~/.cursor/mcp.json (or the per-project .cursor/mcp.json):
{
"mcpServers": {
"cashrunway": {
"command": "cashrunway-mcp",
"env": {
"CASHRUNWAY_API_URL": "https://api.cashrunway.ai",
"CASHRUNWAY_API_KEY": "cr_live_xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Continue (VS Code / JetBrains)
Edit ~/.continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "cashrunway-mcp",
"env": {
"CASHRUNWAY_API_URL": "https://api.cashrunway.ai",
"CASHRUNWAY_API_KEY": "cr_live_xxxxxxxxxxxxxxxxxxxx"
}
}
}
]
}
}Tool reference
The tools below are registered in this relative order. Tool ordering is load-bearing — LLMs preferentially pick the first tool that plausibly fits the question, so the three aggregate summary tools sit at the top.
Summary tools (start here)
| Tool | Purpose | Example prompt |
|---|---|---|
cashrunway_get_revenue_summary | AR totals + by-status + by-month + top customers, with no individual records. 50× cheaper on tokens than paging through list_invoices for aggregate questions. | "What's my YTD revenue and who are my top 10 customers?" |
cashrunway_get_expenses_summary | AP-side mirror of get_revenue_summary. | "What did I spend last quarter by month? Top 5 suppliers?" |
cashrunway_get_contacts_summary | Contact-population aggregates: byType, ABC distribution (80/20 tiering), top customers by LTV, top suppliers by spend. | "How many customers do I have? Show me my ABC tier breakdown." |
cashrunway_get_daily_summary | Composite "how's my business going today?" surface — cash today, last-7d activity, AR aging, 13-week forecast headline, prose narrative field. Best single-call session bootstrap for a generic assistant. | "How's my business doing today?" |
Snapshot tools
| Tool | Purpose | Example prompt |
|---|---|---|
cashrunway_get_status | Subscription, key scopes, environment, and the creditSummary — your remaining query credits on the rolling 5-hour window plus a reset estimate. Not a daily quota: the reset is minutes away, never "tomorrow". Exempt from credit counting, so it is safe to poll on session start and to pace a batch against. | "How many credits do I have left, and when do they reset?" |
cashrunway_get_cash_position | Today's cash across all bank accounts, with per-account breakdown. | "How much cash do I have right now?" |
cashrunway_get_forecast | 13-week forecast — opening, inflow (with optional guaranteed/forecast split), outflow, net, closing. | "When do I run out of cash?" |
cashrunway_get_bank_accounts | List of configured bank accounts with reconciled + statement balances. | "What bank accounts is Cash Runway tracking?" |
List tools (for record-level drill-in)
| Tool | Purpose | Example prompt |
|---|---|---|
cashrunway_list_invoices | AR invoices, filterable by status / contact / date range / sent. Supports autoPaginate: true (one call, up to 5,000 rows) and totals: true (byStatus + grandTotal across the full filtered set). Add lines: true for line-item expansion, credits: true for credit-note links. Every row carries sent, amountDue, amountPaid. | "Which invoices did we raise but never send?" / "What does Globex actually still owe?" |
cashrunway_list_purchase_orders | Xero purchase orders (PO-####) raised against suppliers, filterable by raw Xero status / contact / itemCode / issue-date range. Same autoPaginate + totals flags. Each row carries itemCodes and suppressedReason. Requires the dedicated READ_PURCHASE_ORDERS scope. | "Which purchase orders commit us to item ZC-RELAY?" |
cashrunway_get_purchase_order | Drill into one purchase order by Xero GUID or PO-#### number: adds lineItems (description, quantity, unit amount, line amount, itemCode, accountCode). | "What's on PO-0042?" |
cashrunway_list_quotes | Xero sales quotes (QU-####), filterable by raw Xero status (an array of DRAFT, SENT, DECLINED, ACCEPTED, INVOICED, DELETED), contactId, createdBy (part of the creator's name, case-insensitive), issue-date range (dateFrom/dateTo) and expiry-date range (expiryDateFrom/expiryDateTo). limit 1-200 (default 50), cursor (opaque; ignored with autoPaginate), autoPaginate and totals as for invoices. Dates take YYYY-MM-DD, or an ISO-8601 timestamp ending in Z or a numeric offset (e.g. +11:00); anything else, including a timestamp with no zone, is rejected before the request. DELETED is excluded unless you ask for it in status. totals.grandTotal sums every returned status, so filter status: ["DRAFT","SENT"] for the open quoted value (mixed currencies come back as a mixedCurrency block instead of a sum). Requires the dedicated READ_QUOTES scope. | "What is our open quoted value?" / "Which sent quotes expire this month?" |
cashrunway_get_quote | Drill into one quote by Xero GUID (id) or quote number: adds terms and lineItems (description, quantity, unit amount, line amount, discount rate, tax amount, itemCode; no account code). | "What's on QU-0042?" |
cashrunway_list_bills | AP bills — same shape and flags as list_invoices. | "Which bills are due this week?" |
cashrunway_list_credit_notes | Credit notes — customer (AR, CN-####) by default; the API also serves supplier (AP) credits via type (customer / supplier / all), with every row carrying type. Filterable by status / contact / date range, plus invoiceNumber / invoiceExternalId for the reverse lookup. Same autoPaginate + totals flags. | "What credited invoice LR-4359?" |
cashrunway_get_credit_note | Drill into one credit note (customer or supplier) by Xero GUID or number: adds lineItems and allocations. A number shared by several credit notes returns an ambiguous error listing each candidate's externalId — re-ask by GUID. | "What's on CN-0441?" |
cashrunway_list_contacts | Customers and suppliers; sort by revenue_desc / spend_desc / recent_desc. Same autoPaginate + totals flags (totals are count-only for contacts — no $ axis). | "List my top 20 customers by revenue." |
cashrunway_get_contact | Drill into one contact: LTV, payment cadence, payment-days median, ABC tier, last invoice / bill, recent paid invoices. | "Tell me about my relationship with Globex." |
A meta-tool, cashrunway_list_companies, is only registered when the server runs in multi-tenant mode (see below).
Invoice send status (sent)
cashrunway_list_invoices returns sent on every row — whether the invoice was ever sent to the customer, from Xero's SentToContact. Pass sent: false to find invoices raised but never delivered: money the customer has never actually been asked for. It ANDs with the status / contactId / date filters and narrows totalCount and totals alongside the rows.
It has three states, and conflating two of them produces false accusations:
| Value | Meaning |
|---|---|
true | Sent, or marked as sent by hand in Xero. Not proof an email was delivered. |
false | Never sent. The actionable state. |
null | Unknown — not yet checked against Xero (records predating this field). The one-off backfill covers open invoices only, so paid history stays unknown until a sync happens to touch it. |
- Never report
nullas "not sent". It means nobody has looked, not that the invoice was never delivered. Saying otherwise tells an operator they failed to bill a customer they did bill. - The filter matches exactly, so
sent: falsereturns only known-unsent rows and never leaksnullones. A small or empty result on an org that hasn't been backfilled is correct, not a bug. - Always
nulloncashrunway_list_bills— you don't send a supplier their own bill. That tool accepts nosentfilter, so never answer "which bills did we never send?" from it; every bill readsnull, which means unknown, not unsent. - An org where every row is
nullsimply hasn't been backfilled yet. Say that, rather than reporting that nothing has been sent.
Outstanding balances (amountDue / amountPaid)
cashrunway_list_invoices and cashrunway_list_bills return amountDue (what is still owed) and amountPaid (cash received) alongside amount.
Chase on amountDue — but know why, because amount is probably not what you assume. On an open invoice, amount carries the same number as amountDue; it is not an independent face value. Once the invoice settles it is usually rewritten to the gross total — though not dependably, since an invoice settled by a payment we saw before we re-read the invoice keeps the balance it already had.
Treat amount as not a trustworthy figure on its own: never report a sum of it as invoiced revenue or AP spend. totals: true aggregates the same field, so it carries the same caveat rather than solving it. If asked what was invoiced rather than what is owed, say the available figure is balance-based and name the limitation.
amountDue is the field to read, for two reasons that hold regardless:
- Honest nulls. Where Xero gave us no balance,
amountsays0— which reads as "settled" — whileamountDuesaysnull, meaning unknown. Never rendernullas0; say "we haven't checked". - Stable meaning.
amountDuemeans outstanding on every row, whatever the status.amountdoes not.
amountPaid is nullable on the same rule. Never derive it as amount − amountDue: on an open invoice those are the same figure, so you get 0 no matter how much has been paid.
A paid invoice can come back with amountDue: null. When we see a payment for an invoice we have not re-read, we settle the row and retract both money fields to null rather than leave figures that predate the payment — those would show a balance owing on a row the same response calls PAID. We do not write 0 either: one payment does not prove the invoice is settled in full. So null on a paid row means "not re-read yet", and a later sync resolves it.
Credit notes applied to an invoice
Two ways to answer "was this invoice credited down?", and both of them are asking rather than inferring — that is the point:
- From the invoice — pass
credits: truetocashrunway_list_invoices/cashrunway_list_bills. Each row gainscreditedAmountandcreditNotes[](number, allocation date, amount applied). One call, no search. - From the credit-note side —
cashrunway_list_credit_notesacceptsinvoiceNumber/invoiceExternalId, returning only the credits allocated to that invoice.
Do not try to spot a credit from the amounts. Because amount and amountDue hold the same figure on an open invoice, amount − amountDue − amountPaid gets it wrong in both directions:
| Situation | amount | amountDue | amountPaid | The subtraction |
|---|---|---|---|---|
| Open, $296.12 credited down to $22 | 22 | 22 | 0 | 0 — misses the credit |
| Open, $500 with $200 paid in cash | 300 | 300 | 200 | −200 — invents a credit |
The second row is the dangerous one: you would tell an operator an invoice had been credited, and creditedAmount: "0" would contradict you on the next call. On a paid invoice, amountDue: "0" with amountPaid: "0" is a fair hint that a credit note closed it — still confirm with credits: true before saying so.
creditedAmount follows the same three-state discipline: "0" means known-and-none, null means unknown. Both keys are absent when credits: true isn't passed, so their null never means "you didn't ask". Voided credit notes are excluded from the total. Without the sensitive-data scope, a sensitive credit note (sensitive contact, or a line on a sensitive account) is left out of creditNotes[] and creditedAmount becomes null, which withholds the itemisation (the amount may still be inferable from the invoice's own figures). If creditNotes is an array with no null-amount entries, say "credit has been applied that this key cannot see"; a null-amount entry makes it ambiguous, since both can happen at once.
null is not a "wait and it'll fill in" state. An org that has never had a credit note holds no allocation rows either, so it reads nullpermanently — there is nothing pending and nothing to wait for. Report null as "no credit-note data recorded for this org", never as "the backfill is still running": telling an operator their data is still arriving, every day, forever, is the same false-certainty failure this field exists to prevent, just pointed the other way.
Store invoice numbers in their full Xero form when looking them up — 00007717, not 7717. The match is exact, and a short-form lookup reports a credit as absent when it is not.
Voided and deleted documents
Voided documents are kept as tombstones and carry voidedAt (when the sync observed the void — Xero does not expose when the operator performed it). They are excluded from every list by default, including from totalCount and totals, and appear only when you name VOIDED or DELETED in status.
So "no invoice matching LR-4371A" is now a reportable fact rather than a hedge — with two limits worth stating out loud when you report it:
- History reaches back 90 days, or to the sync cursor if that is earlier. Documents voided before this feature shipped were deleted and are gone.
- As a filter,
VOIDEDandDELETEDare aliases — both select every tombstone. Read each row'sxeroStatusto tell a cancelled document from a discarded draft.
Client version
These fields ride the agent API and the MCP/CLI clients mirror them in a paired release. On an older client Zod silently strips them from the wire, and a running MCP server must be restarted after upgrading.
Contact reachability (email) and account classification
An AR chase needs a send-to address. GET /api/agent/contacts now returns email, accountNumber, contactStatus and contactDetailsSyncedAt on every row, and GET /api/agent/contacts/{id} adds contactPersons, paymentTerms and contactGroups. Same READ_CONTACTS scope as before — no new scope, no key re-mint.
Take the addresses off the list call, not from a drill per contact. A sweep over 40 customers is one list_contacts call, not 1 + 40. The drill is for when you also need contact persons, payment terms or contact groups.
null means UNKNOWN — never "none". Read it against contactDetailsSyncedAt, the provenance stamp recording when the contact's details were last read from Xero:
email | contactDetailsSyncedAt | What you may say |
|---|---|---|
| an address | any | Send to it. |
null | a timestamp | "Xero holds no AR contact for this customer." State it plainly — no hedge. |
null | null | "We haven't read this contact's details from Xero yet." Never "they have no email." |
contactDetailsSyncedAtis notlastSyncedAt. The latter only records when the row was last touched and is set on every contact, including ones whose detail fields have never been read.contactPersonsandcontactGroupsdistinguish[](Xero confirms there are none) fromnull(never read). Don't conflate them.paymentTermsis always present, withnullleaves — an absent term isnull, never0. Together withaccountNumberandcontactGroupsit answers "is this counterparty on account, or prepay?"; prefer all three over inferring from any one.- Archived contacts are excluded from
list_contactsandget_contacts_summaryby default — archiving in Xero says the relationship is finished, so they don't belong on a chase list. PassincludeArchived: trueto see them. The drill still returns an archived contact by id; checkcontactStatus. - Until the one-off contact-details backfill runs for an org, every row reads
contactDetailsSyncedAt: null. That is "not yet synced", not "no contacts on file" — say so.
These fields need MCP 0.1.10 or newer. The MCP server validates responses against its own schema and silently drops fields it does not know, so an older server returns none of this even against an up-to-date API — and a running server keeps the version it started with. If a field documented here is missing, check the server version and restart it before assuming the data is absent.
Purchase-order item codes
cashrunway_list_purchase_orders returns itemCodes on every row — the distinct Xero item codes across that PO's line items, stored verbatim, so an agent can see which items a PO covers without a drill per PO. It is always an array ([] when the PO has no coded lines), so no null branch is needed.
Pass itemCode to return only POs containing that code. It ANDs with the status / contactId / date filters and narrows totalCount and totals alongside the rows.
- Matching is fully case-insensitive in both directions —
zc-relayfinds a PO stored asZC-RELAY, and a mixed-case stored code such asTCI-DALI Supply Fit Leadsis found by any casing of the query. - Single value only. Unlike
status,itemCodeis not comma-split — a comma-separated list matches nothing.
suppressedReason is unrelated to item codes: when non-null the PO has been matched to a supplier bill and is excluded from the cash-flow forecast to avoid double-counting the outflow.
Quotes
cashrunway_list_quotes and cashrunway_get_quote need the dedicated READ_QUOTES scope. It is not implied by READ_INVOICES: a key that can read invoices and bills cannot read quotes unless the scope was granted explicitly. Quotes are read-only and do not feed the forecast.
- Status. With no
statusthe server returns every status exceptDELETED; passstatus: ["DELETED"](alone or with others) to include them.totals.grandTotalsums every returned status, so for "open quoted value" passstatus: ["DRAFT","SENT"]. - Sensitive customers. Quotes whose customer is marked sensitive are excluded from
quotes,totalCountandtotalsunless the key carriesREAD_SENSITIVE.redactedItemCounton the list response is a 0/1 flag, not a count:1means this organisation has quotes withheld from this key, independent of the filters; it is always0withREAD_SENSITIVE.cashrunway_get_quoteon a withheld quote is a not-found error, the same as an unknown id. - Paging. Default mode returns at most
limitrows (default 50, max 200) plus an opaquenextCursor; loop until it isnull, passing back the exactnextCursorfrom the previous page. A malformed or made-up cursor is not rejected and gives unpredictable results (it may restart from the first page or return nothing). WithautoPaginate: truethe server returns every match in one response (capped at 5,000,truncated: trueon overflow) and acursorpassed alongside it is ignored. - Dates.
dateFrom,dateTo,expiryDateFromandexpiryDateToare inclusive and take a bareYYYY-MM-DD, or an ISO-8601 timestamp ending inZor a numeric offset (2026-07-31T00:00:00Z,2026-07-31T00:00:00+11:00). The tool rejects anything else before calling the server: a timestamp with no zone (2026-12-03T10:00:00), an impossible date such as2026-13-40, and any other format. The server silently ignores a date it cannot parse (the list comes back unfiltered), and it would read a zone-less timestamp in its own local timezone, shifting the boundary. - Money. Amounts are decimal strings in the quote's own
currency;totalis tax-inclusive.subTotal,totalTaxandtotalDiscountarenullwhen Xero did not send them, never"0". - Numbers are not unique. A quote-number lookup prefers a non-deleted quote, then the most recently updated.
lineItemsisnullwhen not yet fetched and[]when fetched with no lines. - People. Each quote carries
createdBy/createdAt,lastEditedBy/lastEditedAtandlastSentBy/lastSentAt. Xero has no such fields on a quote, so the names come from its quote history: they arenulluntil that history has been fetched (newest quotes first, a batch per sync), or when Xero has no such event (a quote never edited has nolastEditedBy).createdByis who raised the quote in Xero, which is not always the deal owner.createdAtis the Xero creation time. ThecreatedByinput matches part of the creator's name, ignoring case, and narrows the rows,totalCountandtotalstogether; quotes with no history yet never match.
Quote tools need MCP 0.3.0 or newer; the people fields and
createdByneed 0.3.1. A running server keeps the version it started with and silently drops fields it does not know.
Example prompts the agent should reach for first
These five questions cover ~80% of the agent's day-one usage. Each maps to one or two tools; the rest of the surface is for follow-up drills.
- "How's my business doing today?" →
get_daily_summary. - "What's my YTD revenue?" →
get_revenue_summary(nodateFrom/dateTo— defaults to the current financial-year YTD). - "Who are my top 5 customers?" →
get_revenue_summarywithtopN: 5, orget_contacts_summaryfor LTV-based tiering. - "What invoices are overdue?" →
list_invoiceswithstatus: "AUTHORISED"and atodate in the past. - "How much have I billed this month?" →
get_revenue_summarywithdateFrom/dateToset to the calendar month.
Pagination and token savings
Three flags / fields exist on the list tools to keep agent-driven calls cheap and correct:
totalCount(always present in every list response) — the pre-redaction count of rows matching the filter. Cheapest way to answer "how many?" without paying forautoPaginateortotals. May exceed the page array length when sensitive contacts/accounts are dropped — seeredactedItemCountfor the delta.autoPaginate: true— the server walks every page of the filtered set in one response, capped at 5,000 rows. If the cap is hit, the response setstruncated: trueand the agent should dropautoPaginateand fall back to cursor pagination. Replaces the cursor-loop pattern for "give me everything matching this filter".totals: true— folds an opt-inbyStatus+grandTotalaggregation across the full filtered set into the response (not just the current page). Lets an agent answer "how much is outstanding on AR?" without scanning rows. Multi-currency sets short-circuit tomixedCurrency: true(no fake cross-currency sum); matched sets above 100,000 rows settotalsTruncated: trueand the agent should narrow the filter.
When the question is aggregate ("how much / how many / who's top"), the summary tools are still the right answer — they're ~50× cheaper than even a totals: true list call because they don't ship row records at all.
Sensitive-data handling
By default, the server drops contacts and accounts the operator has flagged sensitive from list endpoints and rewrites their display name to "Sensitive contact" / "Sensitive account" on composite endpoints. Totals always reconcile against the operator's ledger — only names are gated. Each response carries a redactedItemCount so the agent knows it's operating on a masked view.
Issue a key with READ_SENSITIVE only when the agent genuinely needs full visibility (e.g. an internal CFO copilot). The scope cannot be added to an existing key — rotate-and-recreate to keep the grant auditable. See Sensitive accounts and contacts for the full audit trail.
Advisory partner keys (multi-client)
Advisors install the same @cashrunway/mcp server — they just authenticate with a partner key instead of a single-org user key. A partner key starts with crun_… and reaches every client org linked to your practice, where a cr_live_… user key is bound to one org. Partner keys are minted in the Partner Portal → API keys, not under an individual business's Settings → API keys. Wire it in exactly like a user key:
{
"mcpServers": {
"cashrunway": {
"command": "cashrunway-mcp",
"env": { "CASHRUNWAY_API_KEY": "crun_…" }
}
}
}Two tools power the partner flow:
cashrunway_list_orgs— call it on connect. It reportskeyKind(PARTNERvsUSER) and the reachable client orgs, returning{ keyKind, orgs: [{ id, name, slug }], summary }. For a partner key the summary reads "Connected as partner → N clients."; for a user key it lists the single org the key belongs to.cashrunway_get_daily_brief— takes a requiredorgargument (anidfromlist_orgs) and returns that client's latest daily brief. Partner keys are multi-client and have no implicit default org, so the agent must name the client per call.
Usage is metered to each client's account. Point the agent at one client at a time by passing its org.
Multi-tenant routing (advanced)
If you manage several Cash Runway companies from one MCP client, set CASHRUNWAY_API_KEYS to a JSON object of {company_key: cr_live_…}. Each tool then exposes an optional company argument that becomes required in multi-tenant mode, and an extra tool cashrunway_list_companies is registered so the agent can discover the configured keys.
Company keys must match ^[a-z0-9_-]+$. Most users are better served by registering the binary once per company under different MCP names — see the MCP README for both patterns side by side.
Related
- API keys — provisioning, rotation, audit, sensitive scope.
- Agent API — endpoint surface and
daily-summarytour. - API Reference — full schema catalogue.
- CLI — same surface as a
cashrunwayshell binary.