Billy MCP
Billy MCP is a local MCP server that provides read-only accounting insights and controlled write operations for Billy bookkeeping, including receipt management, vendor tracking, proposal-based execution, and batch handling.
Read company status, write switches, and receipt inbox (
billy_status).List and fetch typed Billy resources with filters and pagination (
billy_list,billy_get).Get period overview of unreconciled bank lines, postings, and receipts (
billy_period_overview).Run trial balance and profit/loss reports using live chart data (
billy_trial_balance,billy_profit_loss).View outstanding unpaid documents and period expense totals (
billy_outstanding,billy_period_expenses).Import and archive receipts (PDF/PNG/JPEG) with deduplication and provenance (
billy_import_receipt,billy_receipts).Save and list vendor billing portal info (
billy_save_vendor,billy_vendors).Prepare concrete write proposals (create bills, journals, payments, approve, sales invoices, credit notes, contacts, upload receipts, reconcile) (
billy_prepare).Inspect, refresh, and execute saved proposals with hash verification and approval modes (
billy_plan,billy_refresh_plan,billy_execute).Prepare, inspect, refresh, and execute ordered purchase batches (1–10 cases) with staged progress (
billy_batch_prepare,billy_batch_get,billy_batch_refresh,billy_batch_execute).Review execution journal including rejected/uncertain operations (
billy_journal).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Billy MCP Import this receipt and prepare a draft bill"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Billy MCP
A local MCP server for Billy bookkeeping: complete accounting reads, receipt collection/provenance, reviewed purchase and sales drafts, credit notes, payments, reports and reconciliation of existing bank postings. Generic company support: the API token determines the company. This is an independent community project, not an official Billy or Shine product.
Run
Version 0.2.1 is distributed as an installable tarball on GitHub Releases. The scoped package is also published on npm as @pete-life/billy-mcp@0.2.1. Use npm install -g @pete-life/billy-mcp@0.2.1, the release tarball or the repository build below; see installation and agent setup.
Requires Node.js 22.13+ (built-in SQLite).
git clone https://github.com/pete-life/billy-mcp.git
cd billy-mcp
npm ci --ignore-scripts
npm run build
npm run setup
npm startCreate a company API token in Billy under Settings → Access tokens. Setup asks for it with hidden terminal input, fetches the connected company and asks you to confirm that identity. It writes an owner-readable credentials.env outside the repository, under ~/.local/share/billy-mcp/. Do not paste tokens in chat. npm start loads that file automatically.
Alternatively set BILLY_ACCESS_TOKEN in the MCP process environment. The company ID is discovered automatically. BILLY_ORGANIZATION_ID is optional: set it to enforce an expected company in addition to the token. A mismatched token is rejected. Setup records this extra guard automatically.
Each company has separate local receipt metadata, plans and vendor registry rows. Use a different BILLY_DATA_DIR for fully separate account profiles. Do not share a profile directory across machines or network filesystems; execution locking is local SQLite.
Generic MCP client configuration for this checkout:
{
"mcpServers": {
"billy": {
"command": "node",
"args": ["/absolute/path/to/billy-mcp/dist/launch.js"]
}
}
}command must resolve to Node 22.13+ in your desktop client's environment; an absolute Node path is safest. This file is a configuration example, not an automatic edit to your client settings.
Related MCP server: kitsas-mcp
Included tools
Tool | Purpose |
| Connected company, write switches and receipt inbox |
| Typed resource selection, supported filters, full pagination |
| Unreconciled bank lines, possible existing postings and receipts |
| Account balances and period profit/loss using the live chart |
| Current unpaid documents and period expense totals |
| Archive originals, deduplicate bytes and retain provenance |
| Vendor billing accounts and retrieval/access status |
| Preview a concrete financial operation and current record snapshots |
| Inspect or refresh an unexecuted proposal |
| Execute a reviewed proposal once, then read back the outcome |
| Inspect completed, rejected and uncertain operations |
| Preflight and inspect 1–10 ordered purchase cases |
| Refresh unstarted scope, approve once and resume guarded stages |
Read tools default to compact, sanitized responses. Lists return {records,count,complete}; individual reads return {record,complete}. Use verbose:true for additional sanitized fields. Every record is retained; compact output does not truncate rows or change internal verification snapshots.
The bookkeeping-period MCP prompt loads the bookkeeping skill. It orchestrates Gmail/Drive/local files/vendor portals through the agent's existing connectors and browser tools. Those external tools and logged-in sessions are not bundled in this MCP server. Original files are downloaded into the configured inbox, read by the agent and imported with source and extracted invoice metadata. This project does not contain a universal authenticated vendor scraper or built-in OCR.
Reusable bookkeeping skill
The bookkeeping skill contains tool recipes, exception handling and an optional learning routine. The MCP prompt loads the same file. To use it directly in a skill-aware client, install or link the skills/billy-bookkeeping directory according to that client's instructions.
Choose your own model. Store company-specific mappings, mailbox selection and billing portal access outside the public repository. External mail, file and browser tools must be supplied by the calling agent.
The learning routine records evidence privately under the configured data directory. Any reusable public documentation change must exclude company records and secrets. Learning does not authorize additional accounting actions.
Supported operations
billy_prepare accepts a validated discriminated operation:
upload_receipt: upload an archived PDF/PNG/JPEG and confirm the attachment exists.create_contact: create a customer/supplier with duplicate name/registration checks.create_bill: create a draft, using an uploaded receipt, supplier, invoice date/number, currency, explicit tax mode and account/tax-coded lines. Supplier name and extracted totals must match.create_journal: create a balanced draft, with receipt or explicit no-receipt reason plus bank-line identity. Tax-coded journal expansion is not live-verified; use a purchase bill for VAT-coded expenses.approve: approve a reviewed bill, invoice or journal draft. Bills require attached evidence.create_sales_invoice/update_draft_invoice: create a reviewed sales draft or edit its documented header fields. Invoice lines cannot be replaced after creation.send_invoice: send an approved sales invoice to one reviewed contact-person email in a separate operation.create_customer_credit_note/create_supplier_credit_note: create an original-linked, amount-limited draft credit note. Supplier credits require their original credit document.create_payment: register full/partial same-currency payments, supported supplier FX settlements and evidenced fees against an exact unused bank line. Fee-bearing payments require a base-currency cash account; ambiguous FX rounding is rejected before writing. This records money already moved, not a bank transfer.reconcile: associate one bank line's existing match with an existing bank-account posting and approve it. No expense is created. This is separately gated and live-verified for the documented single-line DKK flow.
See operation contracts and limitations for required evidence, supported currency combinations and verification status. Purchase batches execute original upload, draft, optional approval, payment and reconciliation with persistent per-stage progress.
Execution guarantees and limits
Writes are off by default. To enable them after setup/acceptance, set BILLY_ALLOW_WRITES=true in the local credentials file or process environment. This enables the capability; it does not authorize arbitrary financial actions. Default BILLY_APPROVAL_MODE=confirm requires a user-facing MCP form approving the exact single operation or complete batch. Unsupported clients, decline and cancellation fail closed. An operator can explicitly choose BILLY_APPROVAL_MODE=trusted_automation in their private local profile for authorized automation. The authorization text remains an audit note, never proof of consent. See approval modes.
Each preview has a persisted ID and hash binding the operation and the current records. Execution claims a company-wide SQLite lock, validates fresh data, writes and reads back. Repeated execution returns stored evidence. Another changed request is still another operation: callers must not use different wording/amounts to bypass an uncertain write.
No POST/PUT automatic retries. Read-only 429/temporary server errors have bounded retries and a timeout.
A crash, timeout, malformed response or failed verification after sending a write is unknown, never “failed, safe to retry”. Unknown/executing plans block subsequent writes for that company. A definitive first-write 400/401/403/404/409/422/429 rejection is retryable only after a fresh preview. Recovery of genuinely uncertain writes requires operator investigation against Billy and the interactive local command described below.
Preview expires after 30 minutes; changed data requires refreshing and reviewing the new hash.
Receipt import restricts paths to the configured inbox, rejects escaping symlinks, checks PDF/PNG/JPEG signatures and limits size to 20 MB. SHA-256 identifies the original bytes. It does not prove invoice validity or correct extraction.
Duplicate bill checks compare invoice references across contacts with matching name/registration number, plus same-date/amount candidates. They cannot prove uniqueness when existing supplier identity, references and dates are all different or missing. Inspect existing postings first; journal/payment bank-line IDs prevent local duplicate actions.
A sequence of remote API calls is not an atomic Billy transaction. If reconciliation stops after association creation, it is unknown and must be investigated.
Concurrent manual edits in Billy cannot be fully locked by this server. Fresh snapshots reduce but cannot eliminate that race.
Live verification status
Live purchase flow verified on 2026-09-22: company-token connection, original PDF upload, attachment linking, Danish VAT purchase draft, approval and independent balanced-ledger readback were verified through the live API. Supplier legal-name changes can be matched by verified country and registration number. A same-currency DKK supplier payment and single-posting bank reconciliation were also live-verified on 2026-09-22, including independent balanced-ledger and zero-balance checks; see live acceptance.
BILLY_ALLOW_BANK_MATCHING defaults to false independently of other writes. Public documentation labels match relationships read-only and does not explain the full approval sequence. The implemented single-posting sequence follows the separate documented association resource; the single-line DKK flow was subsequently live-validated; other variants remain unverified.
All four v0.2 reports completed in a GET-only live probe on 2026-09-23. The sales, credit-note, partial-FX, fee, approval and batch paths are fixture tested; they are not newly live-verified. Current exceptions include FX customer receipts and non-base-bank FX settlement, ambiguous cent allocations, grouped/split bank matches, credit-note settlement/refunds, automatic VAT filing or settlement, subscription changes, bank transfers, remote hosting, scheduling, remote batch atomicity and automatic recovery of unknown writes. Tax-coded journal expansion remains unverified.
Operator recovery
After inspecting the real Billy records and resolving any partial operation in Billy, run:
npm run recover -- PLAN_ID applied
# Or, only after establishing that no remote changes occurred:
npm run recover -- PLAN_ID not_appliedThis is an interactive local operator command, never an MCP tool. It requires an evidence note and confirmation of the plan ID, records the decision and never writes to Billy. It refuses recovery of an executing plan while the recorded executor process is alive. applied becomes a terminal state that cannot replay; not_applied allows a refreshed preview. Incorrect operator assertions are not detectable automatically, so inspect the entire operation first.
Development
npm run checkTests use temporary local files and simulated Billy responses. The stdio test starts the compiled MCP server and performs protocol initialization, tool discovery, validation errors and prompt retrieval. No test touches production accounting data.
Official references: Billy API, MCP TypeScript SDK. API documentation checked 2026-09-23.
License and contributions
MIT licensed. See LICENSE. Contributions are welcome; read CONTRIBUTING.md. For security reports, see SECURITY.md. This is an early release with deliberately limited accounting flows; review the supported operations and verification limits before enabling writes.
Available Tools
21 toolsbilly_batch_executeADestructive
Approve the complete ordered company batch once and execute its stages sequentially through guarded plans. A stop returns explicit partial progress. Resume the same hash after inspecting the cause.
Inputs: batchId (required), expectedHash (required), authorization (required).
billy_batch_getBRead-onlyIdempotent
Inspect saved batch, child plan IDs, partial progress and stop reason.
Inputs: batchId (required).
billy_batch_prepareADestructive
Preflight and save an ordered purchase batch (1-10 cases). Each case binds an original receipt, exact draft lines and explicit approval/payment/reconciliation stages. No Billy writes.
Inputs: cases (required), reason (required).
billy_batch_refreshADestructive
Refresh initial evidence for a batch before any stage starts; clears prior client approval.
Inputs: batchId (required).
billy_executeADestructive
Execute the exact reviewed proposal once. Default approval uses the MCP client form; a supplied authorization note is only an audit assertion. Unknown outcomes block further writes.
Inputs: planId (required), expectedHash (required), authorization (required).
billy_getARead-onlyIdempotent
Read a Billy record and optionally sideload relationships. Default response is compact; verbose returns sanitized detail.
Inputs: id (required), resource (required), include, verbose.
billy_import_receiptBDestructive
Archive an original PDF/PNG/JPEG from the configured inbox. Provide extracted invoice metadata and provenance from Gmail, Drive, local files or vendor portal. Same bytes are deduplicated. Does not upload to Billy.
Inputs: source (required), filePath (required), metadata (required).
billy_journalARead-onlyIdempotent
Read the last 200 proposals, including rejected/uncertain writes. An unknown outcome requires reconciliation against live Billy records before recovery.
Inputs: verbose.
billy_listARead-onlyIdempotent
List every page of a Billy resource. Default response is compact and complete; verbose returns sanitized detail. Unknown filters are rejected.
Inputs: resource (required), filters, verbose.
billy_outstandingARead-onlyIdempotent
Current approved unpaid bills and invoices, grouped by original currency. Not a historical as-of report.
Inputs: no named parameters.
billy_period_expensesBRead-onlyIdempotent
Net expense postings on debit-normal accounts under a live account-nature reportType (default incomeStatement), optionally narrowed to selected expense account IDs; credits reduce expense.
Inputs: end (required), start (required), verbose, accountIds, +1 more.
billy_period_overviewARead-onlyIdempotent
Inventory unreconciled bank lines, existing postings, bills and collected receipts for a period. Candidate matches are suggestions, not an accounting verdict.
Inputs: end (required), start (required), verbose.
billy_planBRead-onlyIdempotent
Inspect a saved proposal and its execution evidence. Default output retains operation, hash and snapshot hashes.
Inputs: planId (required), verbose.
billy_prepareBDestructive
Validate and persist a concrete write proposal without modifying Billy. Review the returned operation, reason, ID and hash. Receipts must be uploaded before preparing a booking. Reconciliation is restricted to matching existing bank-account postings.
Inputs: reason (required), operation (required), verbose.
billy_profit_lossARead-onlyIdempotent
Period P&L from non-voided postings. Defaults to live incomeStatement account natures, or accepts explicit reportType or revenue and expense account IDs; no chart numbers are assumed.
Inputs: end (required), start (required), verbose, reportType, +2 more.
billy_receiptsCRead-onlyIdempotent
List locally archived supporting documents and their Billy attachment IDs.
Inputs: verbose.
billy_refresh_planADestructive
Refresh an unexecuted/rejected proposal after changed data or expiry; review it again before execution.
Inputs: planId (required), verbose.
billy_save_vendorADestructive
Store a vendor billing portal location and retrieval status. This registry guides the agent browser/connector; it does not log in itself. Never include secrets or session URLs.
Inputs: id (required), name (required), status (required), portalUrl (required), +2 more.
billy_statusBRead-onlyIdempotent
Configuration and connection status. Never exposes credentials.
Inputs: verbose.
billy_trial_balanceBRead-onlyIdempotent
Balances by live account through an inclusive posting entry date. Uses base currency and rejects FX postings without a base amount.
Inputs: asOf (required), accountIds, includeZero.
billy_vendorsBRead-onlyIdempotent
List vendor billing portals and access exceptions for receipt retrieval.
Inputs: verbose.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
The toolset separates generic reads, financial reports, receipt/vendor management, and proposal/batch write workflows. Some overlap exists among the reporting tools and between refresh_plan/batch_refresh or plan/batch_get, but the descriptions are specific enough to guide selection.
All tools share the billy_ prefix and snake_case, but the action pattern is inconsistent: bare verbs, noun phrases, verb_noun, and object_verb forms are mixed. This is readable but lacks a uniform verb_noun convention.
21 tools is on the heavy side and spans multiple subdomains such as reporting, receipts, vendors, single proposals, and batches. Each tool appears purposeful, but the count is at the borderline where agents may have trouble finding the right tool.
The surface covers status, generic reads, financial reports, receipt archival, vendor registry, single-plan lifecycle, and batch lifecycle, with a journal for recovery after unknown outcomes. Minor gaps like explicit cancellation/voiding or direct upload-to-Billy are not clearly exposed, but the proposal workflow avoids dead ends.
Maintenance
Related MCP Connectors
Read Billy invoices, bills, contacts, products and postings; create contacts and draft invoices.
Headless API-first double-entry accounting & bookkeeping engine. 84 MCP tools over HTTP.
Read clients, invoices, expenses, bank transactions and time entries in billey.
Read incoming supplier invoices through a remote MCP server and get structured data for accounting.
Related MCP Servers
- AlicenseAqualityBmaintenanceIntegrates Billy's accounting system with MCP, providing tools to manage invoices, contacts, products, payments, and more via natural language.153MIT
- FlicenseAqualityBmaintenanceEnables MCP clients to read local Kitsas bookkeeping files, including accounts, fiscal years, partners, and vouchers, and to create purchase invoice drafts from chat or PDFs without ever writing to the ledger.10-
- AlicenseNot gradedqualityBmaintenanceEnables reading reports and accounting data, searching transactions, inspecting accounts, categories, payees, and rules, and optionally authorizing undoable bookkeeping changes through MCP.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to authenticate against an internal accounting web API, list companies, categories, bank transactions and documents, upload or batch-deposit receipts (idempotent, dry-run by default), set accounting metadata, and link documents to their matching bank transactions.1MIT