akahu-mcp

akahu-mcp

An MCP server exposing the Akahu banking API as tools to list accounts, get balances, and fetch transactions.

Category
访问服务器

README

akahu-mcp

MCP server exposing the Akahu banking API as tools - list accounts, get a balance, get settled and pending transactions, check connection health.

Every tool is read-only. This server backs an Akahu personal app, which by definition cannot make payments or subscribe to webhooks - the only side effect it can produce is asking Akahu to refresh from the bank, behind an explicit refresh flag.

Features

MCP Tools

  • list_accounts list every account Akahu has access to, with balance, credit limit, status and last-refreshed timestamps.
  • bank_get_balance, bank_get_transactions look up a specific account by its Akahu account ID.
  • bank_get_all_transactions - settled transactions across every account at once, for finding a payment without knowing which account it went through.
  • bank_get_pending_transactions - money committed but not yet posted, which no balance reflects yet.
  • bank_get_connection_health - whether each bank connection is still active, and how stale its data is.

Installation

git clone git@github.com:adrianparker/akahu-mcp.git
cd akahu-mcp
npm install
cp .env.example .env

Fill in .env:

NODE_ENV=app
AKAHU_APP_TOKEN=app_token_...
AKAHU_USER_TOKEN=user_token_...

Get your Akahu tokens from developers.akahu.nz. Use npm run cli -- list-accounts to find the account IDs to pass to balance/transactions.

Usage

As an MCP server

npm start

Runs src/index.js on stdio and waits for JSON-RPC input - that's normal, Ctrl+C to stop. For an interactive check of the tool calls before wiring it into Claude, use the official inspector:

npx @modelcontextprotocol/inspector npm start

Wire it into Claude by adding an entry to your MCP client config (e.g. claude_desktop_config.json, or a project .mcp.json):

{
  "mcpServers": {
    "akahu-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/akahu-mcp/src/index.js"]
    }
  }
}

src/index.js loads .env itself (resolved relative to its own file, not the launching process's cwd), so you don't need to pass tokens through the MCP client config.

Tools

  • list_accounts - { refresh?: boolean }. Every account Akahu has access to, including balance (current, available, limit, overdrawn, currency), status, attributes and when Akahu last refreshed each one.
  • bank_get_balance - { account: string, refresh?: boolean }. account is the Akahu account ID (see list_accounts). refresh: true asks Akahu to refresh from the bank first, then polls until the refresh lands (up to 30s) before reading the balance.
  • bank_get_transactions - { account: string, start?: string, end?: string }. account is the Akahu account ID. Dates are ISO 8601; start is exclusive, end is inclusive (Akahu's own semantics). Omit both for everything the app can access. Paginates internally, so you always get the full result in one call.
  • bank_get_all_transactions - { start?: string, end?: string }. The same settled transactions, across every account in one sweep. Each row carries its account ID, and the response includes an accounts lookup mapping those IDs to a bank and account name.
  • bank_get_pending_transactions - { account?: string }. Pending (unsettled) transactions; omit account for every account. Pending rows are not stable - date, description and amount can all change before they settle, and they carry no ID. Payments made through Akahu itself never appear here.
  • bank_get_connection_health - no arguments. Per bank connection: whether every account on it is still ACTIVE, and how many hours since Akahu last pulled fresh balance and transaction data. Most stale first.

Transactions are returned enriched where Akahu has the data: merchant, category (NZFCC name plus its higher-level group), and meta with the particulars, code, reference, otherAccount and cardSuffix a NZ bank carries on a direct debit or credit.

Both transaction tools paginate internally and return a truncated flag. If it is true the date range was too wide to return in full (20 pages per account, 50 across all accounts) and transactions are missing — narrow the range and call again.

From the command line

For a human, not an MCP client - same data, rendered as a table:

npm run cli -- list-accounts
npm run cli -- balance acc_...
npm run cli -- balance acc_... --refresh
npm run cli -- transactions acc_... --start 2026-01-01 --end 2026-02-01
npm run cli -- all-transactions --start 2026-01-01 --end 2026-02-01
npm run cli -- pending
npm run cli -- pending acc_...
npm run cli -- connection-health

Or use the akahu bin directly once installed globally / linked, so you don't need the npm run cli -- prefix:

akahu balance acc_...

To install globally from this checkout (picks up package.json's bin entry):

npm install -g .

For development, npm link instead - it symlinks the global akahu bin back to this checkout, so edits to src/cli.js take effect immediately without reinstalling:

npm link

Either way, .env is resolved relative to the current working directory (via dotenv.config() in src/cli.js), not the checkout - so run akahu from a directory containing a filled-in .env, or export AKAHU_APP_TOKEN/AKAHU_USER_TOKEN in your shell. To remove a global install or link later: npm uninstall -g akahu-mcp (works for both).

Development

Run Tests

npm test
npm run test:watch

Coverage

npm run coverage

100% coverage is the bar for this project - src/index.js and src/cli.js carry a c8 ignore around their if (import.meta.url === ...) entrypoint guard, since that only runs when the bin is actually executed, not under unit tests.

Lint

npm run lint

License

AGPL-3.0-only — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选