trading-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TRADING_MODE | No | Trading mode: 'paper' (default) or 'live'. | |
| TRADING_MCP_HOME | No | Path to the trading repo home directory. Defaults to current working directory if not set. | |
| ALLOW_DELIVERY_BUY | No | Allow delivery buy orders. | |
| ALLOW_INTRADAY_BUY | No | Allow intraday buy orders. | |
| ALLOW_LIVE_TRADING | No | Must be 'true' to enable live trading. Only settable by human in .env. | |
| MAX_OPEN_POSITIONS | No | Maximum number of open positions. | |
| ALLOW_DELIVERY_SELL | No | Allow delivery sell orders (should be false). | |
| ALLOW_INTRADAY_SELL | No | Allow intraday sell orders. | |
| MIN_RISK_REWARD_RATIO | No | Minimum risk:reward ratio. | |
| MAX_DAILY_LOSS_PERCENT | No | Maximum daily loss as percentage. | |
| PAPER_STARTING_CAPITAL | No | Starting capital for paper trading. | |
| MAX_POSITION_SIZE_PERCENT | No | Maximum position size as percentage of portfolio. | |
| MAX_RISK_PER_TRADE_PERCENT | No | Maximum risk per trade as percentage. | |
| REQUIRE_MANUAL_APPROVAL_FOR_LIVE_ORDERS | No | If 'true', requires manual approval for live orders. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| 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 |
|---|---|
| get_trading_configA | Current trading configuration (secrets redacted). The single source of truth for mode, permissions and risk limits. |
| get_current_trading_modeA | Effective trading mode. 'live' only when TRADING_MODE=live AND ALLOW_LIVE_TRADING=true. |
| update_trading_configA | Update runtime-updatable config keys in .env (risk limits, intraday/swing enable flags). Live-trading switches, ALLOW_DELIVERY_SELL and credentials can NOT be changed here — a human must edit .env. |
| switch_to_paper_modeA | Set TRADING_MODE=paper (always safe). |
| switch_to_live_modeA | Set TRADING_MODE=live. NOTE: real orders remain impossible until a human also sets ALLOW_LIVE_TRADING=true in .env. |
| validate_trading_permissionsB | Check config permissions for a prospective order (no market/risk checks). side: BUY|SELL, product_type: INTRADAY|DELIVERY. |
| fetch_live_priceA | Last traded price for an NSE symbol (requires broker credentials). |
| fetch_historical_dataB | Historical OHLCV candles. timeframe: ONE_MINUTE|FIVE_MINUTE|FIFTEEN_MINUTE| THIRTY_MINUTE|ONE_HOUR|ONE_DAY. Dates ISO format (optional). |
| fetch_market_statusC | Whether the market is open, pre-open or closed right now (IST). |
| fetch_symbol_metadataB | Instrument metadata: token, exchange, lot size, tick size. |
| fetch_watchlistA | Watchlist symbols: Chartink monthly-uptrend + RSI>50 scan, falling back to a static NIFTY list when the scan is unavailable. |
| calculate_smaC | Simple moving average (latest value). |
| calculate_emaC | Exponential moving average (latest value). |
| calculate_rsiC | Wilder RSI (latest value). |
| calculate_macdC | MACD line, signal and histogram (latest values). |
| calculate_bollinger_bandsC | Bollinger bands (latest values). |
| calculate_atrC | Average True Range — useful for stop-loss placement. |
| calculate_volume_analysisC | Volume vs its EMA, spike detection, 20-bar average. |
| detect_support_resistanceC | Support/resistance levels from clustered swing pivots. |
| detect_trendC | Trend direction from EMA stack + regression slope. |
| get_indicator_snapshotA | All standard indicators in one call (RSI, EMAs, MACD, Bollinger, ATR, volume, trend, VWAP on intraday timeframes). Prefer this over many single calls. |
| fetch_latest_newsA | Latest news items for one symbol with per-item sentiment. Matches the exact ticker OR a substring of the company name. The feed is the broad Indian-market stream (often small/mid-caps), so a given symbol may have no items right now — an empty list is a valid 'no recent news' answer. |
| fetch_market_newsA | Broad Indian-market news feed (Tradient, free). category: all | companies | , where sub_category is one of earnings-financial-results | corporate-actions | operational-updates | management-leadership | legal-compliance | product-launches-innovation | others. Matched against both category and sub_category. sentiment: all | positive | negative | neutral. Each item: symbol, stock_name, title, text, sentiment, category, sub_category, sector, publish_date (epoch ms). |
| get_market_sentimentA | Overall market sentiment and trends from the whole news feed. Returns a sentiment tally + percentages, an overall mood (bullish|bearish|neutral), the most active themes (sub-categories), and representative positive/ negative headlines. Use this for a top-down read of market mood before drilling into a specific symbol. |
| get_sector_sentimentA | Sentiment broken down by sector (from the Tradient feed). Returns each sector with a positive/negative/neutral tally and a mood label, sorted by news volume. Use to see which sectors are active and how the mood skews. |
| fetch_news_articlesA | Free-text news search via NewsAPI (newsapi.org). Requires NEWS_API_KEY in the env. Best for stock-specific or thematic news the Tradient feed misses (e.g. 'Reliance Q1 results', 'RBI rate decision'). Leave query empty for broad Indian-market news (NSE/BSE/Nifty/FII/GDP/RBI...) — useful for a general market read. NewsAPI provides NO sentiment label — read article_text to judge. Set full_text=True to also fetch each article's body (slower). days = lookback window in days (default 1). indian_only (default True) restricts results to Indian financial-news sources; set False for global coverage. Returns raw articles. |
| analyze_news_sentimentB | Aggregate sentiment counts for a symbol's recent news. The agent should read the texts (fetch_latest_news) for nuance — this is just the tally. For a market-wide read use get_market_sentiment instead. |
| fetch_portfolioA | Portfolio for the EFFECTIVE mode: paper portfolio in paper mode, broker holdings+positions in live mode. |
| fetch_order_historyB | Order history for the effective mode (paper orders, or broker order book). |
| calculate_portfolio_exposureC | Per-position exposure vs MAX_POSITION_SIZE_PERCENT (paper portfolio). |
| calculate_unrealized_pnlB | Paper portfolio P&L. Pass live_prices as {symbol: ltp} (e.g. from fetch_live_price) to include unrealized P&L. |
| calculate_position_sizeC | Quantity so the stop-loss loss equals risk_percent of capital, capped by MAX_POSITION_SIZE_PERCENT. |
| calculate_stop_lossC | ATR-based stop-loss suggestion from current price. |
| calculate_target_priceB | Target price for a desired risk:reward given entry and stop. |
| check_max_daily_lossB | Whether today's realized paper P&L has hit MAX_DAILY_LOSS_PERCENT. |
| check_portfolio_concentrationC | Concentration check across open paper positions. |
| validate_trade_against_risk_rulesB | Full pre-trade validation checklist: permissions, market status, risk limits, stop/target presence, risk:reward, position size, daily loss, open positions. Run this BEFORE any paper or live order. |
| evaluate_intraday_trade_setupB | Multi-timeframe (daily/1h/15m) intraday setup with a mechanical trade plan and confidence score. |
| evaluate_swing_trade_setupC | Daily-timeframe swing/delivery setup with support/resistance and a mechanical trade plan. |
| compare_multiple_symbolsB | Side-by-side indicator snapshots for up to 10 symbols. |
| scan_watchlist_for_swing_opportunitiesC | Evaluate the watchlist for swing setups, ranked by confidence score. |
| scan_watchlist_for_intraday_opportunitiesA | Evaluate the watchlist for intraday setups, ranked by confidence score. Slow: fetches three timeframes per symbol. |
| run_strategy_backtestB | Backtest a built-in strategy (ma_crossover | rsi_reversal | macd_trend | breakout_volume) on historical data. Returns trades, win rate, P&L, drawdown. |
| place_paper_orderA | Place a SIMULATED order in the paper account. If price is omitted the live LTP is used (requires broker credentials). The full validation checklist is enforced here too. |
| close_paper_positionC | Close an open paper position at the given price (or live LTP). |
| fetch_paper_tradesC | Closed paper trades, optionally filtered by INTRADAY or DELIVERY. |
| fetch_paper_portfolioA | Paper account: cash, open positions, realized P&L. |
| calculate_paper_trading_performanceA | Performance metrics: win rate, P&L, drawdown — overall, per product type, and per strategy. Use this to judge profitability before considering live mode. |
| generate_paper_trading_reportA | Full paper-trading report (performance + portfolio + recent trades). |
| reset_paper_accountA | Reset the paper account to starting capital, erasing simulated history. Requires confirm=true. |
| prepare_orderA | Validate and STAGE an order. Never executes. In live mode returns an approval_token; the human must approve before execution. Delivery sells are blocked and returned as recommendation-only. |
| validate_order_before_executionC | Re-run the full validation checklist for an order without staging it. |
| execute_intraday_order_after_validationA | Execute a prepared INTRADAY live order. Only call after the human has explicitly approved the prepared order shown to them. |
| execute_delivery_buy_after_validationB | Execute a prepared DELIVERY BUY live order. Only call after the human has explicitly approved. Delivery SELL can never be executed through this system. |
| block_delivery_sell_orderA | Record a delivery-sell RECOMMENDATION. The order is never sent to the broker — delivery sells require manual verification by the user. |
| list_pending_live_ordersC | Prepared live orders awaiting human approval. |
| cancel_pending_live_orderC | Cancel a prepared live order before execution. |
| fetch_broker_fundsA | Available funds/margins from the broker (requires credentials). |
| fetch_broker_positionsC | Today's positions from the broker. |
| fetch_broker_holdingsC | Delivery holdings from the broker. |
| fetch_broker_order_statusC | Status of a broker order by id. |
| send_telegram_notificationA | Send a free-text message to the configured Telegram chat. Requires TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in .env; if either is missing, returns {'sent': False, 'reason': 'telegram_not_configured'} without raising. parse_mode: HTML | Markdown | none. This sends a MESSAGE ONLY and never places an order. |
| send_trade_alertA | Format an 'ACTION REQUIRED' trade recommendation and send it to Telegram for the human to place manually (used in notify-only mode). side: BUY | SELL; trade_type: intraday | delivery; mode: paper | live. Sends a RECOMMENDATION ONLY — it does NOT place any order. The returned dict always includes 'preview' (the message text) so the agent can also surface it inline even when Telegram is not configured. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| intraday_trade_analysis | Disciplined intraday analysis workflow for one symbol. |
| swing_trade_analysis | Swing/delivery analysis workflow for one symbol. |
| paper_trading_review | Review paper-trading performance and judge strategy profitability. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| trading_config | Current trading configuration (secrets redacted). |
| safety_rules | The non-negotiable safety rules this server enforces. |
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/mukul8896/trading-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server