Skip to main content
Glama
trclient-mcp

trclient-mcp

by abuaz01

trclient: Trade Republic API and MCP server

Python client and local MCP server for the private API of the Trade Republic online brokerage.

CAUTION

Not affiliated with Trade Republic Bank GmbH. Unofficial, may break at any time and may violate their terms. It can place real orders with real money. No warranty, no liability.Use at your own risk.

Quickstart

git clone https://github.com/abuaz01/trclient.git && cd trclient
python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/trclient login

login asks for your phone number and PIN, then you approve the login in the Trade Republic app. The PIN is never stored. The session is kept in the OS keychain.

Related MCP server: traderepublic-mcp

Command line

trclient login | status | logout
trclient portfolio | cash | orders [--terminated] | transactions
trclient quote ISIN | instrument ISIN | history ISIN [--range 1y] | search QUERY
trclient documents [--days 90 | --since 2025-01-01] [--source postbox] [--match Kontoauszug] [--list]
trclient buy|sell ISIN --size N [--limit P | --stop P] [--execute]
trclient cancel ORDER_ID [--execute]
  • documents downloads account statements, trade confirmations, tax documents and other postbox PDFs to ~/trclient-documents. Files that already exist are skipped.

  • Orders are a dry run unless TR_TRADING_ENABLED=1 is set and --execute is passed.

Run trclient <command> --help for all options.

MCP server

trclient-mcp is a local stdio MCP server. Log in with trclient login first.

claude mcp add trade-republic -- /ABSOLUTE/PATH/trclient/.venv/bin/trclient-mcp

Add -e TR_TRADING_ENABLED=1 to allow orders. Without it the server is read-only.

Area

Tools

Account

get_account_status, get_portfolio, get_cash, get_orders, get_transactions, get_available_size

Documents

list_documents, download_documents

Market data

get_quote, get_instrument, get_stock_details, search_instruments, get_price_history, get_performance, get_news, get_market_status, wait_for_market, wait_for_price

Orders

preview_order → place_order(confirmation_id), cancel_order, get_budget_status

An order is always previewed first. place_order only accepts the confirmation_id of that preview.

Python

import asyncio
from trclient import TRSession, TradeRepublic, OrderRequest

async def main():
    session = TRSession("+4917012345678")
    if not await session.resume():
        raise SystemExit("run: trclient login")

    async with TradeRepublic(session) as tr:
        print(await tr.portfolio())
        for doc in await tr.documents(sources=("postbox",)):
            await tr.download_document(doc, "~/trclient-documents")

        order = OrderRequest(isin="DE0007164600", side="buy", size=1, mode="limit", limit=180.0)
        print(await tr.place_order(order))                 # dry run
        # await tr.place_order(order, execute=True)        # real order, needs TR_TRADING_ENABLED=1

asyncio.run(main())

Methods of TradeRepublic

Account

portfolio(), cash(), available_cash(), available_size(isin), orders(terminated=False), timeline_transactions(after), timeline_activity_log(after), timeline_detail(id)

Documents

documents(since, sources, title_contains), download_document(doc, directory)

Market data

ticker(isin), stream_ticker(isin), price_for_order(isin, side), history(isin, range_), instrument(isin), stock_details(isin), performance(isin), search(query, asset_type), news(isin), market_status(isin)

Orders

place_order(order, execute=False), buy(...), sell(...), cancel_order(order_id, execute=False)

Errors derive from TRError. OrderStateUnknown means there was no answer in time: check orders() before sending again. Orders are never retried automatically.

Configuration

Environment variables, all optional:

Variable

Default

TR_TRADING_ENABLED

off

1 allows real orders

TR_MAX_ORDER_EUR

500

Maximum value of one buy

TR_MAX_ORDERS_PER_DAY

10

TR_BUDGET_EUR

–

Total amount orders may use

TR_ALLOWED_ISINS

all

Comma-separated allow list

TR_ORDER_FEE_EUR

1.0

Fee per order

TR_DOCUMENTS_DIR

~/trclient-documents

Download folder

TR_LOCALE

de

Language of news and document titles

TR_APP_VERSION

built in

Set if login fails with 426 CLIENT_VERSION_OUTDATED

Every order attempt is logged to ~/.local/state/trclient/audit.jsonl.

License

MIT. Based on research from pytr and TradeRepublicApi.

Available Tools

22 tools
cancel_orderA
DestructiveIdempotent

Cancel an open order by its order_id (from get_orders or place_order).

Inputs: order_id (required).

download_documentsB
Idempotent

Save documents as PDF files in the local folder TR_DOCUMENTS_DIR (default ~/trclient-documents). Without document_ids every document matching the filters is saved. Existing files are kept.

Inputs: source, since_days, document_ids, title_contains.

get_account_statusB
Read-only

Login state, securities account number and the active trading guardrails.

Inputs: no named parameters. Returns: object

get_available_sizeC
Read-only

How many units of an instrument can currently be sold.

Inputs: isin (required), exchange.

get_budget_statusA
Read-only

Budget ledger of this agent (TR_BUDGET_EUR): committed, remaining, units it bought, order fee. Orders that expired or were cancelled release their reservation automatically.

Inputs: no named parameters. Returns: object

get_cashA
Read-only

Cash balance of the account.

Inputs: no named parameters.

get_instrumentC
Read-only

Master data of an instrument: name, type, exchanges, tags.

Inputs: isin (required).

get_market_statusA
Read-only

Whether an instrument is tradable right now (quote freshness, spread, Trade Republic trading status).

Inputs: isin (required), exchange. Returns: object

get_newsB
Read-only

Recent news about an instrument from Trade Republic (in the app language, TR_LOCALE).

Inputs: isin (required), limit.

get_ordersA
Read-only

Open orders. With include_terminated=true: finished, cancelled and expired orders instead.

Inputs: include_terminated.

get_performanceC
Read-only

Price changes of an instrument over the usual reference periods.

Inputs: isin (required), exchange.

get_portfolioA
Read-only

All positions of the securities account, grouped by instrument type.

Inputs: no named parameters.

get_price_historyB
Read-only

Price history (OHLC aggregates) of an instrument.

Inputs: isin (required), range, exchange.

get_quoteC
Read-only

Current order price for an instrument (priceAsk / priceBid in EUR).

Inputs: isin (required), side, exchange.

get_stock_detailsB
Read-only

Trade Republic's own company details for a stock (description, key figures, analyst ratings).

Inputs: isin (required).

get_transactionsA
Read-only

Latest account transactions (timeline). Pass the cursor from a previous answer as after for older ones.

Inputs: after.

list_documentsA
Read-only

Documents of the last since_days days: account statements, trade confirmations, cost information, tax documents and postbox items. source: all | postbox | transactions. title_contains filters by title, e.g. "Kontoauszug".

Inputs: source, since_days, title_contains.

place_orderA
Destructive

Send a previously previewed order to Trade Republic. REAL MONEY.

Only works with a confirmation_id from preview_order (single use, expires). The guardrails are checked again right before sending.

Inputs: confirmation_id (required). Returns: object

preview_orderA
Read-only

Validate an order and check it against the guardrails WITHOUT sending it.

size is the number of units (fractions allowed). limit_price is required for order_type=limit, stop_price for stopMarket. expiry gtd needs expiry_date (YYYY-MM-DD). Market orders only support expiry gfd. Returns a single-use confirmation_id for place_order.

Inputs: isin (required), side (required), size (required), expiry, +6 more. Returns: object

search_instrumentsB
Read-only

Search tradable instruments by name, ticker or ISIN.

Inputs: query (required), asset_type.

wait_for_marketC
Read-only

Wait (max 300 s) until the instrument has a fresh two-sided quote.

Inputs: isin (required), exchange, timeout_seconds. Returns: object

wait_for_priceA
Read-only

Watch the live price (max 300 s) until it reaches above or falls to below. Returns when the level is reached or the timeout expires.

Inputs: isin (required), above, below, field, +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 22 tools

    Disambiguation5/5

    Each tool targets a distinct resource or action: cash, portfolio, orders, documents, instruments, market status, budget, and order lifecycle. Even the price-related tools are clearly separated by intent (quote, history, performance, market status, wait conditions). No two tools appear to do the same thing.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern: get_*, list_documents, search_instruments, download_documents, wait_for_*, preview_order, place_order, cancel_order. Verbs are specific and consistently placed at the start, making the tool surface predictable.

    Tool Count3/5

    With 22 tools, the server falls into the 16-25 range that starts to feel heavy. Most tools are individually justified for a broad trading client domain, but the overall count is borderline and could be perceived as cluttered.

    Completeness4/5

    The tool set covers the core lifecycle well: account status, cash, portfolio, orders, transactions, document retrieval, instrument research, market data, and order placement/cancellation. The main gap is order modification (update), but cancel-and-replace is a viable workaround.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to read a Trading 212 portfolio (balances, positions, orders, history) and place trades via the public API, supporting both demo and live environments.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server for Trade Republic that provides portfolio, cash balance, real-time quotes, and instrument search via an unofficial API.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables reading a Trading 212 Stocks ISA and safely previewing, approving, placing, and cancelling orders, with account, position, order-history, and instrument-search tools.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables Claude and other MCP clients to read your own brokerage portfolio, balances, PnL, order status and market data, and — only after opt-in — preview and confirm orders, closes, cancels and watchlist changes with cost checks and human approval. Runs read-only against the demo environment by default, with hard exposure caps, rate limits and local key storage.
      24
      105 npm
      MIT