Projects

MBBank-lib: Turning Personal Banking Flows into a Python Interface

Python
APIs
Banking

The engineering behind an unofficial MB Bank Python wrapper, from authentication and transaction history to the confirmation boundary around transfers.

An open bank vault containing chests and stacks of gold.

Banking integrations look simple when the only example is “get the balance.” The harder work is everything around that request: authentication, session state, the bank’s response formats, and the difference between reading information and moving money.

MBBank-lib brings MB Bank’s personal-account flows into a Python interface. It is an unofficial wrapper, not an official banking API or a service operated by MB Bank. That distinction shapes both how the library is built and how it should be used.

Wrapping a workflow, not just an endpoint

The library handles more than a single HTTP request. Authentication needs to happen before account operations can succeed, and the response needs to be useful to Python code rather than remaining an opaque browser interaction.

The current project supports balances and transaction history alongside other account operations. It also provides asynchronous use, making it possible to integrate these flows into applications that already have an event loop instead of treating every bank request as an isolated blocking script.

The stack reflects those responsibilities: requests and aiohttp for HTTP, Pydantic for data modeling, Pillow for image-related processing, and cryptography utilities for the authentication workflow. The current package targets Python 3.10 or later.

Why synchronous and asynchronous interfaces both matter

A short script and a long-running service have different needs. In a script, a straightforward sequence of requests can be the clearest way to work. In an asynchronous application, blocking the event loop while waiting for a response can interfere with unrelated tasks.

Supporting both styles makes the wrapper useful in more than one environment. It does not make the upstream bank faster or remove its constraints; it lets the application choose how to organize the waiting, errors, and follow-up work around those constraints.

For exact method signatures and installation instructions, the repository is the better reference than a copied portfolio snippet. An unofficial integration can evolve, and an example that once worked is not a permanent API contract.

Reading data and transferring funds are different capabilities

Earlier versions of this portfolio described the library as completely read-only. That is no longer accurate for the current project.

The library includes transfer support, with a confirmation flow that requires scanning an OTP code using the MB Bank app. That confirmation is an important part of the workflow, but it should not be confused with a blanket security guarantee. Applications still need to decide which operations they expose, who can invoke them, and how credentials and sensitive responses are handled.

If an application only needs transaction monitoring, it should expose that narrow capability rather than treating every available method as an appropriate default. A library supporting an operation does not mean every integration should enable it.

Living with an unofficial dependency

The upstream service can change its authentication or request behavior independently of this project. That makes compatibility work part of the cost of maintaining the wrapper. Callers need to expect failures, avoid assuming that responses are always available, and check the current documentation before upgrading.

MBBank-lib is useful as a Python interface to those account flows, but it is not a substitute for official authorization, the bank’s terms, or an application’s own security review. Use it only for accounts and operations you are authorized to access.

Read the source and current documentation on GitHub. The related MBBank MCP project explores a further boundary: what happens when these operations become tools an AI assistant can call.