# Quantio MCP — Full Technical Reference > Authoritative specification for LLMs, AI coding agents, and RAG systems querying Iranian capital markets via Quantio MCP. ## Server Endpoint - Base Web URL: https://mcp.quantio.ir - MCP Streamable HTTP Endpoint: https://mcp.quantio.ir/api/mcp - Protocol: Model Context Protocol (JSON-RPC 2.0 over HTTP POST) - Headers: - `Authorization: Bearer qnt_live_YOUR_API_KEY` - `Content-Type: application/json` - `Accept: application/json, text/event-stream` ## MCP Client Configuration (Antigravity / Claude Desktop / Cursor / Windsurf) ```json { "mcpServers": { "quantio": { "url": "https://mcp.quantio.ir/api/mcp", "headers": { "Authorization": "Bearer qnt_live_YOUR_API_KEY" } } } } ``` ## MCP Tools Reference ### `search_entities` (FREE) Resolve Persian/English names, tickers, ISINs, FipIran regNos, or macro FX/gold symbols to canonical entities. - **Returns:** Canonical entity list with symbol, ISIN, type, sector, and source mappings. - **Parameters:** - `query` (`string`, required): Ticker, Persian/English name, ISIN, FipIran regNo, or macro code (e.g. USD) - `type` (`"stock" | "fund" | "etf" | "index" | "macro"`, optional): Filter entity category - `limit` (`number (1-50)`, optional): Max results (default 10) - **Default Example:** `{"query":"فولاد","limit":5}` ### `get_symbol_realtime` (FREE) Latest OHLC price, volume, real/legal money flow, and 5-level orderbook (plus FX, gold, coin & oil macro benchmarks). - **Returns:** Snapshot with last/close, change %, P/E, real vs legal flow, orderbook, and freshness flag. - **Parameters:** - `symbol` (`string`, required): Ticker, ISIN, or macro symbol (e.g. فولاد or USD) - **Default Example:** `{"symbol":"فولاد"}` ### `get_historical_ohlcv` (FREE) OHLCV candle series aggregated by day, week, or month for equities, ETFs, and macro benchmarks (30d on Free, full history on Pro). - **Returns:** Compact OHLCV tuples [date, open, high, low, close, volume] and tier window. - **Parameters:** - `symbol` (`string`, required): Ticker, ISIN, or macro benchmark (e.g. فولاد or USD) - `timeframe` (`"1d" | "1w" | "1m"`, optional): Candle aggregation (default 1d) - `limit` (`number (1-1500)`, optional): Candle count (default 30) - **Default Example:** `{"symbol":"فولاد","timeframe":"1d","limit":15}` ### `get_fund_profile` (FREE) Mutual fund & ETF profile combining FipIran registry, TSETMC ETF quotes, and direct single-NAV/multi-NAV portal intelligence (TadbirPardaz, RayanHamAfza, NikaSarmayeh, Mabna). - **Returns:** Issue/cancel/stat NAV, multi-horizon returns, AUM, asset allocation, institution details, NAV history, and direct FMS portal intelligence (realtime NAV, sub-portfolios, industries, owners, expenses, leveraged units). - **Parameters:** - `symbol_or_id` (`string`, required): Fund ticker or FipIran regNo (e.g. عیار, یاقوت, طلا, اهرم, کیان, معیار) - **Default Example:** `{"symbol_or_id":"کمند"}` ### `compare_funds` (FREE) Side-by-side normalized comparison of 2 to 10 Iranian funds and ETFs. - **Returns:** Normalized NAV, multi-horizon returns, AUM, manager, asset mix, and top return/AUM leaders. - **Parameters:** - `ids` (`string[] (2-10)`, required): List of fund tickers or FipIran regNos - **Default Example:** `{"ids":["کمند","کیان","آگاس"]}` ### `get_codal_filings` (PRO) Direct *.codal.ir corporate disclosures: financial statements (ن-10), monthly activity (ن-30/ن-31), board governance (ن-45), KPIs, tables, and attachments. - **Returns:** Tracing numbers, titles, categories, letter codes, audited/consolidated flags, publish timestamps, structured tables/KPIs/attachments, and Codal URLs. - **Parameters:** - `symbol` (`string`, required): Stock or fund ticker - `limit` (`number (1-50)`, optional): Max filings (default 10) - `category` (`string`, optional): Filter by filing category (e.g. financial_statement, monthly_activity, board_governance) - `letter_code` (`string`, optional): Filter by Codal form code (e.g. ن-10, ن-30, ن-31, ن-45) - `audited_only` (`boolean`, optional): Return only audited disclosures when true - **Default Example:** `{"symbol":"وفیروزه","limit":5}` ### `screen_market` (PRO) Filter TSETMC equities (debt/treasury bills excluded) and FipIran funds/ETFs by P/E, volume ratio, real-money inflow, fund category, and returns. - **Returns:** Ranked symbols matching quantitative thresholds with flow, P/E, fund category, manager, and return metrics. - **Parameters:** - `type` (`"stock" | "fund" | "etf"`, optional): Market segment - `min_pe` (`number`, optional): Minimum P/E ratio - `max_pe` (`number`, optional): Maximum P/E ratio - `min_volume_ratio` (`number`, optional): Minimum volume / 30d avg ratio - `min_real_inflow` (`number`, optional): Minimum net real-money inflow (IRR) - `min_return_1m` (`number`, optional): Minimum 1-month return (%) - `min_return_1y` (`number`, optional): Minimum 1-year return (%) - `fund_type` (`string`, optional): Persian or English fund type alias (e.g. gold, fixed_income, equity, leveraged, mixed) - `sort_by` (`"value" | "change_pct" | "real_inflow" | "return_1y" | "aum" | "pe"`, optional): Sort column - `limit` (`number (1-50)`, optional): Max rows (default 20) - **Default Example:** `{"type":"stock","max_pe":12,"sort_by":"real_inflow","limit":10}` ## MCP Resources - `quantio://market/overview`: TEDPIX index value, market breadth, total value traded, and top 5 real-money inflow equities. - `quantio://entity/{symbol}/profile`: Canonical entity metadata, source mappings, latest market snapshot, and fund metrics. ## Live Source Adapters ### TSETMC Market Feed (`tsetmc`) - Page: https://mcp.quantio.ir/adapters/tsetmc - Upstream: https://cdn.tsetmc.com/api/* - Transport: IPv4-pinned aiohttp + msgspec · Token Bucket + Circuit Breaker - Summary: Real-time Tehran Stock Exchange & Fara Bourse equities, ETFs, 5-level limit orderbooks, individual vs institutional money flow, market indices (TEDPIX), 15-field instrument profiles, backward-adjusted daily OHLCV, and mutual fund NAVs. - MCP Tools: search_entities, get_symbol_realtime, get_historical_ohlcv, get_fund_profile, screen_market - Dataset **MarketWatch + 5-Level Orderbook** (`/api/ClosingPrice/GetMarketWatch`, Every 30s -> `entities, market_snapshots`): OHLC, closing/last prices, P/E, volume ratio, and top-5 bid/ask levels. - Dataset **Real vs Legal Client Flow** (`/api/ClientType/GetClientTypeAll`, Every 30s -> `market_snapshots`): Individual vs institutional buy/sell volumes and trader counts. - Dataset **Market Indices (TEDPIX)** (`/api/Index/GetIndexB1LastAll/All/1`, Every 30s -> `entities, market_snapshots`): Overall TEDPIX, equal-weighted index, and sector indices. - Dataset **15-Field Instrument Profiles** (`/api/Instrument/GetInstrumentIdentity + GetInstrumentInfo`, Progressive SQLite hydration -> `entities (source_mappings)`): ISIN, 5-char code, company code/ISIN, market board, sector & sub-sector. - Dataset **Adjusted Daily OHLCV History** (`/api/ClosingPrice/GetClosingPriceDailyList + GetPriceAdjustList`, Daily progressive sync -> `market_snapshots`): Corporate-action split/capital-increase backward-adjusted candles. - Dataset **Mutual Fund Registry** (`/api/Fund/GetFunds/{4,6,7}`, Every cycle -> `entities, fund_metrics`): Issue/cancel/statistical NAVs, 1m/3m/1y returns, and AUM across 300+ funds. ### Codal Regulatory Disclosures (`codal`) - Page: https://mcp.quantio.ir/adapters/codal - Upstream: https://search.codal.ir · https://www.codal.ir · https://excel.codal.ir - Transport: Per-proxy paced aiohttp + lxml.html + var datasource JSON + Excel parser - Summary: Direct *.codal.ir regulatory disclosure pipeline indexing all 5,453+ Codal publishers, audited & interim financial statements (`ن-10` with multi-sheet auto-following across Auditor Opinion, Income Statement, and Balance Sheet), monthly activity & portfolio reports (`ن-30`/`ن-31`), board governance (`ن-45`), AGM resolutions (`ن-51`/`ن-52`), capital increases (`ن-60`), `Attachment.aspx` files, and `excel.codal.ir` workbooks. - MCP Tools: get_codal_filings, search_entities - Dataset **Direct Disclosure Search** (`https://search.codal.ir/api/search/v2/q`, Every 300s (safe Total pagination) -> `filings`): Queries by symbol, category (1..11), letter type/code, period, and Jalali dates. - Dataset **5,453 Publisher & Category Catalogs** (`https://search.codal.ir/api/search/v1/{companies,IndustryGroup,categories,financialYears}`, 12h SQLite cache -> `filings (summary_json.issuer)`): Enriches ISIC codes, market status, reporting types, and fiscal year-ends. - Dataset **Multi-Sheet Statement Datasource** (`https://www.codal.ir/Reports/Decision.aspx?LetterSerial=...&sheetId={19->1->0}`, Incremental (cached by TracingNo) -> `filings (tables, kpis)`): Follows Auditor Opinion (19) -> Income Statement (1) + Balance Sheet (0) and extracts KPIs. - Dataset **Board Governance & Attachments** (`https://www.codal.ir/Reports/{Attachment_Partial.aspx,Attachment.aspx,Decision.aspx}`, Incremental (cached by TracingNo) -> `filings (board_members, attachments)`): Extracts CEO, directors, national IDs, independence, and downloadable file links. - Dataset **Excel Financial Workbooks** (`https://excel.codal.ir/... (when CODAL_FETCH_EXCEL=true)`, On-demand per TracingNo -> `filings (excel_summary)`): Parses .xlsx/.xls financial statement sheets in pure Python with size/safety caps. ### FX, Gold & Commodities (`macro_rates`) - Page: https://mcp.quantio.ir/adapters/macro_rates - Upstream: Iranian FX, Bullion & Global Commodity Feeds - Transport: Async aiohttp + msgspec · Multi-Feed Consensus · 4x Daily IRST Cron - Summary: Full historical archive (1979–present) plus 4x-daily IRST intraday updates across 18 Iranian FX, gold, coin, coin-bubble, silver, and Brent crude benchmarks with multi-feed consensus reconciliation and same-source daily change normalization. - MCP Tools: search_entities, get_symbol_realtime, get_historical_ohlcv - Dataset **Historical Daily OHLC Archive** (`Primary Daily OHLC Feed`, Initial full backfill + 4x daily 5d overlap -> `entities, market_snapshots`): Daily OHLC series since 1979 across FX, gold, coins, silver, and Brent oil. - Dataset **Free-Market Cash FX & Coin Archive** (`Multi-Year Cash FX & Coin Archive (2012–present)`, Initial full backfill + current year -> `market_snapshots (reconciled)`): Historical cash FX/coin rates normalized to IRR and reconciled via consensus rules. - Dataset **Intraday Reference Quotes** (`4x Daily Live Snapshot Feeds`, 4x daily (09:30, 13:00, 16:30, 20:00 IRST) -> `market_snapshots, data/market_data_historical.{csv,sqlite3}`): Free-market cash FX authority on wide divergence; same-source delta normalization. ### FipIran Fund Analytics (`fipiran`) - Page: https://mcp.quantio.ir/adapters/fipiran - Upstream: https://fipiran.ir/services/* - Transport: Async aiohttp + msgspec · Rate-Paced Bulk Compare + Progressive NAV History - Summary: Live Iranian mutual fund & ETF registry powered by FipIran Services covering 518+ funds across all 18 SEO categories (Fixed Income, Gold/Commodity, Equity, Mixed, Leveraged, Index, Venture, Real Estate). Indexes daily issue/cancel/statistical NAV curves, 1m/3m/6m/1y/since-start returns, AUM, asset allocation mixes, category benchmark averages, and manager/custodian/auditor governance. - MCP Tools: get_fund_profile, compare_funds, screen_market, search_entities - Dataset **All-Funds Bulk Compare & Asset Mix** (`POST /services/fund/fundcompare`, Every cycle (518+ funds/ETFs) -> `entities, fund_metrics`): NAVs, AUM, units, 1d–since-start returns, 12m–60m rankings, and Bond/Deposit/Stock/Cash weights. - Dataset **Official SEO Fund Type Catalog** (`GET /services/fund/fundtype`, Every cycle (18 categories) -> `fund_metrics (fund_type)`): Maps integer category codes (4, 5, 6, 7, 21, 22...) to canonical Persian titles. - Dataset **Category Average Return Benchmarks** (`GET /services/fund/averagereturns`, Every cycle -> `entities (source_mappings)`): Attaches category-wide 1m/1y peer average returns onto each tracked fund. - Dataset **Institutional Fund & Flow Detail** (`GET /services/fund/getfund?regno={regNo}&groupId={groupId}`, 12h SQLite cache (top AUM progressive) -> `entities (source_mappings)`): Enriches legal/retail investor percentages, daily sub/red units, national ID, and executive manager. - Dataset **Historical Daily NAV Curve** (`GET /services/chart/getfundchart?regno={regNo}&getAll=false`, Progressive SQLite watermark -> `fund_metrics`): Backfills trailing daily issue/cancel/statistical NAV curves into Postgres. ### Direct Fund Portals (`fund_db`) - Page: https://mcp.quantio.ir/adapters/fund_db - Upstream: TadbirPardaz · RayanHamAfza · NikaSarmayeh · Mabna - Transport: IPv4 aiohttp + 4-FMS Auto-Detector (Single-NAV & Multi-NAV) - Summary: Multi-engine direct fund portal collector supporting Iran's 4 major Fund Management Systems — TadbirPardaz, RayanHamAfza, NikaSarmayeh, and Mabna — across both single-NAV and multi-NAV funds (umbrella multi-subfund portals, leveraged base+super tiers, and market-making multi-portfolio funds). - MCP Tools: get_fund_profile, compare_funds, screen_market - Dataset **TadbirPardaz (Single-NAV & Multi-NAV Leveraged/MMF)** (`/Fund/{GetETFNAV,GetLeveragedNAV,GetMarketMakerNav} · /Reports/AjaxFundNavList · /Chart/{Asset,Industry}Compositions`, Every 30m -> `entities, fund_metrics`): Single-NAV ETFs/mutuals, multi-NAV leveraged base+super unit NAVs, and multi-basket market-maker funds. - Dataset **RayanHamAfza (Single-NAV & Multi-Subfund Umbrella)** (`/api/v1/public/{siteInfo,fundItems,fundNavInfo/{id},mixNavInfo/1,timePeriodAssetStructure/{id},industries/{id},premiumOwners,expenses}`, Every 30m -> `entities, fund_metrics`): Certified & intraday NAVs, umbrella multi-subfund routing (e.g. طلا & نقرسا), industries, owners & fees. - Dataset **NikaSarmayeh (Next.js SSR + Realtime ETF NAV)** (`Next.js SSR dehydrated queries: investmentInfo, assetCombination, stockPortfolio, unitPrice, netAsset`, Every 30m -> `entities, fund_metrics`): Certified EOD + intraday realtime ETF NAVs, commodity bullion/bond mixes, and 6-month unit price history. - Dataset **Mabna (Single-NAV & Multi-Portfolio Market-Making)** (`/api/v2/public/fund/{portfolios,last-nav?portfolio_id=,acc/last-nav,etf/navps/latest,assets-classification,portfolio-roles,chart}`, Every 30m -> `entities, fund_metrics`): Accumulative & per-portfolio NAVs (single funds + 10-50+ portfolio market makers), owners & roles. ## Tiers & Rate Limits - **Free**: dailyCalls=100, rpm=10, freshness=15 minutes delayed, maxApiKeys=1, tools=[search_entities, get_symbol_realtime, get_historical_ohlcv, get_fund_profile, compare_funds] - **Pro**: dailyCalls=5000, rpm=120, freshness=Real-time (< 5s), maxApiKeys=5, tools=[search_entities, get_symbol_realtime, get_historical_ohlcv, get_fund_profile, compare_funds, get_codal_filings, screen_market] - **Enterprise**: dailyCalls=Unlimited, rpm=Unlimited, freshness=Real-time (< 5s), maxApiKeys=1000, tools=[search_entities, get_symbol_realtime, get_historical_ohlcv, get_fund_profile, compare_funds, get_codal_filings, screen_market] ## Example Prompt Recipes - **Compare top fixed-income funds by 1-year yield and AUM** (Funds · tools: compare_funds, get_fund_profile): Use compare_funds on کمند, کیان, and آگاس. Rank them by 1-year return, AUM, and issue/cancel NAV spread, and summarize the cash and bond allocation. - **Detect net real-money inflow in large-cap equities** (Money Flow · tools: screen_market, get_symbol_realtime): Run screen_market for stocks with min_volume_ratio >= 1.2 sorted by real_inflow, then inspect get_symbol_realtime for the top ticker to verify bid/ask orderbook depth. - **Full institutional check on فولاد (Mobarakeh Steel)** (Stocks · tools: get_symbol_realtime, get_historical_ohlcv, get_codal_filings): Fetch real-time quote, real/legal flow, and 30-day daily OHLCV for فولاد using get_symbol_realtime and get_historical_ohlcv, plus the latest 5 Codal disclosures. - **Evaluate gold ETF NAV premium and liquidity** (Funds · tools: compare_funds, get_symbol_realtime): Compare gold ETFs عیار and کهربا with compare_funds and check real-time orderbook spreads via get_symbol_realtime. - **Screen low P/E industrial stocks with positive inflow** (Stocks · tools: screen_market): Use screen_market on stocks with max_pe = 9 and min_real_inflow = 100000000000 sorted by pe to surface undervalued liquid equities. - **Audit recent Codal monthly sales & earnings filings** (Codal · tools: get_codal_filings): Retrieve the latest Codal disclosures for فملی and شپنا using get_codal_filings and extract key revenue growth and margin figures from summary_json. - **Spot real vs legal accumulation on وبملت and شستا** (Money Flow · tools: get_symbol_realtime): Inspect get_symbol_realtime for وبملت and شستا to compare real_buy_vol vs real_sell_vol and legal_buy_vol vs legal_sell_vol. - **Analyze multi-week price trend for فملی** (Stocks · tools: get_historical_ohlcv): Pull weekly OHLCV candles for فملی with get_historical_ohlcv (timeframe: 1w, limit: 24) and identify key support and volume expansion weeks. - **Track USD, Emami coin bubble, and 18K gold trends** (Macro · tools: get_symbol_realtime, get_historical_ohlcv): Fetch real-time quotes via get_symbol_realtime for USD, Emami1, Emami1_BLUBBER, and GoldGeram18, plus 30-day historical bars via get_historical_ohlcv, and summarize recent coin bubble spread and FX velocity. - **Screen gold ETFs by AUM and inspect NAV premium** (Funds · tools: screen_market, get_fund_profile): Use screen_market with type='etf', fund_type='gold', sort_by='aum', limit=5, then call get_fund_profile on عیار to examine its 1y return, asset allocation, custodian, and ETF market NAV premium/discount.