trclient-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@trclient-mcp show me my portfolio and cash balance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
trclient: Trade Republic API and MCP server
Python client and local MCP server for the private API of the Trade Republic online brokerage.
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 loginlogin 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]documentsdownloads 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=1is set and--executeis 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-mcpAdd -e TR_TRADING_ENABLED=1 to allow orders. Without it the server is read-only.
Area | Tools |
Account |
|
Documents |
|
Market data |
|
Orders |
|
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 | |
Account |
|
Documents |
|
Market data |
|
Orders |
|
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 | |
| off |
|
|
| Maximum value of one buy |
|
| |
| – | Total amount orders may use |
| all | Comma-separated allow list |
|
| Fee per order |
|
| Download folder |
|
| Language of news and document titles |
| built in | Set if login fails with |
Every order attempt is logged to ~/.local/state/trclient/audit.jsonl.
License
MIT. Based on research from pytr and TradeRepublicApi.
Available Tools
22 toolscancel_orderADestructiveIdempotent
Cancel an open order by its order_id (from get_orders or place_order).
Inputs: order_id (required).
download_documentsBIdempotent
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_statusBRead-only
Login state, securities account number and the active trading guardrails.
Inputs: no named parameters. Returns: object
get_available_sizeCRead-only
How many units of an instrument can currently be sold.
Inputs: isin (required), exchange.
get_budget_statusARead-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_cashARead-only
Cash balance of the account.
Inputs: no named parameters.
get_instrumentCRead-only
Master data of an instrument: name, type, exchanges, tags.
Inputs: isin (required).
get_market_statusARead-only
Whether an instrument is tradable right now (quote freshness, spread, Trade Republic trading status).
Inputs: isin (required), exchange. Returns: object
get_newsBRead-only
Recent news about an instrument from Trade Republic (in the app language, TR_LOCALE).
Inputs: isin (required), limit.
get_ordersARead-only
Open orders. With include_terminated=true: finished, cancelled and expired orders instead.
Inputs: include_terminated.
get_performanceCRead-only
Price changes of an instrument over the usual reference periods.
Inputs: isin (required), exchange.
get_portfolioARead-only
All positions of the securities account, grouped by instrument type.
Inputs: no named parameters.
get_price_historyBRead-only
Price history (OHLC aggregates) of an instrument.
Inputs: isin (required), range, exchange.
get_quoteCRead-only
Current order price for an instrument (priceAsk / priceBid in EUR).
Inputs: isin (required), side, exchange.
get_stock_detailsBRead-only
Trade Republic's own company details for a stock (description, key figures, analyst ratings).
Inputs: isin (required).
get_transactionsARead-only
Latest account transactions (timeline). Pass the cursor from a previous answer as after for older ones.
Inputs: after.
list_documentsARead-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_orderADestructive
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_orderARead-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_instrumentsBRead-only
Search tradable instruments by name, ticker or ISIN.
Inputs: query (required), asset_type.
wait_for_marketCRead-only
Wait (max 300 s) until the instrument has a fresh two-sided quote.
Inputs: isin (required), exchange, timeout_seconds. Returns: object
wait_for_priceARead-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
Scored across 22 tools
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.
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.
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.
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
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Trades, stats, playbooks and notes from your Trandence trading journal. Read-only by default.
Agentic brokerage access to a US brokerage account: quotes, orders, positions, cash and documents.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for Trade Republic that provides portfolio, cash balance, real-time quotes, and instrument search via an unofficial API.MIT
- AlicenseNot gradedqualityBmaintenanceEnables reading a Trading 212 Stocks ISA and safely previewing, approving, placing, and cancelling orders, with account, position, order-history, and instrument-search tools.MIT
- AlicenseBqualityBmaintenanceEnables 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.24105 npmMIT