Mock T-Bank API server for development
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
Low risk
We rate an entry low when it mostly gives the agent instructions and reference material.
Why this level
- All data and operations live only in the mock server's memory and never touch a real bank
- Switching tbank-mcp to T-Bank's live address happens outside this repository with no extra safeguard
Install
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.
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.
Security check
- All data and operations live only in the mock server's memory and never touch a real bank
- Switching tbank-mcp to T-Bank's live address happens outside this repository with no extra safeguard
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.
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.
Related
A CLI for testing and red teaming LLM applications: compares models, runs automated CI checks and finds vulnerabilities
Playwright CLI
playwright-cli
Microsoft's official Playwright CLI with an agent skill: drive a browser through short commands without heavy MCP schemas
The official MCP server debugger: web UI, automation CLI and terminal UI in one package
SonarSource's official MCP server: quality and security issues, quality gates and code analysis from SonarQube Server and Cloud