CashPilot is an AI revenue and cash-flow agent for Xero. It helps a small business owner answer the daily operating question:
What should I do today to increase revenue and avoid a future cash crunch?
The app reads Xero accounting records, forecasts the next 30-90 days, detects revenue leaks, maps messy external sales data back to Xero contacts, and queues human-approved actions such as invoice follow-ups, draft invoices, supplier timing changes, and integration sync tasks.
Northstar Design Studio has a CRM deal called Brightside Studio Ltd - Conversion Sprint for GBP 6,500. In Xero, the customer is called Brightside Studios. A rigid integration would miss the match.
CashPilot:
- Normalises and matches
Brightside Studio Ltdto the Xero contactBrightside Studios. - Checks Xero invoices and finds no matching invoice for the closed-won deal.
- Creates a revenue-leak recommendation: draft a Xero invoice for GBP 6,500.
- Shows the cash impact in the forecast and the approval queue.
- Logs the source IDs
CRM-DEAL-6500andcontact-brightin the audit log.
- Cash-flow forecast with 30, 60, and 90 day horizons.
- Monte Carlo crunch probability shown as a simple risk percentage, plus p10/p50/p90 optimistic-expected-pessimistic bands computed from the same simulation.
- Forecast explainability with ranked business drivers, model cards, and sensitivity analysis.
- Revenue Leak Detector for closed-won-not-invoiced, unmatched external orders, dormant customers, upsell, subscription conversion, late payment recovery, and underperforming services.
- Smart Mapping Review with working approve/reject/new-contact decisions that persist across refreshes and land in the audit log.
- Human approval queue for cash actions, growth actions, productivity automations, and integration syncs — with per-draft message editing and a full PENDING → APPROVED / EDITED / REJECTED decision flow.
- Audit log with source-record traceability for every approved, edited, or rejected recommendation and every mapping decision.
- Xero API footprint panel showing the Accounting API endpoints, scopes, SDK, MCP, and agent-toolkit pattern.
Revenue and Cash Flow Growth CashPilot analyses Xero accounting data, surfaces actionable revenue opportunities, and recommends proactive steps to improve cash flow.
Small Business Productivity Powerhouse CashPilot automates painful workflows such as receipt-to-expense, invoice reconciliation, duplicate bill checks, contractor payment prep, and subscription expense control, with human approval.
Vibe Integrator CashPilot connects Xero with messy CRM, e-commerce, payments, SaaS, and spreadsheet records. The AI-style mapping layer interprets names, fields, amounts, and missing data instead of relying on brittle exact-match rules.
The live path uses Xero OAuth 2.0 through the official xero-node SDK. The app can run in seeded demo mode when Xero login is unavailable, but the data model, endpoints, and UI are built around Xero as the system of record.
openid
profile
email
offline_access
accounting.invoices
accounting.invoices.read
accounting.payments.read
accounting.banktransactions.read
accounting.reports.aged.read
accounting.reports.balancesheet.read
accounting.reports.profitandloss.read
accounting.reports.trialbalance.read
accounting.contacts
accounting.contacts.read
accounting.settings
accounting.settings.read
accounting.reports.read
GET /connections
GET /Organisations
GET /Contacts?summaryOnly=true
GET /Invoices?Statuses=AUTHORISED,PAID
GET /Accounts
GET /Items
GET /Payments
GET /Quotes
GET /BankTransactions
GET /RepeatingInvoices
GET /TrackingCategories
GET /Reports/BankSummary
GET /Reports/ProfitAndLoss
GET /Reports/BalanceSheet
GET /Reports/TrialBalance
GET /Reports/AgedReceivablesByContact
GET /Reports/AgedPayablesByContact
The approval queue is deliberately read-first for the hackathon demo. Approved actions describe the planned writeback, such as creating a draft invoice or contact note, but do not send messages or mutate live accounting data without owner confirmation.
CashPilot separates numeric calculation from agent reasoning:
- Deterministic code handles forecasting, Monte Carlo simulation, payment-delay scoring, smart matching, and ranking.
- The OpenAI Agents SDK path is used for CFO narrative and agent orchestration when
OPENAI_API_KEYis configured. - The Xero MCP bridge is scaffolded through
@xeroapi/xero-mcp-server. - The agent-toolkit pattern follows
XeroAPI/xero-agent-toolkit: central provider, OAuth token handling, scoped Xero tools, and human-approved writes.
- React 19 + Vite frontend
- Express + TypeScript backend
xero-nodeofficial Xero SDK@openai/agentsfor narrative orchestration- Optional Xero MCP bridge
- Recharts and SVG for forecast visualisation
- Lightweight TypeScript tests with
tsx
pnpm install
cp .env.example .env
pnpm devOpen:
http://127.0.0.1:5173/?source=xero
OPENAI_API_KEY=
XERO_DEMO_AUTH=false
XERO_CLIENT_ID=
XERO_CLIENT_SECRET=
XERO_REDIRECT_URI=http://localhost:8787/auth/xero/callback
XERO_TENANT_ID=
XERO_TOKEN_PATH=.cashpilot/xero-token.json
XERO_USE_DEMO_ON_API_FAILURE=true
XERO_MCP_ENABLED=false
XERO_MCP_COMMAND=npx
XERO_MCP_PACKAGE=@xeroapi/xero-mcp-server@latest
XERO_CLIENT_BEARER_TOKEN=
XERO_SCOPES=
PORT=8787For hackathon demos where Xero login is unavailable, set XERO_DEMO_AUTH=true. The app then presents the seeded Xero-style data as a connected local "Xero Demo Company" while still labelling the path as demo mode.
pnpm dev # run Vite UI and Express API
pnpm test # run CashPilot core model tests
pnpm typecheck # TypeScript validation
pnpm build # production build
pnpm preview # preview built frontend- Architecture
- Detailed App Deep Dive
- Design Decisions
- Demo Script
- User Guide
- Developer and Xero Setup
- Hackathon Submission Notes
CashPilot is intentionally human-in-the-loop. It does not send customer messages, alter invoices, create quotes, or delay bills automatically. Approved actions are queued with Xero evidence, execution intent, and a human-control note.