
Banktivity
io.github.david00769由 GitHub 账号 david00769 发布v0.17.4更新于 Nov 7, 2026
Banktivity MCP server for .bank8 vaults; writes go through Core Data so CloudKit sync sees them.
概览
让助手读取并修改本地 Banktivity .bank8 账本:账户、交易、分类、证券、对账单与报表。
- 可以做什么
- 列出账户、余额、净资产,以及按分类的支出与收入明细。
- 搜索、读取、新建、修改和删除交易及其明细行,包括跨币种转账修复。
- 管理分类、标签、分类建议、批量重新分类、模板、导入规则和定期交易。
- 处理对账单与对账,包括新建对账单、对账或取消对账明细行。
- 跟踪证券:价格、持仓、交易、已实现收益、收入、份额调整和 CSV 价格导入。
- 将账本导出为 RDF/Turtle,并查看 Core Data 架构或能力清单。
- 适用场景
- 适合让助手回答关于你 Banktivity 财务状况的问题,或在不逐项点击应用的情况下做批量编辑、分类和对账调整。最适合只支持 MCP 的客户端(如 Claude Desktop);终端智能体可能更适合用该项目的 CLI,它只在单条命令执行时打开账本。
- 运行要求
- macOS 14 或更高版本,以及一个 Banktivity .bank8 账本。以本地二进制形式运行,可从发布包、Claude Desktop 的 .mcpb 扩展包、Homebrew 或源码构建安装。需将 BANKTIVITY_FILE_PATH 设为账本路径,或留空以使用唯一的 Banktivity 10 账本。必须为 banktivity-mcp 二进制本身授予完全磁盘访问权限。
安装
在 SourceWeft 中
- 打开 控制台中的 Banktivity,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
banktivity-swift-mcp: Banktivity MCP server and CLI for AI assistants
[CI] [Release] [Swift 6.0] [macOS 14+] [MCP] [License: PolyForm Noncommercial + MIT]
A Swift library, Model Context Protocol (MCP)
server and command-line tool for Banktivity
personal finance files. It lets Claude Desktop, Claude Code, Cursor and other
MCP clients or AI agents read and write a Banktivity 10 .bank8 vault:
accounts, transactions, splits, categories, payees, tags, templates, import
rules, scheduled transactions, statements and securities. It can also export a
vault as RDF.
- banktivity-cli is the command-line tool, for scripts, for AI agents that run shell commands, and for looking things up yourself.
- banktivity-mcp is an MCP server with 80 tools, so an AI assistant such as Claude can work with your vault.
- BanktivityLib is the library both are built on. It has no server dependencies.
Every change goes through Core Data, the way Banktivity itself writes, so edits are seen by Banktivity's iCloud/CloudKit sync. See CloudKit sync safety.
CloudKit sync safety: why Core Data, not direct SQLite
A .bank8 vault is a Core Data store, and Banktivity syncs it through CloudKit.
- Writing SQLite directly is invisible to sync. A tool that writes
core.sqlwith SQL bypasses Core Data's change tracking. CloudKit sync never sees those edits, so they can fail to sync, be reverted, or corrupt the vault. Martijn Riemers's TypeScript banktivity-mcp, which inspired the Swift rewrite, was built that way. - This tool writes through Core Data. Steve Flinter's Swift rewrite opens
the vault with
NSPersistentContainer, using Banktivity's own compiled data model, and makes every change through it, as Banktivity does. - Writes are refused while Banktivity has the vault open (an
lsofcheck, from the Swift rewrite). - This fork adds more guards. CLI edits are no longer reverted by the next sync, Core Data is never allowed to migrate (rewrite) Banktivity's database, and the write guard now refuses when it cannot tell and is enforced where every write is saved. See Safety Features.
Warning: this tool changes your Banktivity data. Write commands make real changes to your vault, and AI assistants make mistakes. Back up the vault before any write session, and work on a copy until you trust your setup. The authors are not responsible for data loss.
Using it safely
- Run one
banktivity-cliorbanktivity-mcpprocess per vault at a time. Writes are queued inside one process, but nothing locks the file across processes. - Quit any
banktivity-mcpserver before you open the same vault in Banktivity.app. The app and this tool must not have the file open together. (Writes are refused while Banktivity has the vault open, but reads are not.) - Back up before every write session.
- After restoring, importing or migrating a vault in Banktivity 10, look up account, transaction, statement and category IDs again. Banktivity can renumber them.
About this fork
This is david00769's maintained fork of Steve Flinter's banktivity-swift-mcp. It has everything upstream has. Upstream merged nine of this fork's pull requests on 2026-11-03, so much of the fork's earlier work is in upstream too. Some of what is listed below is still offered upstream as pull requests; the rest is only here.
What the fork adds:
- Edits that survive sync. Changes made with the CLI are no longer reverted the next time Banktivity syncs.
- Statements: reconciliation that selects the same rows the Banktivity app does, plus repair commands for statement rows.
- Investments: create security trades and income, and see realised capital gains per lot.
- Safety and reporting: a machine-readable list of which commands write, net worth in one reporting currency, and an investment account's holdings value on its balance.
- New in v0.17.0:
- a guard that stops Core Data from rewriting Banktivity's database;
accounts update;line-items source, showing the raw bank import behind a transaction;- automatic transaction types on create;
- an optional HTTP server mode.
Some of this came from other people's forks. ACKNOWLEDGEMENTS.md credits each contribution, and CHANGELOG.md lists every change by release.
Which Banktivity MCP should I use?
Three related projects come up when you search for a Banktivity MCP server:
If you want an AI assistant to write to a vault that syncs through iCloud, use one of the Core Data projects. All three can read a vault.
Requirements
- macOS 14 or later
- A Banktivity
.bank8vault
Installation
Download a release (recommended)
Each release has one universal download (Apple Silicon and Intel) and a checksum file. CI builds and tests the release from the tagged commit. For v0.17.4:
The binaries are signed ad hoc, not notarized. The xattr line removes the
quarantine flag macOS puts on downloaded files, which would otherwise stop them
from running.
Claude Desktop extension (.mcpb)
Each release also has banktivity-swift-mcp-vX.Y.Z-macos-universal.mcpb, an
MCP Bundle. Download it and
open it with Claude Desktop to install banktivity-mcp as an extension. Leave
Vault path blank to use your Banktivity 10 vault (see
Where is my vault?), and consider turning Read-only on. The binary inside is ad-hoc signed, not
notarized; if macOS refuses to run it, clear the quarantine flag with
xattr -dr com.apple.quarantine ~/Library/Application\ Support/Claude/Claude\ Extensions
and restart Claude Desktop. It installs only the MCP server; for the CLI, use the download above. The server
is also listed in the MCP Registry
as io.github.david00769/banktivity-swift-mcp.
Build from source
Xcode 16 or later is recommended. Without Xcode the Makefile falls back to the Command Line Tools for building and installing (not tested here); running the tests needs Xcode.
Always install with make install (or make install-fast for a quicker
single-architecture build). Never copy a new binary over ~/.local/bin with
cp. cp rewrites the file in place, and a banktivity-mcp still running from
it is killed by macOS the next time it starts ("Code Signature Invalid"). The
Makefile copies to a temporary name, signs it, then renames it into place.
Other Makefile targets:
make test runs the suite the way a release build behaves: release
configuration, one worker, Xcode's test frameworks.
Homebrew (upstream's version)
This installs upstream's binaries, without this fork's changes.
How releases are made
CI (.github/workflows/ci.yml) runs on every push and pull request to main.
It runs make test, then make package, so a change that breaks the release
build fails before anyone tags it. To release, bump
Sources/BanktivityLib/Version.swift and add a matching section to
CHANGELOG.md, then push a tag:
.github/workflows/release.yml then checks that the tag matches
Version.swift, runs the tests, builds the tarball and publishes the release.
The CHANGELOG section becomes the release notes.
Configuration
Where is my vault?
Banktivity 10 keeps a vault that syncs through Banktivity Cloud in its own library, not in Documents:
The <vault id> folder differs from Mac to Mac. If BANKTIVITY_FILE_PATH
is unset or empty, banktivity-mcp and banktivity-cli use the vault in that
folder, provided there is exactly one. With several they list them and stop,
so you can pick one.
macOS asks permission first. That folder belongs to Banktivity, and macOS protects one app's data from other apps, so the first run is blocked until you grant access. See Granting access on macOS.
A vault saved anywhere else (the examples below use
~/Documents/Banktivity/My Accounts.bank8) needs its path set. The path must
end in .bank8; if you give a folder, the error lists the vaults inside it.
Granting access on macOS
macOS blocks other programs from reading Banktivity 10's library until you allow it. Until then the server logs:
and Claude Desktop shows the extension as failed. You may also get a macOS notification about a program accessing "data from other apps". To fix it:
- Quit Banktivity.
- Open System Settings > Privacy & Security > Full Disk Access and click + below the list.
- Press ⌘⇧G, paste the path of the
banktivity-mcpthat is actually running, and click Open:- Claude Desktop extension:
~/Library/Application Support/Claude/Claude Extensions/local.mcpb.david00769.banktivity-swift-mcp/server/banktivity-mcp - Installed from a release or with
make install:~/.local/bin/banktivity-mcp(and~/.local/bin/banktivity-clifor the CLI)
- Claude Desktop extension:
- Check that banktivity-mcp now appears in the list and is switched on.
- Restart the server. In Claude Desktop, go to Settings > Extensions, switch Banktivity off and on (or quit and reopen Claude Desktop).
Grant the program itself, not the app that runs it. Giving Claude.app Full
Disk Access did not unblock the extension; adding the banktivity-mcp binary
did. Claude.app does not need Full Disk Access for this. The exception is a
terminal that already has Full Disk Access (Terminal, iTerm): the CLI run from
it, including from Claude Code, works without its own entry.
After every update, grant again. The binaries are ad-hoc signed, not notarized, so macOS ties the permission to the exact file. An update installs a new file, so add it again (remove the old entry first).
How to tell it worked. Claude Desktop's server log,
~/Library/Logs/Claude/mcp-server-Banktivity.log, shows:
In the extension's Configure dialog, turn Read-only on and click Save until you trust your setup. The toggle only takes effect once saved.
Claude Code
Add to a project's .mcp.json, or to ~/.claude.json for every project
(claude mcp add writes the same entry):
Claude Desktop (claude_desktop_config.json)
Add the same block to
~/Library/Application Support/Claude/claude_desktop_config.json, then
restart Claude Desktop.
Cursor (mcp.json)
Add the same block to ~/.cursor/mcp.json, or to .cursor/mcp.json in a
project.
Other MCP clients
Any client that starts stdio MCP servers takes the same two things: the
command banktivity-mcp (use its absolute path) and the environment variable
BANKTIVITY_FILE_PATH set to your .bank8 vault (optional for a Banktivity 10
vault; see Where is my vault?). For one shared server over
HTTP, see below. For agents that can run shell commands, also consider the
CLI.
Running one long-lived server over HTTP
Normally each client starts its own banktivity-mcp over stdio. If you'd rather
run one server that stays up (for example under launchd), set
BANKTIVITY_HTTP_PORT. It listens on 127.0.0.1 only:
BANKTIVITY_HTTP_PATH changes the /mcp path. To check that it answers:
Point a client at it with a URL instead of a command:
Two things to know before you use it:
- Anything on your Mac can connect. There is no password, so treat the port
like the vault file itself. Browser pages from other sites are refused (their
Originheader is checked), and so are malformed requests. - It keeps the vault open while it runs, and it does not see edits Banktivity makes. Stop the server before you open the vault in Banktivity, and start it again afterwards.
Read-only mode
Set BANKTIVITY_STORE_READ_ONLY=1 (or true, yes) to open the vault
read-only. Even a plain read lets SQLite tidy its write-ahead log, which
changes files on disk. Use this when you want to look at a vault without
changing a byte of it:
In this mode a write fails when it reaches the database. SQLite may still open
core.sql-shm for writing on its own, so this is an extra layer; keep your
backups.
Net worth in one currency, and holdings value
Net worth (accounts net-worth, get_net_worth, and netWorth inside
summary) reports assets, liabilities and netWorth, which add each account's
cash in its own currency, without converting. Net worth also
reports:
reportingCurrencyandconverted: the same totals converted into one currency, plusholdingsValue(the market value of investments) andnetWorthWithHoldings;currencyBreakdown: for each currency, the cash, holdings, exchange rate used and converted amounts;warnings: for example, an account left out because the vault has no exchange rate for its currency.
Choose the currency with BANKTIVITY_REPORTING_CURRENCY (an ISO code such as
USD). If it is unset, EUR is used, the label the totals have always carried.
Rates come from the vault's own exchange-rate table: the latest direct rate if
there is one, otherwise the inverse of the latest reverse rate, otherwise a
conversion through USD.
Investment accounts in accounts list and accounts balance (and their MCP
tools) also carry holdingsValue: shares held × latest closing price × the
security's price multiplier. It is shown next to balance, never added to it.
Available Tools
Accounts
list_accounts— List all accounts with balancesget_account_balance— Get balance for a specific accountget_net_worth— Calculate total net worthget_spending_by_category— Spending breakdown by category for a date rangeget_income_by_category— Income breakdown by category for a date rangeget_summary— Overall financial summaryupdate_account— Rename an account, change its type, or hide it (see Changing an account)
Transactions
get_transactions— List transactions with filtering and paginationsearch_transactions— Full-text search across payees, memos, etc.get_transaction— Get a single transaction by IDcreate_transaction— Create a new transaction; optionaltransaction_type, otherwise deposit, withdrawal or transfer is inferred from the bank-account linesrepair_forex_transfer— Repair an existing cross-currency transfer with a target-currency receipt and source-currency fee splitupdate_transaction— Update an existing transactiondelete_transaction— Delete a transaction
Cross-Currency Transfer Repair
repair_forex_transfer repairs existing cross-currency transfer transactions through MCP, and the same BanktivityLib repair path is available in the CLI as transactions repair-forex. Use it when a transfer already exists in Banktivity but was recorded with equal numeric source/target amounts or without a fee split. It does not create new transfers.
Required inputs:
transaction_id— existing transaction to repairsource_account_id— account debited in the source currencytarget_account_id— account receiving funds in the target currencyfee_category_id— expense category for the source-currency feegross_source_amount— full source-currency debitsource_fee_amount— fee in the source currencytarget_amount— amount received in the target account currencyexchange_rate— rate from source amount after fees to target currency
Optional inputs are title, date, note, source_memo, target_memo, and fee_memo.
The repaired transaction is stored in the source account currency. The target line item stores gross_source_amount - source_fee_amount as its transaction amount, exchange_rate as pExchangeRate, and target_amount as the target account amount. The fee is a separate source-currency category split. Transactions with unmanaged extra line items are rejected instead of merged or deleted.
Example MCP call arguments:
Equivalent CLI example:
Line Items
get_line_item— Get a specific line itemget_line_item_source— Raw imported bank details (Plaid/OFX description, source type and identifier) for a line item; empty for manual entriesadd_line_item— Add a line item to a transaction (for splits)update_line_item— Update a line itemdelete_line_item— Delete a line item
Categories
list_categories— List all income/expense categoriesget_category— Get a specific categoryget_category_tree— Get the full category hierarchycreate_category— Create a new categoryaudit_category_entities— Find categories stored under the wrong internal type, a fault older tools could leave behind
Categorization
get_uncategorized_transactions— Find transactions without categoriessuggest_category_for_merchant— Suggest a category based on merchant historyrecategorize_transaction— Change a transaction's categorybulk_recategorize_by_payee— Recategorize all transactions for a payeereview_categorizations— Review recent categorization changesget_payee_category_summary— Summary of categories used per payee
Tags
get_tags— List all tagscreate_tag— Create a new tagtag_transaction— Tag a transactionget_transactions_by_tag— Find transactions with a specific tagbulk_tag_transactions— Tag multiple transactions at once
Templates
list_transaction_templates— List saved transaction templatesget_transaction_template— Get a specific templatecreate_transaction_template— Create a new templateupdate_transaction_template— Update a templatedelete_transaction_template— Delete a template
Import Rules
list_import_rules— List all import rulesget_import_rule— Get a specific import rulematch_import_rules— Find rules matching a payee stringcreate_import_rule— Create a new import ruleupdate_import_rule— Update an import ruledelete_import_rule— Delete an import rule
Scheduled Transactions
list_scheduled_transactions— List all scheduled transactionsget_scheduled_transaction— Get a specific scheduled transactioncreate_scheduled_transaction— Create a new scheduled transactionupdate_scheduled_transaction— Update a scheduled transactiondelete_scheduled_transaction— Delete a scheduled transaction
Statements (Reconciliation)
list_statements— List statements for an accountget_account_reconciliation_status— Get statement count and latest statement end date for an accountget_statement— Get a statement with reconciliation progresscreate_statement— Create a new statement with balance validationdelete_statement— Delete a statement and unreconcile its line items; internal/unnamed investment rows require explicitallow_internalreconcile_line_items— Assign line items to a statementunreconcile_line_items— Remove line items from a statementget_unreconciled_line_items— List unreconciled line items for an accountupdate_statement— Correct a statement's ending balance to match what Banktivity's window showsplan_statement_visible_row_correction— Turn the start, end and missing amounts you read off Banktivity's statement window into a correction plan (it does not read Banktivity's screen itself)
Each line item in a statement carries statementBalanceAmount, the amount
that line contributes to the statement's balance. For an investment account, add
up statementBalanceAmount rather than amount or accountAmount: a security
trade can move cash that the raw amounts don't show.
Securities
list_securities— List all securities with name, symbol, and currencycreate_security— Create a new security with symbol, name, and currencyget_security_prices— Get price history for a security (by symbol or ID, optional date range/limit)get_security_holdings— Get current holdings (positions) with shares, cost basis, and market valueget_security_trades— Get trade history (buys, sells, transfers) with shares, prices, and commissionsget_security_realized_gains— Get realised capital gains per closed lot (acquisition date, proceeds, cost basis, gain, short/long term)get_security_income— Get investment income (dividends, interest, capital gains distributions)create_security_trade— Record a buy or sell (positive shares buy, negative shares sell), with its cash lineupdate_security_trade— Change an existing trade's shares, price, amount, commission or securitycreate_security_income— Create native security income, currently dividend incomerename_security— Change a security's ticker, name or both (refused if another security already has that ticker)create_share_adjustment— Create a share adjustment (e.g. charges, stock splits, position corrections)import_security_prices— Import prices from a CSV file (Yahoo Finance, OHLCV, or Date/Close)delete_security_prices— Delete price history for a security (optional date range)reset_security_price_range— Forget which price history is known for a security, without deleting any of itdelete_security— Delete a security record that no trade references
Export
export_turtle— Export the entire vault as RDF/Turtle (.ttl), optionally to a file
Diagnostic
dump_schema— Inspect the Core Data model schema (entity names, attributes, relationships)get_capabilities— List every command and tool, whether it reads or writes, and what confirmation it needs
CLI or MCP server: which to run, and keeping the vault safe
The CLI is a first-class part of this project, and the reason is the vault's safety.
An MCP server stays running. banktivity-mcp opens the vault when it
starts and keeps it open until it exits. A client such as Claude Desktop
usually starts it at launch and leaves it running in the background, even when
you are not using it. If Banktivity then opens the same vault for reading and
writing, or its sync touches the file, the two processes have the database
open at once. Banktivity may hang or crash, or sync may go wrong. You can quit
the server whenever you are done, but it is easy to forget.
The CLI opens the vault for one command and exits. banktivity-cli loads
the vault, runs the read or write, prints JSON and exits, so it is not holding
the file when you open Banktivity. AI agents are good at tool calling through
the shell, so Claude Code, Cursor's agent and other terminal agents can do the
same work through the CLI that they do through MCP tools. The
Claude Code skill does exactly that.
What neither tool does:
- Neither locks the vault. Both refuse to write while Banktivity has the
vault open (an
lsofcheck before writes, cached for 3 seconds). Nothing stops Banktivity from opening the vault while a command is running, and reads are not blocked. The CLI shortens the window; it does not close it. - Neither replaces backups. Back up the vault before any write session.
CLI
A standalone CLI (banktivity-cli) provides the same query and write
functionality without an MCP server. It reads a .bank8 vault selected by
--vault /absolute/path/to/Ledger.bank8 or BANKTIVITY_FILE_PATH, or with
neither, the Banktivity 10 vault (Where is my vault?).
Start with the built-in help:
Help is safe to run without opening a vault. Read commands return JSON on standard output. Write commands change financial records immediately through Core Data; back up the vault first and review the command-specific safeguards before using them.
Common examples:
CLI recipes
Copy-paste commands for common jobs. Set BANKTIVITY_FILE_PATH once, or add
--vault <path> after the subcommand (accounts list --vault <path>; it is
not accepted before it). Every command takes
--format compact for one-line JSON, which is easier for scripts and agents to
parse.
transactions create options:
Changing an account
accounts update renames an account, changes its type, or hides it:
A new type has to stay on the same side of the investment line. Checking can become savings or a credit card. A 529 can become a 401k. But a checking account can't become a brokerage account, because Banktivity keeps securities only in investment accounts:
Changing between an asset and a liability type (checking to credit card) is
allowed, and it moves the balance to the other side of net worth.
accounts update --help lists every type name; accounts create --type
accepts the same names. Categories are changed with the category commands
instead.
Seeing what the bank sent
line-items source shows the raw record behind an imported transaction, before
Banktivity renamed the payee or applied import rules:
A transaction you entered by hand returns [].
Transaction types on create
transactions create used to give every new transaction whichever type the
database happened to return first, often "Return Of Capital". Now it works the type out
from the bank and card lines:
To choose the type yourself, pass --transaction-type with check,
deposit, transfer or withdrawal. Investment rows such as buys and
dividends need a security, so create them with securities create-trade and
securities create-income. transactions update --transaction-type can still
set any type on an existing transaction.
Command reference
The command groups below are the complete CLI surface. Use a group's
--help output for required arguments, defaults, and write confirmations.
accounts:list,balance,net-worth,spending,income,summary,create,updatetransactions:list,search,get,create,repair-forex,update,delete,sync-infocategories:list,get,tree,audit-entities,createtags:list,create,tag-transaction,get-by-tag,bulk-taguncategorized:list,suggest,review,payee-summary,recategorize,bulk-recategorizeline-items:get,source,add,update,deletetemplates:list,get,create,update,deleteimport-rules:list,get,match,create,update,deletescheduled:list,get,create,update,deletestatements:list,status,get,inspect-membership,inspect-sync-record,replace-internal-row-with-visible-statement,restore-internal-row-from-preimage,visible-row-correction-plan,create,update,delete,reconcile,unreconcile,unreconciledsecurities:list,create,rename,delete,prices,import-prices,delete-prices,reset-price-range,fix-prices,holdings,trades,realized-gains,income,create-trade,create-income,link-income-category,adjust,update-tradereconciliation:execute-bundleruns a reviewed JSON plan of repairs, checked against its SHA-256 digestexport:turtleschema: dump the Core Data schemacapabilities: list every command and tool, whether it writes, and what confirmation it needs
Important behavior:
- Commands that accept
--account-idgenerally also accept--account-name. - Statement dates are whole days in your local time zone. Reconciling or un-reconciling a line keeps its cleared flag as it was.
transactions create --line-itemstakes a JSON array for split transactions. See Transaction types on create for how the type is chosen.statements inspect-membershipandstatements inspect-sync-recordonly read. They show which lines belong to a statement and the statement's sync state, and never create a missing record.- Replacing or restoring an internal statement row needs the exact account, period, member lines, cleared state and a SHA-256 snapshot of the row as it was. These commands repair only the cases they were built for.
reconciliation execute-bundlechecks the plan's digest, the vault, the order of operations and each command before it runs anything.capabilitieslists, as JSON, every command and tool: whether it writes, which confirmation flags it needs, and whether it has a dry run.
Use --format compact when a script needs one-line JSON; the default is
pretty-printed JSON for human inspection.
Shell Completions
ArgumentParser provides shell completion scripts automatically:
For example, to install Zsh completions:
Claude Code Skill
A /banktivity skill is available for Claude Code. It lets Claude use the CLI directly to answer natural-language questions about your finances — "What did I spend on groceries last month?", "Show me uncategorized transactions in Checking", etc.
To install, copy the skill directory into your global Claude Code config:
The skills/banktivity/ directory contains a SKILL.md file that teaches Claude how to invoke banktivity-cli with the correct environment variable and arguments. You'll need to edit the BANKTIVITY_FILE_PATH in SKILL.md to point to your own vault.
Once installed, type /banktivity in any Claude Code session to activate it, or Claude will activate it automatically when you ask about transactions, accounts, spending, or categories.
Safety Features
- Write guard: Before any mutation, the server checks if Banktivity.app has the vault open (via
lsof). If it does, writes are blocked to prevent corruption. - No schema migration: Core Data's automatic migration is turned off. If the data model read from the vault doesn't match its database, the tool refuses to open it. Left on, Core Data would "migrate" by dropping and recreating tables; one user lost 40,459 price records that way.
- No persistent history tracking: Banktivity uses its own sync mechanism. Core Data's built-in history tracking would add unrecognized metadata that corrupts the vault.
- Background contexts: All writes use background
NSManagedObjectContextinstances withperformAndWaitfor data integrity. - How long the vault is held open:
banktivity-mcpkeeps the vault open for as long as it runs;banktivity-clionly while one command runs. Neither locks the file. See CLI or MCP server.
How It Works
Banktivity's .bank8 bundle is a folder holding Banktivity's compiled data model (the .momd files) and a SQLite database (StoreContent/core.sql). This tool:
- Loads and merges all
.momdmodel bundles from the vault, in filename order - Opens the SQLite store via
NSPersistentContainer(no history tracking, no migration) - Exposes 80 MCP tools over stdio, or over loopback HTTP when
BANKTIVITY_HTTP_PORTis set - Uses KVC (
value(forKey:)) to access entities since we load Banktivity's own compiled models at runtime
FAQ
Can Claude (or Cursor, or another AI agent) read my Banktivity data?
Yes. Point an MCP client at banktivity-mcp (Configuration),
or let a shell-capable agent run banktivity-cli (CLI).
Is it safe with iCloud / CloudKit sync? Writes go through Core Data, as Banktivity's do, so sync sees them (CloudKit sync safety). Don't run it while Banktivity has the same vault open, and back up first.
The extension fails with "macOS blocked access to Banktivity's library".
macOS needs your permission first: add the banktivity-mcp program itself to
Full Disk Access (Granting access on macOS).
Can a running MCP server cause trouble when I open Banktivity? It can: the server keeps the vault open. Quit it before opening Banktivity, or use the CLI (CLI or MCP server).
Does it work with Banktivity 10 and .bank8 files?
Yes. It reads Banktivity's own data model from inside the .bank8 bundle
(How It Works).
Can I give an AI read-only access?
Set BANKTIVITY_STORE_READ_ONLY=1 (Read-only mode), and use
banktivity-cli capabilities to see which commands write. This is a safety
layer, not a sandbox: an agent that can run shell commands can unset the
variable, so give it a copy of the vault if it must not write.
Acknowledgements
This fork includes work by Peter Baker, Roberto Michelena, producethis, muxadil, Richard Jeans, Howy Perrin and Martijn Riemers, on top of Steve Flinter's original. ACKNOWLEDGEMENTS.md lists each contribution, where it came from, and how it was taken.
License
Two licenses; LICENSE explains which applies where.
- MIT: everything up to commit
9bcd5d2(just after v0.17.2), including every release through v0.17.2, Steve Flinter's original and all credited contributions (LICENSES/MIT.txt). - PolyForm Noncommercial 1.0.0: david00769's changes after that commit (LICENSES/PolyForm-Noncommercial-1.0.0.md). Free for personal, hobby, research, educational, charitable and government use.
Commercial use of the PolyForm-licensed parts needs a commercial license from david00769 ([email protected]).
来源:README.md,提交 ed47ffb
工具
0版本历史
2- v0.17.4最新Nov 7, 2026
- v0.17.3Oct 25, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。