Content
# T-Bank MCP
**T-Bank MCP** — mobile banking API server for Claude Code, Codex, ChatGPT, and other MCP-capable agents.
## Features
- **32 tools**: accounts, operations, grocery ordering, transfers, messenger, investments
- **6 skills**: grocery order, bill pay, transfer, budget analysis, invest advisor, login
- **Self-healing TLS**: handles Russian Trusted Root CA + HARICA cert rotation
- **Grocery checkout**: search → cart → order → pay (proven end-to-end)
- **Secure login**: password/PIN stay OUT of the LLM context (local CLI or env var)
## Quick Install
```bash
git clone https://github.com/icyberdeveloper/tbank-mcp.git
cd tbank-mcp
python -m venv .venv && . .venv/bin/activate
pip install -e .
python -m playwright install chromium
# MCP server:
claude mcp add tbank -- ./.venv/bin/python -m src.server
# Skills:
cp -r skills/* ~/.claude/skills/
```
## 🔒 Login — SECURELY (password not sent to agent)
Password and PIN are secrets. They **ARE NOT transmitted to the LLM context**.
Login is performed by a local script OR via an environment variable.
### Method 1 (recommended): local CLI
```bash
cd tbank-mcp
# Password will be prompted by the script (getpass — not displayed in the terminal):
.venv/bin/python login_cli.py +79991234567
# [1/3] login(+79991234567) ... SMS sent
# [2/3] SMS code: **** ← enter the code from SMS (hidden input)
# [3/3] Password (not displayed): **** ← enter password (hidden input)
# ✓ READY! session.json saved (permissions 0600).
# Start Claude Code in this repository.
# Password NOT sent to the agent — it works with the saved session.
```
Or with password in env (CI/scripts):
```bash
TBANK_PASSWORD="password" .venv/bin/python login_cli.py +79991234567
```
After login — **start Claude Code**. The agent sees the saved session and works
without password. Password never enters the LLM context.
### Method 2: via agent (convenient, but password visible to LLM)
If you prefer to pass the password to the agent:
```
> login(+79991234567)
> [SMS code] 1234
> confirm_otp("1234")
> [bank asks password]
> confirm_password("YourPassword")
```
⚠️ **Attention:** password enters the model context and call logs.
For sensitive accounts, use Method 1.
### Method 3: environment variable (CI/automation)
```bash
export TBANK_PASSWORD="password"
export TBANK_PHONE="+79991234567"
# login() will automatically pick up the password from env after confirm_otp()
```
## Other agents (Codex, ChatGPT, Hermes, OpenClaw)
```jsonc
{
"mcpServers": {
"tbank": {
"command": "/path/to/tbank-mcp/.venv/bin/python",
"args": ["-m", "src.server"],
"cwd": "/path/to/tbank-mcp"
}
}
}
```
## Tools (32)
| Group | Tools |
|---|---|
| **Login** | `login`, `confirm_otp`, `confirm_password`, `confirm_pin` |
| **Session** | `refresh_session`, `session_status`, `keepalive` |
| **Reads** | `list_accounts`, `list_operations`, `spending_categories`, `operations_histogram`, `get_data` |
| **Grocery** | `grocery_stores`, `grocery_search`, `grocery_plan_order`, `grocery_add_to_cart`, `grocery_cart`, `grocery_checkout`, `grocery_attempts`, `grocery_order_status` |
| **Messenger** | `messenger_conversations`, `messenger_messages`, `messenger_send`, `messenger_unread` |
| **Money** | `transfer`, `payment_commission` |
| **Invest** | `invest_accounts`, `invest_portfolio`, `invest_operations`, `invest_securities` |
| **Utility** | `flows`, `diagnostics` |
`get_data(section)` covers 60+ endpoints: subscriptions, credit_schedule, statements, requisites, invest_accounts, invest_portfolio, etc.
Grocery tools (`grocery_search`, `grocery_plan_order`, `grocery_add_to_cart`, `grocery_cart`, `grocery_checkout`) require `app_id` + `point_id` taken from `grocery_stores()` — there's no silent default store, so add/cart/checkout always operate on the same cart (no more "Корзина пуста" after adding).
## Skills (6)
| Skill | What it does |
|---|---|
| `tbank-grocery-order` | Recipe → search → cart → confirm → checkout |
| `tbank-bill-pay` | Phone, internet, ЖКХ, taxes, fines |
| `tbank-transfer-money` | P2P, СБП, account transfers |
| `tbank-budget-analyzer` | Spending analysis, subscription audit, savings tips |
| `tbank-invest-advisor` | Portfolio, P&L, rebalancing, tax optimization |
| `tbank-login` | Multi-step login, session management |
## Security
- **`session.json`** — canonical path `~/.local/share/tbank-mcp/session.json`
(overridable by env `TBANK_SESSION`), permissions 0600 (owner-only). Contains tokens.
Same file is read by both `login_cli.py` and MCP server — no manual setup.
At startup, MCP logs only path/size/permissions, without tokens and cookies.
- **Password/PIN** — NOT in git, NOT in code, NOT in LLM context (if using `login_cli.py`).
- **0 hardcoded secrets** in code (verified by audit).
- **`events.jsonl` + `attempts.jsonl`** — redacted diagnostics logs (`~/.local/share/tbank-mcp/`).
Contain only step / http_status / blame / amount / order id — never tokens, cookies,
address, phone, email, account numbers. Safe for sharing during debugging (read by `diagnostics` tool).
- Money tools (`transfer`, `grocery_checkout`) require confirmation.
## Disclaimer
For personal use with your own T-Bank account. Not affiliated with T-Bank.