PHP 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

  • 0 ★ on the repository
  • Last commit
  • MIT
MCP server

Broad access

Why this level

  • Enabling TBANK_ALLOW_TRADING allows the server to place and cancel orders on a real account
  • Universal calls provide access to any T-Invest API method, not only a safe subset
All reasons and checks
Russian stack

aei2/tbank_mcp_and_api

Install

Services

Manual install

composer install && cp .env.example .env

Install from source and configure the environment before running.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Enabling TBANK_ALLOW_TRADING allows the server to place and cancel orders on a real account
  • Universal calls provide access to any T-Invest API method, not only a safe subset

This is third-party code. Review the repository files before installing.

What it does

The project provides both a standard REST API and an MCP server using the same PHP code on top of the official T-Invest API proxy: accounts, instruments, candles, order book, portfolio, orders, sandbox, and a universal call for any of the more than 90 T-Invest methods without waiting for a separate endpoint to be added. MCP works as stdio for Cursor and Claude, and as streamable HTTP with SSE. Trading is disabled until the TBANK_ALLOW_TRADING variable is explicitly enabled. Quotation and MoneyValue are normalized into a single value field. Instruments can be found by ticker, FIGI, UID, ISIN, or name. A shared queue limits request frequency to avoid exceeding T-Bank quotas.

Who it is for. For PHP developers who need both a REST API and an MCP server for T-Invest on a single stack, with explicit trading disable switch.

Good fit when

  • Need a PHP stack instead of Node.js or Python for T-Invest
  • Require universal calls to any T-Invest method without waiting for separate endpoints
  • Trading must be disabled by default and enabled only by an explicit variable

Not a fit when

  • No PHP 8.3+ and Composer in the infrastructure
  • Require a published Composer package: installation is source-only

Example request

Show the order book for SBER in T-Invest and the latest candles for the past hour

MCP

Transport
stdio, http, sse
Authentication
API key

Environment variables

TBANK_INVEST_TOKEN required, secret
T-Invest API token.
TBANK_INVEST_ENV required
Mode: sandbox or production.
TBANK_ALLOW_TRADING
Enables trading operations, false by default.

Limitations

Single-author project without known releases, installed only from source via composer install. README does not mention automated tests beyond phpunit in require-dev. For live trading, TBANK_ALLOW_TRADING=true must be consciously set; trading is disabled by default intentionally.

How to disable. Stop the PHP server process and remove it from the MCP client configuration.

FAQ

Can I trade a live account immediately?

No, TBANK_ALLOW_TRADING=false by default and trading operations are disabled until the variable is explicitly set.

Is there a method without a separate endpoint?

Yes, the universal call via /v1/tinvest/{service}/{method} or the corresponding MCP tool covers the entire T-Invest catalog, which includes more than 90 methods.

Discussion

No questions or reviews yet.

T-Bank Invest MCP server, read-only

T-Bank Invest MCP Server (read-only)

Russian stack

An MCP server for a T-Bank Invest portfolio with no trading rights: positions, operations, market data, and technical and fundamental analytics

MCP serverBroad access3Repository stars
Russian stack

A T-Invest MCP server: portfolio, operations and market data, with a mandatory single-account lock and a sandbox mode

MCP serverExtended access
Russian stack

A console C# MCP server for T-Bank Invest: accounts, portfolio, dividends, operations and broker reports, read-only

MCP serverBroad access
Russian stack

A Kotlin MCP server for the T-Invest API: market data, orders and stop orders, and a sandbox with virtual money

MCP serverBroad access13Repository stars
Russian stack

An unofficial local T-Invest MCP server: portfolio analysis, screening and rebalance plans, with orders only after confirmation

MCP serverBroad access1Repository stars
Russian stack

An MCP server for T-Bank Invest with market analysis, backtesting five strategies, risk management and order placement, with live trading off by default

MCP serverBroad access

README in short

The README in Russian describes a PHP wrapper over the official REST proxy for T-Invest API: a catalog of over 90 methods, high-level REST endpoints, MCP stdio and streamable HTTP, sandbox and production environments with trading disabled by default. It includes an HTTP route table for process health, method catalog, accounts, instruments, candles, order book, and portfolio.

README badge

Report a problem