CLI & AI Agents
Read the same data from a terminal, from scripts, or from an AI agent — with a stable JSON envelope, an embedded MCP server, or a remote Financy connector token.
CLI & AI Agents
financy is an open-source command-line tool for the endpoints documented here.
It reads the same connections, accounts and transactions, with the same
credentials, and adds three things the raw API does not: a freshness rollup, a
stable machine-readable envelope with granular exit codes, and an embedded MCP
server so AI agents can query the data directly.
The CLI is a client for this API, not a replacement for it. Everything itreturns is described under Connections, Accounts & Balances and
Transactions.
The data API is available on the Starter and Pro plans only. On theFree plan every data command exits with code
4.
Install
Node 20 or later is the only prerequisite.
npm install -g financyEvery command also works without installing, which is the usual choice for CI and
for one-off use:
npx financy statusConfigure
The CLI needs the three values from the Financy app under Settings → API:
clientId, clientSecret and userId.
financy setupsetup prompts for each value, masks the client secret as it is typed, and
validates all three against the live API before saving — so a wrong value fails
here rather than on the first real command. On success it writes
~/.config/financy/config.json with owner-only permissions (600).
In CI and other non-interactive environments the CLI reads the credentials
straight from the environment, and no config file is needed.
| Variable | Value |
|---|---|
FINANCY_CLIENT_ID | The org's client ID |
FINANCY_CLIENT_SECRET | The org's client secret |
FINANCY_USER_ID | The user whose data is being read |
financy setup --no-input reads those same variables and persists them for later
sessions.
If the secret is rotated in the Financy app (Settings → API → Rotate key),
every CLI, script, and local MCP server still holding the old value starts
getting 401. Re-run financy setup (or update FINANCY_CLIENT_SECRET) with
the new secret. See Authentication.
Never pass the client secret on a command line. It is recorded in shellhistory and visible to anything that can list processes. Let
financy setup
prompt for it, or set the variable from a secret store.
financy config prints the resolved endpoints and marks each credential as coming
from the environment or the config file, with the secret masked.
Commands
| Command | What it returns |
|---|---|
financy status | Per-connection freshness rollup, one line per bank or card |
financy connections list|get <id> | Connections, fetch state and consent expiry |
financy accounts list|get <id> | Accounts with balances; securities embedded |
financy transactions list|get <id> | Transactions, with date, account and type filters |
financy categories | The category taxonomy, English and Hebrew |
financy providers list|branches | Reference data: banks and branches |
financy refresh | Triggers an on-demand refresh of every connection |
financy config | Resolved endpoints and credential sources, secret masked |
financy skills list|install | The bundled agent skills |
financy mcp | Runs the embedded MCP server on stdio |
financy update | Updates the CLI, aware of how it was installed |
Connections are created in the Financy UI, never through the API — the CLI reads
them and cannot add one.
Status
status is usually the first command to run. It marks each connection fresh,
stale or in error, so the data can be trusted before it is analysed.
financy status --json{
"data": [
{
"provider": "hapoalim",
"status": "ACTIVE",
"fresh": "2026-08-04",
"expires": "2026-11-14",
"accounts": 3
}
],
"staleThresholdDays": 2
}fresh is the date the data runs through; compare it against today. A status
other than ACTIVE means the connection itself is broken and must be relinked in
the Financy UI — a refresh will not repair it.
ReadstaleThresholdDaysfrom the response rather than hard-coding2.Banks post with a lag, so a one-day-old feed is normal and a weekend gap is
expected.
Refresh
financy refreshThis is the same initiated refresh offered in the app's connections screen. It is
org-wide — it refreshes every connection, not a chosen one — and it is
asynchronous: the command returning does not mean the data has landed. Poll
status and watch fresh advance.
Each call costs 20 credits, whatever the number of connections. Aresponse of
already_runningmeans a refresh was already in flight and is not
charged again.
JSON output and exit codes
Every command accepts --json and returns a stable envelope: {data, count, nextPage}
for lists, {data} for a single resource. Errors go to stderr as
{error: {code, message}}.
financy transactions list \
--from 2026-07-01 --to 2026-07-31 \
--all --jsonList commands accept --limit, --cursor, and --all to paginate automatically.
Exit codes separate the kinds of failure, so a script can branch without reading
prose:
| Code | Meaning |
|---|---|
0 | Success |
1 | Unexpected error |
2 | Usage error — unknown command or bad argument |
3 | Authentication — credentials missing or rejected |
4 | Plan — credentials valid, plan does not include the data API |
5 | Credits — not enough credits for the requested action |
6 | Not found |
7 | API unavailable — network or upstream problem |
3and4are the two worth branching on.3means the credentials needfixing.
4means they are correct and the plan needs upgrading — retrying will
never help.
FINANCY_DEBUG=1 prints raw API response bodies to stderr.
MCP server
The same package ships a Model Context Protocol server, so an AI agent can query
the data without shell plumbing. Register it once:
claude mcp add financy -- npx financy mcpIt runs on stdio and exposes the command surface one-to-one as eleven verb_noun
tools — get_status, list_connections, list_accounts, list_transactions,
refresh_connections and the rest — returning the same envelopes as --json.
Credentials resolve exactly as they do for the CLI; until setup is complete every
tool returns a structured NOT_CONFIGURED error.
refresh_connectionscosts 20 credits. Its tool description instructs theagent to confirm with the user first.
Remote MCP connector
The local financy mcp server above is one MCP path: it runs on your
machine, authenticates with the same API key as the CLI, and can trigger a
refresh.
A second path is the Financy connector inside an AI client (ChatGPT, Claude,
and other MCP hosts that speak OAuth). That host obtains a token minted for the
MCP resource server and calls the Financy read endpoints directly — no API
key, no CLI, no clientSecret on the agent machine.
For the step-by-step click-path to add the connector in ChatGPT and Claude,see Connect ChatGPT and Claude.
Local financy mcp | Remote connector | |
|---|---|---|
| Credential | API key (clientId / clientSecret / userId) | OAuth token, audience https://mcp.open-finance.ai/ (trailing slash is required), scope mcp:read |
| Where it runs | stdio on the developer's machine | The AI host, talking to api.open-finance.ai |
| Who it reads | The userId configured in the CLI | The Financy user who connected the connector — query params cannot retarget another user |
| Can refresh? | Yes (refresh_connections, 20 credits) | No — refresh, payments, and deletes are not on the connector |
| Plan | Starter or Pro | Starter or Pro |
The connector is fail-closed. Missing scope, a user with no Financy org, a
non-Financy org, or a free plan is a rejection with a body the model can show
the user — it is never treated as an anonymous caller. See Errors.
What the connector can call
These are the same GET routes documented under Connections, Accounts &
Balances, Transactions, and Providers & Branches:
| Method | Path |
|---|---|
GET | /v2/providers |
GET | /v2/bank-branches |
GET | /v2/connections |
GET | /v2/connections/{connectionId} |
GET | /v2/data/accounts |
GET | /v2/data/accounts/{accountId} |
GET | /v2/data/transactions |
GET | /v2/data/transactions/{SK} |
GET | /v2/data/transaction-categories |
Anything else — including POST /chat/chat/connections/refresh, payment
endpoints, and DELETE /v2/connections/{connectionId} — rejects the connector
token at the gateway (401).
Connection responses additionally drop scaOAuth, verifier, and
callbackInformation so bank-flow secrets and webhook credentials never enter
the model's context. First-party API-key callers still see those fields.
https://mcp.open-finance.ai/is the OAuth resource identifier (RFC8707), not an API host. Data still comes from
https://api.open-finance.ai.
If a connector token is missingmcp:read, reconnect the Financy connector
in the AI client to grant it.
Agent skills
Skills are instruction files that teach an agent the job rather than the tool.
They ship inside the package, so they cannot drift from the installed CLI version.
financy skills list
financy skills install --allinstall copies each skill into the project's .claude/skills/ directory. Two
ship today:
| Skill | What it teaches |
|---|---|
financy-setup | Onboarding a user end to end: install, locate the credentials, save them without the agent ever handling the secret, verify, and explain the paid-plan requirement on exit 4 |
freshness-check | Reading status --json, judging whether the data is current enough for the question asked, and confirming the 20-credit cost before triggering a refresh |
The skills are plain Markdown and can be read before they are installed.
Permissions
The CLI works within the same permission as the underlying connection: reading
data. It cannot move money, make payments, or change anything in a bank account.
The only non-read action is the initiated refresh, which asks for fresher data.
The client secret is stored only on the machine that ran setup, with owner-only
file permissions, and is never printed by any command. The bundled skills instruct
agents never to request it or pass it in a command.
Source
The CLI is open source under Apache-2.0 at
https://github.com/open-finance-ai/financy. Every release is published from CI
with a provenance attestation, so the package on npm can be traced to the commit
and workflow run that built it — npm view financy shows the published metadata.
Updated 4 days ago

