tradingcli
This server is the MCP interface for TradingCLI, a local-first paper-trading and market-simulation platform that lets you manage fake brokerage accounts, execute diverse order types, analyze portfolios, backtest strategies, and access market dataβall without a real broker. Key capabilities include:
Account Management: Create, list, rename, and view account details; deposit/withdraw cash; set a default account; view unified account activity.
Order & Position Management: Submit market, limit, stop, stop-limit, trailing, bracket, OCO, OTO orders; preview orders; cancel/replace orders; close or liquidate positions; trigger tick to fill pending orders.
Options & Futures: Buy/sell option contracts; view option chains; parse OCC symbols; list futures symbols with margin requirements.
Market Data: Search/validate symbols; get quotes, OHLCV bars, snapshots; bulk quotes (up to 50); news, most-actives, movers; check market status and trading calendar.
Portfolio Analytics & Research: View P&L, performance metrics (CAGR, Sharpe, Sortino, etc.), ledger balances; backtest holdings; walk-forward SMA tests; rebalancing suggestions (min variance, risk parity, equal weight); account snapshots.
Risk Management: Set shorting, leverage, concentration, drawdown limits; preview orders against limits; adjust commission/slippage/liquidity settings.
Watchlists: Create, manage watchlists; view live quotes per watchlist.
Journals & Audit: List journal entries; view attribution by symbol; browse audit trail.
Operations & Utilities: Healthcheck; database backups; export fills to CSV (generic, Alpaca, IBKR); list automations; view MCP tool catalog; manually process market ticks.
Click on "Install 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., "@tradingcliRun a backtest on my current holdings"
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.
π TradingCLI
A fast, local-first paper-trading and market-simulation toolkit for your terminal.
TradingCLI gives you a fake brokerage account that lives in one file on your own machine. You place orders against it, and it fills them using real market prices from Yahoo Finance. No signup, no API key, and no code path that reaches a real broker.
you Β· or your AI agent
β
βΌ
tradingcli (dashboard Β· commands Β· MCP server)
β
ββββββββββββββ΄βββββββββββββ
βΌ βΌ
~/.papertrade.db Yahoo Finance
accounts, orders, prices only,
positions, ledger read-onlyπ Install and run
Requires Python 3.10 or newer.
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install .
tradingcliThat last command opens the dashboard and a first-run setup wizard. From there:
tradingcli buy AAPL 5 # place a trade
tradingcli positions # see what you hold
tradingcli backtest # test today's holdings against history
tradingcli --help-all # every command, no market data neededThree ways to drive it β all sharing the same database:
How you start it | Best for | |
π₯οΈ Dashboard |
| Watching portfolios update live |
β¨οΈ Commands |
| Scripting, automation, one-off actions |
π€ MCP server |
| Letting Claude or another agent trade |
Related MCP server: tastytrade-mcp
π₯οΈ Screenshots
All portfolios | Position detail |
|
|

The captures come from a local paper-trading database; they contain no real portfolio or credential data.
β¨ What you get
Area | What is included |
β‘ Fast terminal UX | ~20 ms median startup, persistent quote cache, offline-first dashboard |
πΌ Portfolio simulation | Multiple accounts, deposits, withdrawals, P&L, time-weighted returns |
π§Ύ Advanced orders | Market, limit, stop, stop-limit, trailing, bracket, OCO, OTO, multi-leg options |
π Instruments | Equities, ETFs, crypto, FX, futures and equity options |
π§ͺ Research | Current-holdings backtests, walk-forward tests, portfolio optimization |
π Local operations | Alerts, reports, quote streaming, scheduling, backups, encrypted copies |
π€ Agent ready | Local stdio MCP server with core, advanced and compatibility profiles |
π‘οΈ Durable storage | SQLite WAL, fixed precision, 56 data guards, migration backups, |
π€ For AI agents
The usual way to let an agent practise trading is a hosted paper API such as Alpaca's: signup, API keys, and a network round trip per order. TradingCLI does the same job with a local SQLite file β no keys to leak, no rate limits, and prices you can pin so a run replays exactly, which a live API cannot do.
PAPERTRADE_DB=./agent-sandbox.db tradingcli-mcpβ docs/agents.md β the full comparison, the safety rails (narrow tool catalog, idempotency keys, engine-enforced risk limits, audit trail), and how to wire up an MCP client.
π Documentation
Guide | What's in it |
Orders, options, market data, ledger, risk, alerts, backups β the full CLI reference | |
MCP server, tool profiles, and using this instead of a hosted paper API | |
Environment variables, storage model, schema and migrations | |
Design decisions | |
Release history |
π Backtesting
Press g in the dashboard to open Backtesting & Graphs. It puts the
selected portfolio's live performance curve next to a backtesting.py backtest
of the same holdings, reporting return, CAGR, volatility, Sharpe, Sortino,
costs and maximum drawdown. The universe comes only from that account's open
positions; another account's names never leak in. Pick a window on open (6m,
1y, 2y, 5y, 10y, max, or an exact number of days).
Read the backtest for what it is. It answers one narrow question: how today's open quantities and current cash would have performed if held unchanged over the chosen history. Because today's holdings are already known, it carries look-ahead and survivorship bias β it is not an out-of-sample strategy test. It uses adjusted daily Yahoo prices, skips options (reliable point-in-time option-chain history does not exist) and treats futures as continuous series with no roll costs.
π‘οΈ Safety
TradingCLI never places live brokerage orders, and Yahoo Finance is not an exchange-grade feed. Do not use it as the sole source for financial decisions, and do not expose its stdio MCP server as an unauthenticated network service.
Fetching prices, news, history and option chains sends held, pending or
watchlisted symbols to Yahoo Finance through yfinance. See
SECURITY.md for the local-data and network privacy model.
π§βπ» Development
uv sync --locked --extra dev
uv run python run_tests.py
ruff check .The runner discovers every test_*.py contract and executes each one in an
isolated subprocess and temporary database. GitHub Actions runs the same checks
on Python 3.10 and 3.13.
Contributions are welcome β see CONTRIBUTING.md. Security reports should follow SECURITY.md, not a public issue.
π License
Released under the MIT License.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceFull-lifecycle algorithmic trading MCP server. AI strategy generation from plain English, backtesting, live bot deployment to 10+ brokers, portfolio monitoring, and prediction markets. Stocks, options, crypto, futures. 32 tools. Free tier.
- FlicenseAqualityCmaintenanceMCP server for the tastytrade brokerage API, providing tools for account management, market data, and order execution.18
- FlicenseBqualityCmaintenanceMCP server for Interactive Brokers via IB Gateway, enabling read access to account data and trading capabilities for paper accounts.11
- AlicenseBqualityCmaintenanceA read-only-by-default MCP server for Interactive Brokers that exposes account, positions, PnL, market data, and trade history from a local TWS/IB Gateway session, with optional trading capabilities.15MIT
Related MCP Connectors
Hosted MCP for stocks, options, Greeks, brokers, order previews, alerts, and workflows.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Alpaca MCP β real-time US stock market data via the Alpaca Market Data API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryanrodrigues25200525-svg/tradingcli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server

