Stock Market MCP Server - Upstox & Rupeezy portfolio data for AI analysis
This HTTP-based stock market MCP server has well-structured tool definitions with proper Zod schemas and descriptions. All 6 tools follow a consistent verb_noun naming pattern (get_*, analyze_*) and include reasonable descriptions (130 - 220 chars, within the 10 - 1024 baseline). Input parameters are typed with enums for broker selection and intervals. However, there are notable gaps: output schemas are not formally documented (tools return JSON.stringify'd text rather than structured MCP content types with typed fields); error handling is minimal (generic error messages without recovery guidance); and parameter descriptions lack dependency hints or validation rules. The tools are read-only and broker-specific, which limits risk, but the output structure would benefit from explicit schema documentation for downstream LLM consumption. Overall, a solid mid-range implementation with room for improvement in schema rigor and error guidance.
Perform comprehensive portfolio analysis across all brokers. Returns: total P&L, top gainers/losers, concentration risk, diversification score (0-100), and broker-wise breakdown.
Get account balance, available margin, used margin, and collateral info from your brokerage accounts.
Fetch historical OHLCV (Open, High, Low, Close, Volume) candle data for a stock. For Upstox, use instrument key like 'NSE_EQ|INE002A01018'. For Rupeezy, use instrument key like 'NSE_EQ-2885'.
Fetch long-term stock holdings from your Indian brokerage accounts (Upstox/Rupeezy). Returns each holding with symbol, quantity, average price, current price, P&L, and invested value.
Fetch current open intraday and delivery positions from your brokerage accounts. Returns each position with symbol, product type, quantity, P&L, and day change.
Output schemas not formally documented. Tools return JSON.stringify'd text wrapped in MCP content blocks rather than structured response objects with typed fields. LLMs cannot infer what fields are present (e.g., in analyze_portfolio, the response includes 'totalPnl', 'topGainers', 'diversificationScore', but the tool definition does not declare these).
Error messages are generic and non-actionable. All tools catch errors and return 'Error: <message>' wrapped in isError: true. There is no guidance on what the LLM should do next (retry? call a different tool? ask the user?), no error classification (retryable vs. fatal), and no suggestion of alternatives.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | B | 76 | <=2025-11-25 | v2 |
Get real-time stock quote (LTP, OHLC, volume, change%) for Indian stocks. For Upstox, provide instrument keys like 'NSE_EQ|INE002A01018'. For Rupeezy, provide instrument keys like 'NSE_EQ-2885'.
Broker-specific instrument key format is documented in description but not enforced via schema validation. Users (or LLMs) can pass 'NSE_EQ|INE002A01018' to Rupeezy (which expects 'NSE_EQ-2885') and only fail at runtime with a generic error. Add validation and return format-specific error messages.
Date format validation missing. 'from_date' and 'to_date' in get_historical_data are free-form strings described as 'YYYY-MM-DD format' but not validated. No pattern constraint, minDate/maxDate logic, or runtime format check. LLMs may pass '2024-13-45' or '25-01-2024' and only fail at broker API boundary.
Missing parameter relationship documentation. 'broker' parameter in get_stock_quote defaults to 'upstox', but the instrument format depends on broker choice. If an LLM passes a Rupeezy instrument key with default broker='upstox', it will fail silently. Add: 'Instrument format must match broker: Upstox uses NSE_EQ|<code>, Rupeezy uses NSE_EQ-<code>.'
No pagination or result limits documented. get_portfolio can return hundreds of holdings; get_stock_quote accepts up to 50 instruments. If a user has 500 holdings or an LLM mistakenly passes 10,000 instruments, the response could be enormous. Consider capping results, documenting limits in descriptions, and offering pagination.