Data Privacy and Safety Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The MBBank MCP server is designed to provide monitoring, analytics, and limited transactional capabilities for MBBank accounts through the Model Context Protocol (MCP). Given that the server handles sensitive financial data, including account balances, transaction histories, and transfer authorizations, data privacy and safety are paramount. The project utilizes the mbbank-lib core to interact with bank services, ensuring a layer of verified compatibility and security.
The scope of these guidelines covers the handling of user credentials, the management of session-based data for transfers, and the restricted operational nature of the server. While the server facilitates account monitoring and transaction analytics, it incorporates specific safeguards such as session expiration and manual OTP verification to mitigate risks.
Sources: README.md:3-5, README.md:68-81, mbbank_mcp/core.py:17-25
Credential Security and Authentication
Security starts with the protection of MBBank credentials. The system supports authentication using a username and password, which are passed to the MBBankAsync client.
Credential Handling
Users are advised to provide credentials via command-line arguments or environment variables. However, the documentation notes that setting environment variables for username and password might cause issues with the Python runtime in certain configurations.
| Method | Flag / Variable | Recommendation |
|---|---|---|
| CLI Argument | --username, --password | Preferred for Claude Desktop |
| Env Variable | MBBANK_USERNAME, MBBANK_PASSWORD | Optional for Standalone/Docker |
Sources: README.md:18-20, README.md:52-54, mbbank_mcp/main.py:31-38
Authentication Flow
The server validates credentials upon startup. If authentication fails during the initial setup, the server exits to prevent unauthorized or broken sessions.
The diagram shows the startup sequence ensuring valid credentials before the server becomes operational.
Sources: mbbank_mcp/main.py:38-48
Transaction Safety and Transfer Logic
A critical safety feature of the MBBank MCP server is its approach to money transfers. The server is primarily designed for monitoring, and any outbound transfer requires multi-step manual verification.
Restricted Operations
The server does not support automated withdrawing of money. Transfers are only initiated through a "start and verify" workflow that keeps the user in control of the final authorization.
Sources: README.md:73-77, mbbank_mcp/core.py:48-115
Transfer Session Management
To prevent unauthorized or stale transactions, the server implements a volatile, time-limited session management system for transfers.
- Session IDs (SID): Randomly generated 8-character hex strings used to track a specific transfer request.
- Expiration: Transfer sessions are strictly limited to 120 seconds (2 minutes).
- Volatile Storage: Transfer states are stored in memory (
transfer_manager) and are not persisted.
This sequence demonstrates the requirement for a user to scan a QR code and provide an OTP, ensuring the MCP server cannot complete a transfer autonomously.
Sources: mbbank_mcp/core.py:50-128
Automated Cleanup
The server runs an asynchronous background task to remove expired transfer sessions, minimizing the window of opportunity for session hijacking or memory leaks.
Sources: mbbank_mcp/core.py:91-101
Data Privacy and Exposure
The MCP server exposes various bank details to the connected LLM or application. Users must be aware of the sensitive nature of the data retrieved.
Exposed Data Models
The following data models represent information that is read from the bank and presented via the MCP interface:
| Model | Sensitive Fields | Description |
|---|---|---|
AccountModel | accountNumber, balance | Detailed account balance info. |
TransactionModel | amount, description, transferredTo | Personal spending and receiving habits. |
CardModel | cardId, cardNumber (Partial) | Credit/Debit card metadata. |
SavingModel | principalAmount, maturityDate | Savings and investment details. |
Sources: mbbank_mcp/modals.py:7-80
Safe Usage Practices
- Trusted Environments: Use the MCP server only with trusted applications (e.g., local Claude Desktop instance).
- Exposure Awareness: Transactions often contain descriptions and counterparty names (
benAccountName), which are relayed to the LLM. - Monitoring Focus: The tool is explicitly marketed for "monitoring and analytics" to discourage use cases that might compromise account security.
Sources: README.md:4-6, README.md:78-81
Conclusion
Data privacy and safety in the mbbank-mcp project are enforced through a combination of credential validation, manual OTP-based transfer confirmation, and strict session timeouts. By delegating the core banking logic to the mbbank-lib and enforcing a 120-second window for sensitive operations, the server balances the utility of LLM-based financial analytics with the security requirements of personal banking.