Mock T-Bank API server for development CLI
Mock T-Bank API Server
A FastAPI stand-in for the T-Bank Business API for local development and testing of tbank-mcp: 20-plus endpoints, three months of seeded data
- 0 ★ on the repository
- Last commit
Extended access
Why this level
- Runs a local FastAPI server that mimics the T-Bank Business API
- All payments and accounts live in mock memory, the real bank is not touched
Install
- Services
Manual install
pip install -r requirements.txt && python mock_tbank_api.pyStarts the mock on http://127.0.0.1:8099, loading data from the data folder.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Runs a local FastAPI server that mimics the T-Bank Business API
- All payments and accounts live in mock memory, the real bank is not touched
This is third-party code. Review the repository files before installing.
What it does
A FastAPI server imitates the T-Bank Business REST API and stands in for the production address used by the tbank-mcp MCP server (a separate project, not part of this repo): just point TBANK_BASE_URL at the mock, no tbank-mcp code changes needed. It implements 20-plus endpoints: company and requisites, accounts and balances, statements, payments and payment drafts, SBP transfers, invoices, salary payments and cards, self-employed registration and payment, business cards and limits, acquiring operations, and B2B SBP payment links. At startup it loads three months of history from JSON files under data: accounts, clients, suppliers, a chart of accounts and test scenarios; all state lives in memory and resets on restart.
Who it is for. For developers building or testing an integration with the tbank-mcp MCP server who want to exercise scenarios without touching T-Bank's production system.
Good fit when
- You are developing or testing tbank-mcp and do not want to use a real token or real money
- You need predictable test data: accounts, payments, invoices, salary payouts, acquiring
- You need to E2E-test business payment scenarios with no network and no real bank
Not a fit when
- You need real access to the T-Bank Business API: this is only a stand-in, not a client or an MCP server to production
- You don't have tbank-mcp itself: this repo only mimics its backend, the MCP server has to be installed separately
- You need protection against accidentally switching to production: changing TBANK_BASE_URL to the live address is a one-line config change and the mock does nothing to prevent it
Example request
Start the T-Bank mock and run the E2E tests for accounts, payments and acquiring against tbank-mcpLimitations
GitHub's API does not surface a separate license field for the repo; the README states MIT in the text. This is not the MCP server itself: it has to be installed separately and pointed at the mock's TBANK_BASE_URL. The default token is mock-token-any-value; changing it requires setting MOCK_TOKEN explicitly. Switching to T-Bank production is a simple three-variable config change with no extra safeguard.
How to disable. Stop the python mock_tbank_api.py process and point tbank-mcp's TBANK_BASE_URL back at the real or previous address.
FAQ
Can a real account be affected through the mock?
No, all operations run in the mock server's memory and reset on restart; there are no calls to T-Bank production.
How do I switch back to the real API?
Change tbank-mcp's config to TBANK_ENVIRONMENT=production, TBANK_BASE_URL to secured-openapi.tbank.ru, and a real token; no code changes are needed.
Discussion
No questions or reviews yet.
Related
All T-Bank toolsPHP REST API and MCP for T-Invest
tbank_mcp_and_api
PHP wrapper over T-Invest API: REST endpoints and MCP server with a shared catalog of over 90 methods, trading disabled by default
Unofficial MCP server and skills for a personal T-Bank account: accounts, transfers, bill pay, tickets and groceries
Unofficial read-only T-Bank CLI and MCP
tbank-cli-mcp
A local read-only CLI and MCP for a T-Bank personal account via a web session: operations, receipts and statements, no payments
A Kotlin MCP server for the T-Invest API: market data, orders and stop orders, and a sandbox with virtual money
T-Bank Invest MCP server, read-only
T-Bank Invest MCP Server (read-only)
An MCP server for a T-Bank Invest portfolio with no trading rights: positions, operations, market data, and technical and fundamental analytics
T-Invest MCP server with account-id lock
Tinkoff Invest MCP Server
A T-Invest MCP server: portfolio, operations and market data, with a mandatory single-account lock and a sandbox mode
README in short
The README gives an architecture diagram of the agent, tbank-mcp and the mock, a full endpoint list grouped by company, accounts, payments, invoices, salary, self-employed, cards, acquiring and SBP links, a description of the three months of pre-seeded test data, curl instructions for manual checks, a dedicated section of instructions for AI coding agents about tbank-mcp's response format, and a warning not to confuse an agent's built-in tools with the mock.