This release is a pre-release and may not be stable for production use.
BitcoinTX MCP server
Connect an AI assistant (Claude Desktop, Claude Code, Grok Build or any MCP client) to your BitcoinTX ledger. It's optional, and off until you turn it on: nothing connects an AI to BitcoinTX by itself. Paste anything, like an exchange confirmation email, a wallet's transaction history, a block-explorer page or a CSV snippet, or just describe it ("moved 0.05 BTC from River to my Coldcard yesterday, fee was 2k sats"). The assistant turns it into transactions, shows you a dry-run preview with dedup and the resulting gain/loss, and saves them once you confirm.
BitcoinTX itself is a self-hosted Bitcoin portfolio and tax tracker for your wallets, exchanges and banks. Cost basis is per-wallet FIFO: each wallet and exchange uses its own oldest coins first for a sale, spend or transfer, unless you choose other coins in one of your own wallets. See Wallets, exchanges and banks.
The server runs on your computer and talks to your BitcoinTX instance over its normal API with an AI key, never your password. The Mac app keeps the key in a private file the server reads; with Docker or StartOS you create the key in BitcoinTX Settings and paste it into your AI app's settings.
What the AI's model sees: everything the tools return (transactions, balances, gains, the review list) and everything you paste into the chat. The MCP server itself sends nothing anywhere else. When a preview fills in a value, BitcoinTX uses its own stored hourly prices, or asks only the source you chose (in Settings → Privacy & Network, or on StartOS in the Price Source & Privacy action: your own Mempool, public price sites, or Nobody), and no request names a transaction date. Your AI app sends the conversation to its model. With a cloud AI that is the provider's servers; see Privacy: cloud or local model.
Tools
| Tool | What it does |
|---|---|
get_ledger_guide |
How to map real-world events onto BitcoinTX accounts, types and tax fields |
preview_transactions |
Dry run: validate, auto-fill FMV, flag duplicates, simulate the gains (Per-wallet FIFO) and balances. Saves nothing. A value filled from a price says which price: its hour (or day), source and USD per BTC. A row leaving one of your wallets says which coins it takes and which the wallet holds then |
add_transactions |
Save rows, all-or-nothing; duplicates are skipped unless you say one is another transaction. Both take at most 500 rows a call, and fewer dated before your latest entry (each recalculates the whole ledger): the AI splits a longer list. A row leaving one of your wallets can name the coins you chose to send, when you chose them by the time they left (chosen_coins, each purchase or deposit by its transaction id); the AI records only a choice you tell it of, never one it suggests |
list_transactions |
Search by date range, type and account; a value BitcoinTX filled from a price says which price, as in the preview |
update_transaction / delete_transaction |
Correct one transaction (the ledger is recalculated). An update can also set broker_reporting (which Form 8949 box a sale, or a spend and its network fee, goes in), fee_usd, a My BTC or Gift deposit's acquired_at (when the coins were originally acquired; an Inherited deposit's date of death), and chosen_coins |
get_coins_moved |
Which coins a saved Transfer, or a bitcoin Withdrawal from one of your wallets, takes: each piece's date acquired, BTC and cost, and its network fee's; leaving a wallet, also the coins it held then. Saves nothing |
get_portfolio |
Your accounts (each wallet, exchange and bank, by name), their balances, average cost basis, live BTC price and where it came from (the price source chosen in Settings → Privacy & Network, or by the server: StartOS's Price Source & Privacy action), or why there's none; tax timezone |
get_btc_price |
The BTC price for a moment (the one BitcoinTX values it at), a day, or now, and where it came from |
recalculate_ledger |
Rebuild lots and gains from your transactions (same as Settings → Account → Recalculate Ledger) |
review_ledger |
Read-only list of saved transactions worth a second look (same as Settings → Ledger Review). Changes nothing; values priced at the day are moved to their hour's price by you in Settings |
backup_ledger |
A copy of the database in BitcoinTX's backups folder on your server, as a safety net before a large change (one a minute). Restoring one is up to you |
There is deliberately no bulk delete, and no tool adds, renames, hides or deletes an account: you do that in BitcoinTX.
Your accounts by name. The tools name your wallets, exchanges and banks
as you named them in BitcoinTX (get_portfolio lists them). A name
BitcoinTX doesn't have is refused before anything is sent: the AI asks you
to add that wallet or exchange in Settings → Wallets, exchanges and banks,
and never puts it in another account. When more than one account fits, it
asks which.
A change to an earlier tax year asks first. An add, an edit, a delete or Recalculate Ledger that would change the figures of a tax year you may already have filed saves nothing at first: the tool answers with the years and what changes, and the AI calls it again only once you say yes. A copy of your ledger is made first. The preview shows the same before anything is added.
Some calls can take minutes on a large ledger. The preview, the writes
(add, update, delete, recalculate), get_coins_moved and review_ledger
can each go through your whole ledger more than once: the connector waits
up to 20 minutes for them, and up to 2 minutes for the other tools. If your
AI app stops waiting sooner, a write may still have been saved: have the AI
check with list_transactions before sending it again (sent again,
add_transactions leaves out the rows already saved).
Keep the connector up to date with BitcoinTX. Once your ledger has more than one wallet, or more than one exchange (a hidden one counted), BitcoinTX refuses changes from a connector older than 2.0, which can't tell them apart. A ledger updated from 1.x with an extra bitcoin account made through 1.x's account API has two wallets from the start. The refusal says: "This AI connector is older than BitcoinTX 2.0 and can't tell your wallets or exchanges apart. Update it (btctx-mcp 2.0 or later), then try again." It still reads your ledger.
Requirements
- BitcoinTX v1.0.3 or later on Docker and StartOS (the AI key); the Mac
app v0.9.2 or later (its key file).
backup_ledgerneeds v1.0.3. Install the server pinned to your BitcoinTX release (btctx-mcp==X.Y.Zfrom PyPI; the setup prompt in Settings fills in your version), so your AI app runs exactly that version. The firstuvxrun downloads it from PyPI, which sees your IP address and the version; it's cached after that. Versions before 1.2.0 aren't on PyPI: useuvx --from "git+https://github.com/DigiMonk73/BTCTX-MCP.git@vX.Y.Z#subdirectory=mcp_server" btctx-mcp. When the server and your BitcoinTX are different versions, every tool reply starts with a line saying so and what to change. A 2.0 alpha or beta pins its own (btctx-mcp==2.0.0aNor2.0.0bN), namedbitcointx-previewin your AI app, beside your ownbitcointx(on StartOS, where it updates your BitcoinTX in place, the server you have changes its version instead). - Python 3.11+ for the connector.
uvxdownloads one by itself only when the machine has no Python at all; if its only Python is 3.10,uvxstops with "current Python version (3.10…) does not satisfy Python>=3.11": runuv python install 3.13once, then restart your AI app
Quick setup: let your AI do it
In BitcoinTX, open Settings → Connect an AI Assistant and copy the setup
prompt into your AI app. It carries your address and points the AI to
AI_SETUP.md, which tells it how to install the server in
Claude Code, Claude Desktop, Grok Build or another MCP client. Turn on Let
AI assistants use BitcoinTX in the same section (it's off until you do).
On Docker and StartOS, create the AI key there first; it stays out of the
chat: the AI writes YOUR_BITCOINTX_AI_KEY and you paste the key into the
configuration file. The section also has the Claude Desktop config and
claude mcp add command (and, for the Mac app, a Grok Build command) ready
to paste if you'd rather do it yourself.
The AI app has to run on your computer (or on your network, for Docker and StartOS): cloud-hosted assistants such as Grok Bot can't reach BitcoinTX. Running on your computer doesn't make the AI's model local, though: read the next section before you connect a cloud AI.
Privacy: cloud or local model
An MCP server gives the AI your data to read. Here that means your transaction history, balances, cost basis and gains, plus whatever you paste (exchange emails, wallet histories, addresses, txids). Where it goes depends on the model behind your AI app, not on this server:
- Cloud AI (Claude Desktop, Claude Code, Grok Build and most others): the conversation, tool results included, is sent to the provider's servers and handled under its privacy terms. Your AI key is not sent: it stays in the configuration on your computer.
- Local model: what the AI reads stays on your machine. BitcoinTX itself asks only the price source you chose (your own Mempool or public price sites, or Nobody; Settings → Privacy & Network, or StartOS's Price Source & Privacy action). Use an app that runs MCP servers with a model on your own machine, for example LM Studio (0.3.17 or later) or Goose with Ollama.
Access: Settings → Connect an AI Assistant → Let AI assistants use BitcoinTX is off by default on every edition: nothing can use the key until you turn it on. Turn it off, or revoke the key (Docker, StartOS), to stop the AI.
If you want BitcoinTX's data to stay private, use a local model, or use a cloud AI only with a test ledger. Keeping a cloud AI away from real data isn't something BitcoinTX can enforce once it's connected.
Using a local model
Pick a model that handles tool calls well (for example a recent Qwen model of 8B parameters or more) and give it a context window of at least 16K tokens: the ledger guide and tool results don't fit in Ollama's small default. Smaller models make more mistakes, so read every preview before you confirm.
LM Studio: Program tab → Install → Edit mcp.json, and add the same block
as for Claude Desktop (below). For the Mac app:
{
"mcpServers": {
"bitcointx": {
"command": "uvx",
"args": ["btctx-mcp==X.Y.Z"]
}
}
}
Use the full path from which uvx if LM Studio can't find it. For Docker or
StartOS add the env block with BTCTX_URL and BTCTX_AI_KEY (see
Configure).
Goose: goose configure → choose Ollama as the provider; then
goose configure → Add Extension → Command-line Extension, with the command
uvx btctx-mcp==X.Y.Z
(and BTCTX_URL and BTCTX_AI_KEY for Docker or StartOS).
Install
uvx btctx-mcp==X.Y.Z # your BitcoinTX version; nothing to install
pip install btctx-mcp==X.Y.Z # or a btctx-mcp command of your own
pip install ./mcp_server # or from a clone of the repo
Configure
The BitcoinTX Mac app (0.9.2+): nothing to configure. With no
BTCTX_AI_KEY set, the server reads
~/Library/Application Support/BitcoinTX/mcp.json, which the app writes when
it starts (owner-only): its address and the AI key, never your password.
Turn on Settings → Connect an AI Assistant → Let AI assistants use
BitcoinTX first (off by default), and keep BitcoinTX open while you use
the AI. The same section turns access off again or resets the key. The app
also writes a new key each time it starts; either way the server picks up
the new key by itself. BTCTX_MCP_FILE points at another file. A 2.0
alpha's or beta's connector reads BitcoinTX Preview's instead
(~/Library/Application Support/BitcoinTX Preview/mcp.json).
Docker, StartOS, or from source: in BitcoinTX, Settings → Connect an AI Assistant, turn on Let AI assistants use BitcoinTX and click Create AI key (it's shown once; New key replaces it, Revoke deletes it).
| Variable | Meaning |
|---|---|
BTCTX_URL |
Where BitcoinTX is reachable: Docker the host and port you published, e.g. http://localhost:8080 (from another machine, an https:// address: over plain http:// the key and your ledger cross the network unencrypted, and the connector warns in its log); StartOS the MCP API address from the service's Interfaces (https://….local/api; the Connect an AI Assistant action shows it with a ready-made config); from source http://localhost:8000. A localhost or home-network address is reached directly, never through a proxy set for the whole machine (#474) |
BTCTX_AI_KEY |
The AI key. Put it in the configuration file, not in a chat or a shell command (which stays in the history) |
BTCTX_VERIFY_TLS |
false to accept a self-signed certificate (StartOS .local addresses) |
BTCTX_CA_BUNDLE |
Or: path to the CA certificate that signed it (StartOS lets you download its root CA). Safer than disabling verification |
BTCTX_USERNAME and BTCTX_PASSWORD are no longer used. While
BTCTX_PASSWORD is set, every tool answers with how to switch to a key and
sends nothing; after switching, change your BitcoinTX password, since the old
one sat in that file.
Claude Desktop
Settings → Developer → Edit Config (claude_desktop_config.json):
{
"mcpServers": {
"bitcointx": {
"command": "uvx",
"args": ["btctx-mcp==X.Y.Z"],
"env": {
"BTCTX_URL": "http://localhost:8080",
"BTCTX_AI_KEY": "YOUR_BITCOINTX_AI_KEY"
}
}
}
}
Installed with pip instead? Use "command": "btctx-mcp" with no args.
If Claude Desktop can't find uvx, use the full path from which uvx.
macOS desktop app: leave out env entirely:
{"mcpServers": {"bitcointx": {"command": "uvx", "args": ["btctx-mcp==X.Y.Z"]}}}.
The server finds the running app and its key by itself.
Claude Code
claude mcp add --scope user bitcointx \
-e BTCTX_URL=http://localhost:8080 -e BTCTX_AI_KEY=YOUR_BITCOINTX_AI_KEY \
-- uvx 'btctx-mcp==X.Y.Z'
Then paste your key over the placeholder in ~/.claude.json
(mcpServers.bitcointx.env), so it never goes into your shell history.
Updating
After you update BitcoinTX, update the connector to the same version. It's
pinned in your AI app's settings (uvx btctx-mcp==X.Y.Z) on purpose: your AI
app runs exactly the version you chose, nothing new arrives on its own, and
PyPI sees you once per version. Updating means changing that one number and
restarting the AI app: no new key, nothing to set up again. Until you do,
every connector reply says which version to use.
- Claude Desktop: Settings → Developer → Edit Config, change
btctx-mcp==inargs, save, then quit Claude Desktop completely (⌘Q on a Mac; on Windows, from the system tray) and reopen it. - Claude Code: change the version in
~/.claude.json(mcpServers.bitcointx.args; underprojects→ your folder if you used the StartOS action's command before 1.2.6), then restart Claude Code (or reconnect with/mcp). With the Mac app you can instead runclaude mcp remove bitcointxand the command Settings gives (it holds no key); with Docker or StartOS that would replace your key, and on StartOS the certificate path, with placeholders. - Cursor: change it in
~/.cursor/mcp.json, then restart Cursor. - Grok Build: change it in
~/.grok/config.toml(see AI_SETUP.md), then check withgrok mcp doctor. - LM Studio: Program tab → Install → Edit
mcp.json, changebtctx-mcp==inargs, save, then restart LM Studio. - A 2.0 alpha or beta, on a Mac or Docker: it has its own server,
bitcointx-preview, beside your own. Change the version in that one (in Claude Code,mcpServers.bitcointx-preview.args; with BitcoinTX Preview,claude mcp remove bitcointx-previewand the command its Settings gives), never thebitcointxserver, which reaches your own BitcoinTX. On StartOS, where the pre-release updated your BitcoinTX in place, change the server that reaches that StartOS server, whatever its name.
Don't paste the whole new configuration from Settings over the old one
unless you put your AI key (and on StartOS the certificate path) back in:
the one Settings shows has placeholders. Set up before 1.2.0? Your
configuration has --from "git+https://…@vX.Y.Z#subdirectory=mcp_server" btctx-mcp instead (or @main): replace those arguments with
btctx-mcp==X.Y.Z. Installed with pip instead of uvx? Run
pip install btctx-mcp==X.Y.Z.
Using it
Here's my River email: "You bought 0.00231 BTC for $150.00 (fee $1.49) on Mar 3"
I withdrew everything from River to my Trezor on March 10, network fee 1,800 sats
Got paid 250k sats for a logo design on 2024-05-02, went straight to cold storage
The assistant asks when something tax-relevant is ambiguous (is that address one of your wallets or someone else's? which wallet or exchange, when you have more than one? bank-funded or from your River cash balance?), previews, then saves once you confirm. Your AI client will also ask you to approve each tool call unless you tell it not to.
Security notes
- What the AI key can do: read the ledger (your accounts' names
included), add, change or delete single transactions, recalculate, and
make a backup copy on the server (
backup_ledger). Only while AI access is on. - What it can't do (BitcoinTX answers 403): log in, change your username or password, create or revoke keys, turn AI access on or off, restore or download a backup, export or import files, add, rename, hide or delete an account, delete everything, apply Ledger Review fixes, change settings, or open reports.
- Mac app: the key sits in
mcp.json, readable only by you, and works only from this computer and only until BitcoinTX quits (each start writes a new one). Settings → Connect an AI Assistant turns access off or resets the key. - Docker/StartOS: the key sits in your AI app's configuration on your computer; anyone who can read that file can do what the key allows. Revoke it or make a new one in Settings → Connect an AI Assistant. BitcoinTX stores only a hash of it, and restoring a backup never brings back an old key.
- With a cloud AI, what the tools return goes to the provider (see Privacy).
- There is no bulk delete, and every write is visible in BitcoinTX. Before a
large import, have the AI run
backup_ledgeror take a backup yourself (Settings → Backup & Restore). - Before the key's first change in an hour (an edit, a deletion, Recalculate
Ledger, or an import holding an entry dated before your latest entry,
which recalculates the ledger), BitcoinTX makes a copy of the database
itself (
backups/…-ai-before-changing-…db). Of the AI copies it keeps the newest 3 and, for a week, the oldest and the first copy of each day made before the AI changed anything that day (UTC days), so copies made afterwards never replace those from before. A change to an earlier tax year that you confirm gets a fresh copy first, whatever the hour.
Disclaimer
BitcoinTX is software, not tax, legal or financial advice. It works from the records you enter: check its figures with a tax professional before you file. The same goes for what your AI assistant says about them.
Development
# from the repo root
pip install --require-hashes -r backend/requirements.txt
pip install -r requirements-dev.txt ./mcp_server
mkdir -p frontend/dist
pytest mcp_server/tests backend/tests/test_entry_import.py
The tests run an MCP client against this server, which calls the real FastAPI app in-process on a temporary database. Price lookups are stubbed.
Metadata
Release files for btctx-mcp 2.0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| btctx_mcp-2.0.0b1.tar.gz | 77.2 kB | With provenance | Details for btctx_mcp-2.0.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| btctx_mcp-2.0.0b1-py3-none-any.whl | Python 3 | none | any | Details for btctx_mcp-2.0.0b1-py3-none-any.whl |
Total release size: 119.2 kB
Release files / btctx_mcp-2.0.0b1.tar.gz
| Download URL | btctx_mcp-2.0.0b1.tar.gz |
|---|---|
| Size | 77.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf3452af55966f805eec8d62ce49ce71bcf58f9352cc747a4c97cf57be349bcf
|
|
BLAKE2b-256 checksum How to use checksums |
29948538d55223bcf18abd0c9dffd05e93939e72e0e4355925e966c1b09cc477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / btctx_mcp-2.0.0b1-py3-none-any.whl
| Download URL | btctx_mcp-2.0.0b1-py3-none-any.whl |
|---|---|
| Size | 42.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
596b26999c15945e09c4638eafcc191da5ef7771a5315b3f70548fc7368ec8b5
|
|
BLAKE2b-256 checksum How to use checksums |
e0e9ff7c65c818fa5ccfd6770d838f6228662abe33a15c1d9bb3dfaa2ee305b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for btctx-mcp 2.0.0b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for btctx_mcp-2.0.0b1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.