Skip to main content
Glama
Cashfloow

Cashfloow

by johanschnor

Cashfloow

English · Dansk

A free, open-source MCP server that gives Claude finished analyses of a company's cash flow, customers, suppliers, sales and stock from the Danish accounting system e-conomic. Instead of raw bookkeeping data, Claude gets answers like "Konferencecenteret has become 6 days slower to pay, and this is not chance" or "Order 40 office chairs now: 98% risk of selling out before the next delivery".

  • Free and open: MIT licence. No account, no server, no payment.

  • Runs on your machine: The server runs locally with your own e-conomic tokens. Data only moves between e-conomic, your computer and the Claude client you use.

  • Read-only: Nothing is ever written to e-conomic.

  • Try it without accounts: A made-up sample company with 36 months of data and a sample webshop with freight data are included.

  • English or Danish: Tool names, parameters, field names and findings in either language (CASHFLOOW_LANG=en). Danish is the default.

Not affiliated with, endorsed by or developed by e-conomic or Visma.

Get started

Claude Desktop, easiest: Download cashfloow-<version>.mcpb from Releases and double-click it (or Settings → Extensions → Advanced settings → Install Extension). Claude Desktop shows fields for your e-conomic tokens and an English checkbox. Leave the tokens empty to try with sample data. Nothing else to install.

Claude Desktop, manually: Needs Node.js 18 or later. Add under mcpServers in claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "cashfloow": {
      "command": "npx",
      "args": ["-y", "cashfloow"],
      "env": {
        "CASHFLOOW_LANG": "en",
        "ECONOMIC_APP_SECRET_TOKEN": "...",
        "ECONOMIC_AGREEMENT_GRANT_TOKEN": "..."
      }
    }
  }
}

Claude Code:

claude mcp add cashfloow -e CASHFLOOW_LANG=en -e ECONOMIC_APP_SECRET_TOKEN=... -e ECONOMIC_AGREEMENT_GRANT_TOKEN=... -- npx -y cashfloow

Without tokens everything works on sample data and on e-conomic's public demo account. Ask for example "Who is tying up our cash?", "Will we run out of money before the summer?" or "What should we reorder?".

From source:

git clone https://github.com/johanschnor/cashfloow.git
cd cashfloow
npm install

Open the folder in Claude Code, which finds the server in .mcp.json, or use node /full/path/to/cashfloow/mcp-server.js as the command in the configuration above.

Related MCP server: Acumatica MCP Server by CData

Use your own accounts

  1. Create a free developer agreement and an app at https://www.e-conomic.com/developer. That gives you an AppSecretToken.

  2. Open the app's installation link and approve access in your e-conomic. That gives you an AgreementGrantToken.

  3. Put both tokens in the extension's fields in Claude Desktop, in env in the configuration above, or (from source) in a .env file copied from .env.example.

Every tool takes source: "sample" (default) or "e-conomic". Ask Claude to use e-conomic when you want your own figures.

Your tokens give access to your accounts. Do not share them, and never commit .env (it is in .gitignore).

Language

Set CASHFLOOW_LANG=en for English, or tick English in the extension's settings. Without it, Cashfloow answers in Danish. The choice changes tool names, descriptions, parameter names, field names in the answers, category values (e.g. demand pattern smooth), findings, assumptions and number formats (DKK 12,500 instead of 12.500 kr.). Amounts are always in DKK. Names of customers, suppliers and products are left as they are in the accounts. The dashboard follows the same setting.

Tools

All are read-only. Names in English, with the Danish name in brackets.

Tool

Answers

company_overview (virksomhedsoverblik)

Key figures for customers and suppliers plus the main findings

customers_tying_up_cash (kunder_der_binder_penge)

Customers ranked by overdue amount, delay, trend or revenue

customer (kunde)

One customer's payment behaviour and unpaid invoices

unpaid_invoices (ubetalte_fakturaer)

Who to send a reminder to, and outstanding by age

payment_time_by_month (betalingstid_pr_maaned)

Are customers getting slower to pay?

suppliers (leverandoerer)

Dependence on suppliers and countries, and whether you pay too early

cash_forecast (likviditetsprognose)

Will we run out of money, when and why? Bank balance week by week with scenarios

cash_risk (likviditetsrisiko)

How big is the risk? Monte Carlo simulation, 80% intervals and a backtest of the forecast

sales_forecast (salgsprognose)

Sales for the coming months with intervals; several models tested against each other with error metrics

anomalies (afvigelser)

Possible duplicate invoices, unusual amounts and unusually late payments

inventory_overview (lageroverblik)

Inventory value, ABC, demand patterns, dead stock, overstock and forecast accuracy

reorder (genbestilling)

What to order now, and how much? Safety stock, reorder point and EOQ per product

product (vare)

One product's sales, forecast, model errors and stock status

freight_overview (fragtoverblik)

Sample webshop: parcels on time, return rate, reviews and what delays cost

compare_carriers (sammenlign_fragtfirmaer)

Sample webshop: carriers compared on precision, returns and real price per parcel

delay_effect (forsinkelsens_effekt)

Sample webshop: do delays cause more returns and worse reviews?

delivery_where_and_when (levering_hvor_og_hvornaar)

Sample webshop: delivery precision by region and weekday

freight_statistics (fragt_statistik)

Sample webshop: statistical tests of carriers and the effect of delays

The freight tools only run on the made-up webshop. They show which questions freight data can answer. Real freight data needs an integration that has not been built yet.

Dashboard

npm run dashboard

Opens a local dashboard at http://localhost:4400 with the cash forecast, customers and suppliers. It uses the same data, tokens and language setting.

How the cash forecast works

  • Opening balance: The balance of bank and cash accounts in e-conomic's chart of accounts.

  • Customers: Open invoices are expected to be paid on the due date plus that customer's own average delay. New sales follow the average of the last 12 weeks and are paid after the usual payment time.

  • Suppliers: Open invoices are paid the way the company usually pays that supplier. New purchases follow the average of the last 12 weeks.

  • Salaries and fixed costs: An estimate from the last 3 months' other bank payments. The sample company has them set directly.

  • VAT: Danish quarterly settlement (1 March, 1 June, 1 September and 1 December). The next deadline uses the balance of the VAT accounts; later deadlines are estimated from sales and Danish purchases.

All assumptions are returned with the forecast, so it is always clear what is an estimate.

Forecasts and statistics

All methods are written without external libraries (lib/stats.js) and tested against table values.

  • Sales forecast (lib/salesforecast.js): Monthly invoiced sales. Naive, seasonal naive, 3-month average, Holt with damped trend and Holt-Winters (additive and multiplicative, needs two full years) are tested in a rolling-origin backtest over up to the last 12 months, all on the same origins. The model with the lowest WAPE is chosen. Error metrics: WAPE, MAPE, MAE, RMSE, bias and MASE (relative to seasonal naive). The 80% and 95% intervals are built on the chosen model's own relative errors per horizon in the backtest.

  • Cash risk (lib/cashrisk.js): Monte Carlo with 2,000 paths on top of the cash forecast. Each open customer invoice is paid after a delay drawn from that customer's own payments in the last year. An overdue invoice is only drawn from delays longer than it has already waited. New sales and purchases per week are drawn from the last 26 weeks and scaled to the forecast level. The balance is followed day by day. The forecast of customer payments is backtested from 8 earlier dates, measuring how often actual payments fell inside the simulation's 80% interval (calibration).

  • Payment behaviour (lib/analyze.js): Linear regression of days after due date on payment date per customer (at least 8 payments) and overall. Slope per month, 95% interval and p-value. A customer is only called "slower" when p < 0.05.

  • Anomalies (lib/anomalies.js): Robust z-score (median and MAD) on the logarithm of invoice amounts per customer and supplier, possible duplicate invoices, and open invoices beyond the customer's 95th percentile of delay.

  • Inventory (lib/inventory.js): Sales per product from invoice lines, adjusted with a shared seasonal index (classical decomposition of monthly revenue, needs 24 full months). Demand pattern by Syntetos–Boylan (ADI and CV²) and ABC by revenue (80/15/5%). Three models (13-week average, exponential smoothing with fitted α, Croston/SBA) are backtested from 26 weeks on what matters for purchasing: sales during the lead time. The model with the lowest MAE is chosen. Safety stock = the chosen model's RMSE in the backtest × the t-quantile for the service level with a prediction correction, so the buffer matches how far the forecast has actually missed. The reorder point is rounded up to whole units and the order quantity is EOQ. Safety stocks are checked out of sample (each check only uses errors from earlier, non-overlapping periods), also per pattern. On the sample data they covered 96% of lead times against a 95% target, but only 93% for lumpy products against a 97% target.

  • Freight statistics (lib/fragt/stats.js): Wilson intervals for share on time, chi² test across carriers, pairwise tests against the best with Holm correction, logistic regression of returns on delay adjusted for product category (odds ratio), Welch t-test on stars and p control charts of weekly delivery precision.

The sample company has 36 months of data with seasonality and about 8% annual growth. It has a built-in customer who is getting slower (Konferencecenteret), an oversized supplier invoice and a possible duplicate invoice, so you can see the methods find them. It also has 31 products with stock and invoice lines (lib/sample-inventory.js): some must be ordered now, a discontinued coffee table still has stock, a few products are overstocked and one is new.

Tests

npm test

Starts the MCP server over stdio the way Claude does, calls every tool in both Danish and English, and checks that the methods find what was built into the sample data and that every field name is translated. Also runs against e-conomic's public demo account (needs network; skip with OFFLINE=1 npm test). No tokens needed. The tests run on every push and pull request via GitHub Actions.

What the data can and cannot tell

  • Customer payments are booked with the invoice number, so the payment date per invoice is exact.

  • Supplier payments are not linked to a specific invoice in e-conomic. They are matched first-in-first-out per supplier, so they are an estimate.

  • Supplier invoices have no product lines in e-conomic. Price trends per product need e-invoices (Peppol/NemHandel).

  • Stock: Stock levels (inventory on the product) only exist when e-conomic's inventory module is enabled. Without it, the inventory tools give sales patterns and reorder points but cannot say what to order. Supplier lead times are not in e-conomic: the default is 14 days and Claude can give another. Invoice lines are fetched one invoice at a time (the last 24 months, at most 3,000 invoices), and only when an inventory tool is used. The first call can therefore take a minute for a large company; after that it is cached for 30 minutes.

Releasing

For maintainers:

npm test
npm run build:mcpb        # dist/cashfloow-<version>.mcpb
npm publish               # runs the tests first

build:mcpb bundles the server with production dependencies, takes the tool list straight from the running server, validates the manifest and packs it. A tag like v1.1.0 makes GitHub Actions build the .mcpb file and attach it to a release. The build script takes the version from package.json.

Structure

mcp-server.js            The MCP server (stdio)
server.js, public/       Local dashboard
lib/economic.js          Reads from e-conomic's REST API
lib/sample*.js           The sample company and its stock
lib/analyze.js           Customers, suppliers and payment behaviour
lib/forecast.js          Cash forecast
lib/cashrisk.js          Monte Carlo risk and backtest
lib/salesforecast.js     Sales forecast
lib/anomalies.js         Anomalies
lib/inventory.js         Inventory management
lib/stats.js             Statistics without external libraries
lib/tools.js             The MCP tools
lib/i18n.js, register.js Danish and English
lib/fragt/               Freight analysis on the sample webshop
test/mcp.test.mjs        End-to-end test over stdio
manifest.json            Manifest for the Claude Desktop extension (.mcpb)
scripts/build-mcpb.mjs   Builds the .mcpb file

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md. Report security issues as described in SECURITY.md.

Disclaimer

The analyses are decision support, not advice. Forecasts and estimates can be wrong, and the tools say how uncertain they are. Check the figures before making decisions about purchasing, credit or financing.

Licence

MIT

Available Tools

18 tools
afvigelserAfvigelserA
Read-only

Finder det usædvanlige de seneste 90 dage: mulige dobbeltfakturaer (samme modpart og beløb inden for 7 dage), fakturabeløb der afviger markant fra kundens eller leverandørens normale (robust z-score), og åbne fakturaer der er senere end kunden plejer (over kundens 95. percentil). Brug til "er der noget, der ser forkert ud?" og ved gennemgang af debitorer og kreditorer.

Inputs: kilde.

betalingstid_pr_maanedBetalingstid pr. månedA
Read-only

Gennemsnitligt antal dage, kunderne har betalt efter forfald, måned for måned de seneste 12 måneder (efter betalingsmåned). Negativ = før forfald.

Inputs: kilde.

forsinkelsens_effektHvad forsinkelser kosterA
Read-only

Hvordan returrate og anmeldelser ændrer sig, når pakken kommer til tiden, 1, 2 eller 3+ dage for sent. Returraten er justeret for produktkategori. Brug til "betyder forsinkelser noget for vores kunder?".

Inputs: no named parameters.

fragtoverblikFragtoverblikA
Read-only

Overblik over webshoppens fragt det seneste år: hvor mange pakker kom til tiden, returrate, anmeldelser, hvad forsinkelser koster i ekstra returneringer, og de vigtigste fund i klart sprog. Brug dette først ved spørgsmål om fragt, levering eller fragtfirmaer.

Inputs: returomkostning.

fragt_statistikFragtstatistikA
Read-only

Statistiske tests på fragtdata: er forskellen mellem fragtfirmaerne reel (95 %-intervaller, chi²-test, parvise tests mod det bedste firma), hvor meget forsinkelser øger returneringer justeret for produktkategori (logistisk regression med odds ratio), om forsinkede pakker får færre stjerner (Welch t-test), og kontrolkort over ugentlig leveringspræcision, der viser, hvornår et fragtfirma er blevet usædvanligt dårligt. Brug til "er forskellen signifikant?", "kan det være tilfældigt?" og "er PostNord blevet dårligere?".

Inputs: no named parameters.

genbestillingGenbestillingA
Read-only

Hvilke varer der skal bestilles nu, og hvor mange: sikkerhedslager, genbestillingspunkt og økonomisk ordrestørrelse (EOQ) pr. vare ud fra en sæsonjusteret prognose, der er backtestet på salget i leveringstiden. Giver risikoen for at blive udsolgt før en ny levering, hvornår lageret slipper op, hvilke varer der snart skal bestilles, og hvad indkøbet koster samlet (vigtigt for likviditeten). Brug til "hvad skal vi bestille?", "løber vi tør for noget?" og indkøbsplanlægning.

Inputs: kilde, servicegrad, leveringstid_dage, lageromkostning_procent, +1 more.

kundeÉn kundeA
Read-only

Betalingsadfærd og ubetalte fakturaer for én kunde. Navnet behøver ikke være præcist.

Inputs: navn (required), kilde.

kunder_der_binder_pengeKunder der binder pengeA
Read-only

Rangerer kunder efter forfaldent beløb, forsinkelse eller udvikling i betalingsadfærd (seneste 6 måneder mod de 6 før). Viser omsætning, andel til tiden, gennemsnitlige dage ift. forfald, udestående og ældste forfaldne faktura.

Inputs: antal, kilde, sorter_efter.

lageroverblikLageroverblikA
Read-only

Overblik over lageret ud fra varer, beholdning og fakturalinjer: lagerværdi, lagerdage og omsætningshastighed, ABC-analyse (hvilke varer bærer omsætningen), efterspørgselsmønstre (jævn, svingende, sporadisk, klumpet), hvor mange varer der bør bestilles nu, risiko for udsolgt, død beholdning og overlager (bundet kapital), og hvor præcise prognoserne og sikkerhedslagrene har været i en backtest. Brug til "hvordan står det til med lageret?", "binder vi for mange penge på lager?" og "hvilke varer sælger?".

Inputs: kilde, leveringstid_dage.

leverandoererLeverandørerA
Read-only

Indkøb pr. leverandør og land de seneste 12 måneder, andel af indkøbet, hvor mange dage før eller efter forfald virksomheden selv betaler, og hvad der står ubetalt. Betalingsdatoer er et skøn (først-ind-først-ud), fordi e-conomic ikke kobler leverandørbetalinger til en bestemt faktura.

Inputs: kilde.

levering_hvor_og_hvornaarLevering efter region og ugedagA
Read-only

Andel leveret til tiden pr. fragtfirma fordelt på region (Hovedstaden, Sjælland, Fyn, Syd-, Midt- og Nordjylland) og afsendelsesdag. Brug til "hvor er PostNord dårligst?" eller "hvilken dag skal vi ikke sende med DAO?".

Inputs: fordeling.

likviditetsprognoseLikviditetsprognoseA
Read-only

Banksaldo uge for uge de næste uger (standard 13): hvornår saldoen er lavest, hvorfor (kunder, leverandører, løn og faste udgifter, moms), og hvad det ville ændre, hvis kunderne betalte til tiden, eller hvis virksomheden betalte leverandørerne på forfaldsdagen i stedet for før. Brug til spørgsmål som "løber vi tør for penge?" og "hvorfor er likviditeten presset?". Returnerer også alle antagelser; nævn de vigtigste i svaret.

Inputs: uger, kilde, minimum_saldo.

likviditetsrisikoLikviditetsrisikoA
Read-only

Sandsynligheden for at banksaldoen kommer under et minimum de næste uger, beregnet med Monte Carlo-simulation (2.000 forløb) ud fra hver kundes egen betalingsadfærd og variationen i salg og indkøb. Giver 80 %-intervaller for saldoen uge for uge, fordelingen af den laveste saldo, hvilke kunder der skaber mest usikkerhed, og hvor præcis prognosen for kundeindbetalinger har været i en backtest (inkl. om intervallerne er kalibrerede). Brug til "hvor stor er risikoen?", "hvor sikker er prognosen?" og "hvad er worst case?".

Inputs: uger, kilde, minimum_saldo.

salgsprognoseSalgsprognoseA
Read-only

Prognose for det fakturerede salg måned for måned (standard 6 måneder) med 80 %- og 95 %-intervaller. Flere modeller (naiv, sæsonnaiv, gennemsnit, Holt, Holt-Winters) testes mod hinanden i en backtest med rullende oprindelse, og den mest præcise vælges. Returnerer fejlmål for hver model (WAPE, MAPE, MAE, RMSE, bias, MASE). Brug til "hvad sælger vi de næste måneder?", "hvor præcis er prognosen?" og "forecast error".

Inputs: kilde, måneder.

sammenlign_fragtfirmaerSammenlign fragtfirmaerA
Read-only

PostNord, GLS, DAO, Bring m.fl. side om side: andel leveret til tiden, forsinkelse, returrate, anmeldelser, fragtpris og den reelle pris pr. pakke, når ekstra returneringer fra forsinkelser regnes med. Brug til "hvem er bedst/billigst?" og "skal vi skifte fragtfirma?".

Inputs: sorter_efter, returomkostning.

ubetalte_fakturaerUbetalte fakturaerA
Read-only

Ubetalte kundefakturaer sorteret efter flest dage over forfald, samt fordeling af udestående efter alder. Brug til fx at finde, hvem der skal rykkes.

Inputs: kilde, min_dage_over_forfald.

vareVareA
Read-only

Alt om én vare: salg uge for uge (seneste 26 uger), efterspørgselsmønster, ABC-klasse, beholdning, sikkerhedslager, genbestillingspunkt, ordrestørrelse og de tre prognosemodellers fejl i backtesten. Søg på varenummer eller en del af navnet.

Inputs: navn (required), kilde, servicegrad, leveringstid_dage.

virksomhedsoverblikVirksomhedsoverblikA
Read-only

Nøgletal for kunder og leverandører plus de vigtigste fund i klart sprog: udestående, forfaldent, andel betalt til tiden, gennemsnitlig forsinkelse, indkøb, leverandørkoncentration og tidlige betalinger. Brug dette først.

Inputs: kilde.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools target a clear resource or question type (one customer, unpaid invoices, one item, cash flow forecast, carrier comparison), and descriptions explicitly say when to use which ("Brug dette først"). There is real overlap between lageroverblik, genbestilling and vare (all report what to order / stock status), and between fragtoverblik and sammenlign_fragtfirmaer, so an agent could occasionally pick the wrong lens.

    Naming Consistency4/5

    All 18 names are lowercase snake_case in Danish, so casing and separator conventions are perfectly consistent. However the pattern is mostly noun phrases (kunde, likviditetsrisiko, lageroverblik) with a few verb-first or full-sentence names (sammenlign_fragtfirmaer, kunder_der_binder_penge, levering_hvor_og_hvornaar), so there is no single predictable verb_noun scheme.

    Tool Count4/5

    18 tools is slightly heavy but the server spans three genuinely different domains (receivables/cash flow, inventory, shipping), each of which justifies several views. No tool looks purely decorative, though the five shipping-related tools push it toward the upper edge of comfortable.

    Completeness4/5

    The analytics surface is broad: overview, per-customer and per-item drill-downs, forecasts with backtests, risk simulation, anomaly detection, inventory/reorder, and freight quality. Minor gaps exist — no customer-level revenue trend over time, no budget-vs-actual, and no way to record or annotate findings — but these are workarounds rather than dead ends for a read-only analytics server.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      This read-only MCP Server allows you to connect to Acumatica data from Claude Desktop through CData JDBC Drivers. Free (beta) read/write servers available at https://www.cdata.com/solutions/mcp
      5
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for QuickBooks Online providing read-only access to customers, vendors, invoices, bills, and chart of accounts. Enables natural language queries to your financial data through Claude or any MCP client.
      8
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      MCP server that lets Claude read live financial data from Luni, including personal transactions, budgets, and business P\&L, cash flow, and partner distributions, by connecting to the Luni backend API.
      8
      -