NimBooks

io.github.subimpact由 GitHub 账号 subimpact 发布v1.3.0更新于 Nov 3, 2026

Read-only Nimiq books: balances, history, statements, staking, payment and stake links. Never signs.

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

只读的 Nimiq 账本 MCP 服务器:余额、分类交易记录、美元计价对账单、质押数据,以及草拟的付款请求与质押链接。

可以做什么
  • 汇总某地址在指定时间窗口内的余额、收支、手续费与奖励
  • 列出分类后的交易,含类型、对手方、备注与哈希
  • 按 CoinGecko 每日美元收盘价生成逐日对账单
  • 草拟付款请求与质押链接,并查询请求是否已付款
  • 查看质押仓位、验证人矿池、奖励与收益预测
适用场景
适合让助手回答关于某个 Nimiq 地址的余额、历史、税务式对账单或质押情况的问题,或准备可分享的付款请求与质押链接,再由你在自己的钱包中确认。
运行要求
以 stdio 在本机运行,需要 Node 20 或更高版本,通常通过 npx nimbooks-mcp 启动。可选参数:--address 设置默认地址,--backup 指向 NimBooks 备份文件以供 list_invoices 使用。无需账号、API 密钥或其他凭据;运行时会联网访问公开的 Nimiq RPC、Nimiq Watch、验证人列表接口与 CoinGecko。
安装前请注意
它从不签名或发送,但草拟的链接包含 NimBooks 地址,只有在付款人在其钱包中批准后才会转移资金。通过 --backup 传入的备份文件还含有可能仍持有 NIM 的 cashlink 私钥,应按钱包同等谨慎保管;服务器称会丢弃该部分。地址数据与价格查询会发往上述第三方公开主机。收益数字只是预测,并非承诺。

安装

在 SourceWeft 中

  1. 打开 控制台中的 NimBooks,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

nimbooks-mcp

An MCP server that gives an AI assistant read access to your Nimiq books — balances, classified history, tax-basis statements — and lets it draft payment requests and stake links.

It runs on your machine, reads the public chain, and cannot spend a single Luna.

you:      "How much came in last month, and who from?"you:      "Draft a request for 25 NIM for the September retainer."you:      "Has anyone paid request a1b2c3d4e5 yet?"

What it is not

This is the part to read first.

  • It never signs anything. There is no key handling in this package at all — nothing generates, stores, reads, derives or asks for a private key, a seed phrase or a passphrase. create_payment_request and draft_stake return links. A link is a request or a pre-filled draft, never a signature. Only the payer's wallet can move money, and only when its owner approves the payment there.
  • It never sends anything. No transaction is built, broadcast or queued. Nothing is marked paid — not on chain, and not in your app's own books.
  • It has no server. The only hosts this process contacts are rpc.nimiqwatch.com (the public Nimiq RPC the NimBooks app already uses), v2.nimiqwatch.com (Nimiq Watch's public analytics API, the same endpoint the app reads for staking rewards and for the validator record that confirms who paid them), validators-api-main.je-cf9.workers.dev (the validator list the NimBooks app reads: names, fees, reliability) and api.coingecko.com (public daily prices, for statements). It never calls nimbooks.subimpact.net. The links it mints contain that address, the way a printed invoice carries a street address: that is data, not a request.
  • It writes nothing. Every tool is a read or a pure function. The backup file you point it at is opened read-only.
  • It is not a wallet, and not a replacement for one. It reads what the chain already says in public about an address you name.

Not sure? The whole server is seven files under src/, about 3,400 lines. src/index.ts is the tool surface; there is nothing else to audit.


Setup

Node 20 or newer. Nothing to clone — from npm:

bash
npx -y nimbooks-mcp --help

Or from source, if you would rather build and audit it yourself:

bash
git clone https://github.com/subimpact/nimbooks-mcpcd nimbooks-mcpnpm installnpm run build     # → dist/index.js

Claude Desktop

claude_desktop_config.json → Settings → Developer → Edit Config:

json
{  "mcpServers": {    "nimbooks": {      "command": "npx",      "args": [        "-y", "nimbooks-mcp",        "--address", "NQ82 6GYU NXUU 05DM 1M7F 0SJJ D42E NUNS KELR"      ]    }  }}

Restart Claude Desktop. The eleven tools appear under the tools icon.

Claude Code

bash
claude mcp add nimbooks -- npx -y nimbooks-mcp \  --address "NQ82 6GYU NXUU 05DM 1M7F 0SJJ D42E NUNS KELR"

Built from source instead? Point both commands at node /absolute/path/to/nimbooks/mcp/dist/index.js in place of npx -y nimbooks-mcp.

Options

FlagWhat it does
--address <NQ…>The account tools use when a call doesn't name one; the server tells the assistant about it, so questions like "how are my books looking?" work without repeating your address. Optional — every tool also takes an address argument.
--backup <path>A NimBooks backup file. Only list_invoices needs it.

Getting a backup file: the app keeps your payment requests on the device, not on a server — so a file is the only way to show them here. In NimBooks: Backup → Copy, then paste into a file, e.g. ~/nimbooks-backup.json, and pass it with --backup. Without it, list_invoices says so and points at check_request_paid, which asks the chain instead.

A backup also contains your cashlink shelf, and those entries hold the private keys of links that may still hold NIM. Keep the file as carefully as a wallet. This server never opens that part of it — not "reads it and drops the field": it is discarded at the door, and a test asserts it can never reach the output.


The tools

ToolAnswers
get_summaryBalance now, plus money in/out, fees, rewards and transaction counts over a window. Nimiq Pay's round trips through its own contracts are reported apart, as internal.
list_transactionsClassified rows — kind, direction, counterparty, memo, hash.
get_statementDay-by-day in/out for a year or month, priced at each day's CoinGecko UTC close, with Nimiq Pay's internal round trips in their own columns.
create_payment_requestDrafts a request and returns a shareable link. Signs nothing.
draft_stakeDrafts a stake link that opens the app's stake panel pre-filled. Signs nothing.
check_request_paidWhether a payment tagged with a request's reference has landed.
list_invoicesRequests stored in your backup file.
get_stakingThe staked position: active, cooling down, retired, the pool, fee, net yield, an unstake clock, and a first-year estimate.
list_validatorsThe validator pools in the app's neutral order (producing first, best net yield first, nothing pinned), with fees, yields and the median.
project_yieldWhat staking an amount might earn, year by year, with its assumptions spelled out.
get_rewardsThe rewards earned in a window, per pool, with an actual yield over the trailing 30 days.

Defaults and limits, stated plainly:

  • get_summary and get_statement read up to the newest 1000 transactions; check_request_paid scans the newest 200. When a cap is hit, the answer says so.
  • Nimiq Pay wallets: Pay moves your NIM through its own contracts (HTLCs) and most of it comes back. Like the app (its Hide internal switch), get_summary and get_statement keep those round trips out of money in/out and report them as internalIn/internalOut; net counts both. To tell a contract that still holds your NIM, or that staked it from inside Pay, the server reads each contract you funded that has not paid it all back (two RPC calls each, at most 40 contracts, kept for 5 minutes). A busy Pay wallet's first answer can take 15 to 25 seconds. If a contract cannot be read, payContractsNote says so: NIM still in it may then be counted as sent.
  • get_summary windows default to all available history → now. since/until take YYYY-MM-DD or ISO 8601, read as UTC.
  • list_transactions returns 50 rows by default, 500 at most.
  • Balance is the live basic-account balance, not the balance at the end of a window. Staked NIM lives in the staking contract, so it is reported separately.
  • Statements exclude failed transactions, count fees on outgoing transactions only, and price each UTC day at that day's CoinGecko close. A day with no close available comes back null rather than a guess — and the USD totals are withheld entirely rather than summed from a partial year.
  • CoinGecko's public API only serves the last 365 days of prices. Ask for an older year and the NIM figures are still exact, but the USD columns come back empty — and the answer says so, in those words. The NimBooks app has the same ceiling. A paid CoinGecko key would lift it; this server does not take one, because taking one would mean holding a credential.
  • Addresses may be typed NQ82 6GYU …, flat, lower-case, or as 40 hex characters. They are checksum-validated: a typo is refused, never quietly looked up.
  • Amounts come back in both Luna (integer, exact) and NIM (exact decimal string). No float arithmetic touches money anywhere in this package.
  • list_validators returns 50 pools by default (1 to 50); non-producing pools are included unless you ask otherwise. The validator list is fetched at most once per 10 minutes.
  • get_rewards only sees restaking (compounding) pools: a direct-payout pool's rewards arrive as ordinary incoming transactions and show up in list_transactions. The public rewards data starts January 2025 and can lag by a day; per-day rows are capped at the newest 400. Only validators pay rewards: the public feed also lists a stake made in Nimiq Pay (it travels through a contract) as a "restake", so each payer is checked against Nimiq Watch's validator record and anything that is not a validator is left out, as in the app since v1.40.0. A payer whose record cannot be read is kept.
  • Yield figures are labelled as projections: emission falling with the supply curve is modelled, the network's total stake is held at today's level, and none of it is a promise.

Example prompts

What's the balance, and how much came in during August?Show me the last 20 transactions — anything that wasn't a plain payment?Statement for September 2026, with the USD close for each day.Draft a payment request for 12.5 NIM, memo "September retainer", expiring in 7 days.Has request a1b2c3d4e5 been paid?List my saved payment requests and tell me which are still open.What is my stake earning?Which pools pay the most right now?If I stake 1,000 NIM for 3 years, what might I earn?What rewards did I earn this year, and from which pool?

Parity with the app

A link drafted here must be the same bytes the NimBooks app would have produced, or it won't open when someone taps it. Parity is enforced in the NimBooks app repository: its test suite imports the app's real invoice encoder and compares the two across every combination of amount (1, 0.5, 12.5, 100000, and 0.000001, which both sides must refuse, being finer than a Luna), memo (ASCII, emoji/CJK, none) and expiry (none, set), with and without a named payer, then round-trips each link back through the app's own decoder. Transaction classification and statement aggregation are pinned the same way, row for row, including the cashlink tag, the nimbooks:invoice:<id> reference, the Nimiq Pay netting (tx by tx against the app's own module, on a real Pay wallet's history), and the staking legs.


Tests

bash
npm test       # offline: backup parsing, including malformed entries and the cashlink-secret fencenpm run smoke  # opt-in: drives the built server against a live demo wallet over stdio

npm run typecheck covers src/. The cross-checks against the app's own modules (invoice and stake-link byte-parity, classification fixtures, statement aggregation, stdio round trip) run in the app repository on every release.


Licence

MIT.

来源:README.md,提交 e8f6ac0

工具

11

get_summary

Account summary

Balance and money in/out for a Nimiq address over a window. Read-only: never signs, never sends. Defaults to the full history the public index returns (up to 1000 transactions, newest first). Balance is the live account balance now, not the balance at the end of the window; any staked NIM is reported separately because it lives in the staking contract. Money out includes transfers into the staking contract and out of it — the same treatment as the app’s statement; validator rewards arrive through a separate channel and are reported as their own line (rewardsReceivedNim). Nimiq Pay’s round trips through its own contracts are the wallet’s own money and are reported as internalIn/internalOut, not as money in or out, the same split the app makes; netNim counts both.

输入参数sinceuntiladdress

list_transactions

List transactions

Classified transactions for a Nimiq address, newest first. Read-only: never signs, never sends. Each row carries the kind the NimBooks app shows (payment, stake, unstake, reward, swap, vesting), the counterparty, and the memo — a cashlink’s protocol tag reads as "Cashlink" rather than raw bytes, and a `nimbooks:invoice:<id>` memo is the reference that ties a payment to a request.

输入参数limitsinceuntiladdress

get_statement

Daily statement

Day-by-day money in and out for a year (or one month of it), priced at the CoinGecko daily close in USD for each UTC day — the same basis the NimBooks tax statement uses. Read-only: never signs, never sends. Failed transactions are excluded and fees are counted on outgoing transactions only. Staking rewards (restaking payouts) are included as in-day income; moving NIM into or out of the staking contract is not a fiat flow, so it is excluded, exactly like the app’s statement. Nimiq Pay’s round trips through its own contracts go in internalInNim/internalOutNim, not in or out, as in the app. Days with no price available come back with closeUsd: null rather than a guess.

输入参数year必填monthaddress

create_payment_request

Draft a payment request

DRAFTS a payment request and returns a shareable link. This never signs anything, never sends anything, and never marks anything paid — the whole request rides inside the link, and only the payer’s wallet, with their approval, can actually move money. The link opens in the NimBooks app; the payment it produces carries the reference nimbooks:invoice:<id>, which check_request_paid looks for later. Note: inside the link, the payload field amountNim is denominated in Luna by the app’s link format; this tool’s own output reports amountNim in NIM and amountLuna in Luna.

输入参数idmemopayeeexpiryamountNim必填

check_request_paid

Check whether a request was paid

Looks for a payment tagged with a request’s reference (nimbooks:invoice:<id>) in the address’s transactions — the same match the NimBooks app uses to mark a request paid. Read-only: it reports what the chain says and changes nothing, here or in the app. Scans the newest 200 transactions.

输入参数id必填address

list_invoices

List saved payment requests

Payment requests stored in a NimBooks backup file (the app keeps them on the device; there is no server holding them). Requires the server to be started with --backup <path>. Read-only: the file is never written to, and the cashlink shelf inside it — which holds link private keys — is never opened.

输入参数address

get_staking

Staked position

A Nimiq address's staking position: active staked, inactive (cooling down after an unstake), retired (ready to withdraw) and total, plus the pool it is staked to with its fee, net yield and payout type, an unstake clock (a retire only becomes valid one full epoch after deactivation), and a first-year rewards estimate at the pool's current net yield. Read-only: reads the public chain and the public validators list, never signs and never sends. Never staked reads as staked: false, never as a failed lookup; a failed lookup is an error that says so.

输入参数address

list_validators

Nimiq validator pools

The Nimiq validator pools of the current epoch, ranked neutrally, exactly as the NimBooks app ranks them: producing pools first (those with a reliability score this epoch), best net annual yield first within them, pools that publish no yield last, then the non-producing pools, and the name as the final stable tiebreak. Nothing is pinned first. Read-only: one call to the public validators list, never signs and never sends. netYieldPercent is the net annual yield on the network's total stake after the pool's fee, the Nimiq wallet's convention; it moves as emission falls and as stake moves.

输入参数limitincludeNonProducing

project_yield

Project staking yield

Projects what staking an amount of NIM might earn, year by year. With an explicit rate it is a pure offline calculation. Read-only, never signs and never sends. Rate resolution, in order: an explicit annualRatePercent, then the named pool's current net yield, then the median of the producing pools. Compounding follows the pool's payout type (direct pools pay out, the rest restake) unless an explicit compound choice is given. Returns per-year rewards, cumulative rewards and balance, plus its assumptions: emission falls along the protocol supply curve, the network's total stake is held at today's level, and it is a projection, not a promise.

输入参数yearscompoundamountNim必填validatorannualRatePercent

get_rewards

Staking rewards

Staking rewards for an address over a window: the total (Luna and NIM), the reward days, the first and last reward date, and the breakdown per paying pool, plus an actual yield over the trailing 30 days measured against the current active stake and the current validator's estimate for comparison. Read-only, never signs and never sends. Important: only restaking (compounding) pools show up in this data; a direct-payout pool's rewards arrive as ordinary incoming transactions and are found with list_transactions instead. The public rewards data starts January 2025, so earlier asks come back empty, and it can lag by a day. A year Nimiq Watch did not answer is named in the answer, never silently dropped.

输入参数sinceuntiladdressincludeDays

draft_stake

Draft a stake link

DRAFTS a stake and returns a link only. This never signs anything and never sends anything: the link opens the NimBooks app with the stake panel pre-filled, and you check the amount and validator there and confirm in your own wallet. No validator is recommended, ranked or chosen for you, and there is no default validator. The link is the deliverable, exactly like create_payment_request: nothing is built, broadcast or queued here, and nothing is marked as staked. Notes explain what the app will do with the values, including a cap to the free balance and the 100 NIM first-stake minimum.

输入参数addressamountNimvalidator

版本历史

2
  1. v1.3.0最新Oct 29, 2026
  2. v1.2.1Oct 24, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分