tradingcli
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PAPERTRADE_DB | No | SQLite portfolio path | ~/.papertrade.db |
| PAPERTRADE_API_TOKEN | No | Loopback API bearer token | |
| PAPERTRADE_PRICE_FILE | No | Deterministic local JSON price map | |
| PAPERTRADE_MCP_PROFILE | No | MCP catalog: core, advanced, full | core |
| PAPERTRADE_STATIC_PRICES | No | Inline JSON price map | {} |
| PAPERTRADE_MARKET_TIMEOUT | No | Historical request timeout | 15 |
| PAPERTRADE_PRICE_CACHE_TTL | No | Cross-process price cache life | 15 |
| PAPERTRADE_PRICE_PROVIDERS | No | Ordered file, static, yahoo provider chain | static,yahoo |
| PAPERTRADE_NOTIFICATION_FILE | No | Alert notification JSONL inbox | ~/.papertrade_notifications.jsonl |
| PAPERTRADE_ENCRYPTION_PASSWORD | No | Password used for encrypted copies | |
| PAPERTRADE_MCP_RESPONSE_FORMAT | No | Override a profile's response format: json|legacy |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| account_create | Create an account. Reuse idempotency_key safely when retrying the same mutation. |
| account_list | List all paper accounts and their cash balances. |
| tick | Check all pending limit orders against current prices and fill any that crossed. |
| positions | List open positions (symbol, side, qty, avg cost, asset class) for an account. |
| orders | List paginated order history, including source agent and idempotency key. |
| pnl | Mark-to-market P&L report for an account: positions, unrealized P&L, cash, total equity. |
| rename_account | Rename a paper portfolio. Updates positions, orders, history, and the default pointer. |
| summary | One-line-per-portfolio snapshot for all accounts: cash, equity, unrealized P&L, position count. Fast overview for deciding which account to act on. |
| performance | Portfolio performance since inception: return, CAGR, Sharpe, Sortino, volatility, max drawdown. Reconstructs a daily equity curve from the trade/cashflow ledger and real historical prices. |
| portfolio_backtest | Backtest the account's current open positions and cash with backtesting.py. The universe is read from this account's SQLite positions, options without reliable continuous history are reported as skipped, and results include the equity curve, return, CAGR, volatility, Sharpe, Sortino, and drawdown. The default window is five years; request up to 36500 calendar days. This is a current-holdings retrospective, not an out-of-sample strategy test. |
| rebalance_suggest | Suggest target weights for an account's current long spot holdings. method is one of: min_variance, risk_parity, equal_weight. Optimizes over the account's eligible existing symbol universe only (no new tickers, long-only, no leverage) using trailing daily returns. Cash is preserved; options, futures, and shorts are skipped. Returns current vs target weights and drift — this is a model output, not a recommendation to act on directly. |
| buy_option | Buy an option. expiry is YYYY-MM-DD, kind is 'C' or 'P', contracts x100 shares. Market order unless limit (premium) is given. Use option_chain to find valid expiries/strikes. |
| sell_option | Sell/write an option (opens a short if not covering). Same params as buy_option. |
| option_chain | List option expiries for an underlying, or near-the-money strikes for one expiry (YYYY-MM-DD). |
| futures_symbols | List supported futures symbols with their contract multiplier and initial margin. |
| set_default_account | Set the default portfolio used by the CLI and dashboard when no account is specified. |
| market_status | Holiday/early-close-aware NYSE status and next open/close time. |
| order_cancel | Cancel one pending order by id; canonical counterpart to order_cancel_all. |
| deposit | Add cash to a paper account. |
| withdraw | Remove cash from a paper account (fails if it would go negative). |
| get_default_account | Return the account used when CLI/TUI calls omit an explicit account. |
| account_details | Account balances, configured risk limits, and open-position count. |
| preview_order | Dry-run an order against cash, margin, short, naked-option, and leverage limits. |
| risk_get | Show the account's shorting, naked-option, leverage, and order-size limits. |
| risk_set | Change selected account risk limits; omitted fields retain their current values. |
| asset_search | Search Yahoo Finance for matching symbols, asset types, and exchanges. |
| validate_symbol | Validate a symbol and return its live price, class, multiplier, and margin. |
| bulk_quotes | Fetch up to 50 comma-separated live symbols concurrently. |
| healthcheck | Check SQLite integrity, WAL mode, schema version, and core record counts. |
| database_backup | Create a consistent online backup under ~/.papertrade_backups. |
| database_backups | List validated manual and pre-migration backups. |
| ledger_balances | Return double-entry ledger balances for an account. |
| execution_get | Return commission, slippage, liquidity, and partial-fill settings. |
| journal_list | List trade-journal entries, optionally filtered by tag or symbol. |
| journal_attribution | Attribute net realized results and commissions by symbol. |
| strategy_walk_forward | Select SMA parameters on training history and report out-of-sample results. |
| automation_list | List persisted local automation schedules. |
| broker_export | Export filled orders using generic, Alpaca, or IBKR CSV headers. |
| audit_log | Paginated mutation audit trail with agent and idempotency attribution. |
| order_submit | Submit market, limit, stop, stop-limit, trailing, bracket, OCO, or OTO orders. |
| order_get | Get one order by numeric id or by account plus client order id. |
| order_replace | Replace selected fields on a pending order and return the new order id. |
| order_cancel_all | Cancel every pending/held order, optionally restricted to one account. |
| position_get | Get one live-marked position with market value and unrealized P&L. |
| position_close | Close all or part of one position by quantity or percentage. |
| position_close_all | Liquidate every open position in an account at current market prices. |
| option_contract | Parse and quote one OCC option contract. |
| watchlist_create | Create a persistent named watchlist with comma-separated symbols. |
| watchlist_list | List an account's persistent watchlists. |
| watchlist_get | Get one named watchlist or numeric watchlist id. |
| watchlist_add | Add a symbol to a persistent watchlist. |
| watchlist_remove | Remove a symbol from a persistent watchlist. |
| watchlist_delete | Delete a persistent watchlist. |
| watchlist_quotes | Return live quotes for every symbol saved in a watchlist. |
| trading_calendar | List NYSE sessions, including holidays and early closes. |
| account_activity | Unified account fills, orders, transfers, dividends, splits, and option events. |
| market_bars | Historical OHLCV bars from Yahoo Finance. |
| market_latest_quote | Latest bid, ask, and last indication. |
| market_snapshot | Combined latest quote, daily bar, previous close, and change. |
| market_news | Recent symbol news headlines and links. |
| market_most_actives | Current most-active equity screener. |
| market_movers | Current day gainers and losers. |
| mcp_catalog | Describe the active catalog, response contract, profiles, and legacy aliases. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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