iran-bourse-mcp
One line: iran-bourse-mcp is a read-only MCP server that gives any AI agent clean, structured data from the Tehran Stock Exchange, Fara Bourse and Codal — quotes, order books, ticks, flows, screening, derivatives, funds, Codal filings and fundamentals.
Market pulse — check whether the market is open and when it next opens (
market_status, with the 1405 holiday calendar), plusmarket_overview,indices,industry_summaryandindex_contributorsfor index values, industry breakdowns and which stocks moved the index.Whole-market views — scan ~3,700 instruments (shares, funds, bonds, options, futures, rights, commodities) with
market_watch, rank the session withtop_movers(gainers, losers, buy/sell queues, real-money inflow/outflow, buyer power) and pull any past day's end-of-day table withmarket_snapshot;top_listsexposes the exchange's own 69 "برترینها" tables.Stock screener — write conditions in a safe expression language via
screen_stocks(live values plus up to 60 days of history, adjusted prices, money flow, order book), with 15 ready-made presets andscreener_referencefor fields, functions and syntax.Single-symbol deep dives —
search_symbolthensymbol_overviewfor a one-call dossier,quotefor live price/limits/VWAP/P-E/market cap,price_history(daily to yearly, back-adjusted), andtechnical_indicators(SMA/EMA, RSI, MACD, Bollinger, ATR, stochastic, OBV, support/resistance, 52-week range).Microstructure —
order_bookfor the five-level book with queue detection,order_book_historyfor intraday queue episodes, andtrades/trade_summaryfor tick-by-tick data aggregated into bars, VWAP, biggest trades, pressure estimates and a coverage check.Who is buying —
real_legal_flowfor real-vs-legal counts, per-capita, buyer power and net flow history;shareholders,shareholder_history,shareholder_portfolioandmarket_holder_movesfor major holders and their position changes.Derivatives —
option_chainwith calls/puts by strike and expiry, moneyness, intrinsic/time value, open interest, max pain and covered-call returns;futures_marketwith basis and annualised basis.Corporate events and supervision —
capital_calendarfor upcoming capital increases and price adjustments,corporate_actions,trading_statusfor halts/supervision/state changes, andsupervisor_messages.Funds —
fund_rankingacross ~580 funds of 15 types (NAV, returns, size, portfolio mix) andetf_navfor premium/discount to issue and redemption NAV.Commodities and energy —
commodity_marketfor IME physical trades, roll-ups and dollar rate;energy_marketfor IRENEX auctions, offers, order levels and the power market.Fundamentals from Codal —
fundamentals(EPS, P/E, P/S, P/B, margins, ROE),financial_statements(income statement, balance sheet, cash flow, ratios, bank/insurer templates),monthly_activity(monthly sales by product),codal_filings,codal_letterandcodal_company.Helpers —
glossaryfor Persian↔English market terms,symbol_statisticsfor exchange-computed averages, and four prompts (analyze_symbol,daily_market_report,smart_money_scan,find_stocks).Constraints to remember — everything is read-only (no order placement, no login), prices are in rial, dates accept Gregorian or Jalali, and the server must run from an Iranian IP or through an in-Iran proxy.
Click on "Deploy 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., "@iran-bourse-mcp وضعیت فولاد رو با صف و ورود پول حقیقی بررسی کن"
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.
Website · Install · Benchmarks · Tools · Screener · Real examples · Data notes · راهنمای فارسی · فارسی
An open-source MCP server that gives any AI agent complete, clean Tehran Stock Exchange (TSETMC / بورس تهران و فرابورس) and Codal data: a stock screener with its own filter language, quotes, order book and queues, tick-by-tick trades, real-vs-legal money flow, options and futures, index history, funds, major shareholders, filings and more. Units are explicit, derived numbers are labelled, and nothing can place an order.
Unofficial. Not affiliated with TSETMC, the Tehran Stock Exchange, Fara Bourse or Codal. Information only, not investment advice.

▶ Watch the 2-minute film · Download MP4 (22.4 MB) · Vertical 9:16, Full HD and 4K
▶ 15-second tour (MP4) · GIF for sharing
Why it exists
An agent with a web browser cannot really read the Iranian market. We tested it:
The site is an empty shell. Fetching a symbol page from
tsetmc.comreturns a title and nothing else. Codal's report list comes back as unrendered{{template}}placeholders.The hidden JSON API speaks in codes and has traps. Fields like
qTotTran5J,pMeDem,zOrdMeOf; the exchange's ownpriceChangewas0.0for a stock that rose 120 rial; order-book history is a delta feed; shareholder rows come back twice.A day of ticks is 3 MB of JSON. Nobody should paste that into a context window.
iran-bourse-mcp finds the data, fixes the traps, reassembles what is fragmented, summarises what is huge and labels everything it infers.
Related MCP server: codal-mcp
Install
Works with every MCP client, and with agents that have none. You need uv (powershell -c "irm https://astral.sh/uv/install.ps1 | iex" or curl -LsSf https://astral.sh/uv/install.sh | sh) and a machine in Iran (why).
# 1. check that TSETMC and Codal are reachable from here
uvx iran-bourse-mcp doctor
# 2. print the exact steps for your agent, or let the tool edit the config for you
uvx iran-bourse-mcp config cursor
uvx iran-bourse-mcp install cursorThe server entry is always the same: command uvx, args ["iran-bourse-mcp"], stdio transport. One-click install buttons for Cursor, VS Code and Goose are on the website. An AI agent can set it up from docs/llms-install.md.
Claude Code
claude mcp add iran-bourse -- uvx iran-bourse-mcpAdd
--scope userto make it available in every project.
Claude Desktop
Add to the config file (Windows: %APPDATA%/Claude/claude_desktop_config.json; macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Linux: ~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install claude-desktop
Restart Claude Desktop after editing the file.
OpenAI Codex CLI
codex mcp add iran-bourse -- uvx iran-bourse-mcpor in ~/.codex/config.toml:
[mcp_servers.iran-bourse]
command = "uvx"
args = ["iran-bourse-mcp"]
uvx --versionmust work in the shell that starts Codex. For scriptedcodex execruns use the config.toml form (required = true), oruv tool installthe package so the server starts in about a second.
Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install gemini-cli
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install cursor
Restart Cursor after editing. A one-click install link is available (see
config cursor).
VS Code (GitHub Copilot)
Add to .vscode/mcp.json:
{
"servers": {
"iran-bourse": {
"type": "stdio",
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Project-level file. Top-level key is
servers, notmcpServers.
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install windsurf
Newer releases may relocate the file; open it from Cascade's MCP panel if this path is missing.
Cline
Add this entry in the client's MCP settings:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Open the MCP Servers panel, choose Configure MCP Servers, and paste the entry into the JSON it opens.
Roo Code
Add to .roo/mcp.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Project file shown; the global file is opened from the MCP settings view.
Kiro
Add to ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install kiro
Qwen Code
Add to ~/.qwen/settings.json:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Or automatically (makes a backup first): iran-bourse-mcp install qwen-code
JetBrains AI Assistant
Add this entry in the client's MCP settings:
{
"mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Settings > Tools > AI Assistant > Model Context Protocol (MCP) > Add, then paste the JSON.
Zed
Add to ~/.config/zed/settings.json:
{
"context_servers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Older Zed versions expect
commandas an object: {"path": ..., "args": [...]}.
OpenCode
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"iran-bourse": {
"type": "local",
"command": [
"uvx",
"iran-bourse-mcp"
],
"enabled": true
}
}
}OpenCode uses
commandas one array andtype: local.
Goose
uvx iran-bourse-mcpPaste that into goose configure > Add Extension > Command-line Extension, or open the one-click link on the website.
Or run
goose configure> Add Extension > Command-line Extension and enter the command below.
Amp
Add to ~/.config/amp/settings.json:
{
"amp.mcpServers": {
"iran-bourse": {
"command": "uvx",
"args": [
"iran-bourse-mcp"
]
}
}
}Python agent frameworks and plain shell
OpenAI Agents SDK
from agents import Agent
from agents.mcp import MCPServerStdio
async with MCPServerStdio(params={"command": "uvx", "args": ["iran-bourse-mcp"]}) as bourse:
agent = Agent(name="Analyst", instructions="Answer with exchange data.", mcp_servers=[bourse])LangChain
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"iran-bourse": {"transport": "stdio", "command": "uvx", "args": ["iran-bourse-mcp"]}
})
tools = await client.get_tools()Claude Agent SDK
from claude_agent_sdk import ClaudeAgentOptions
options = ClaudeAgentOptions(mcp_servers={"iran-bourse": {"command": "uvx", "args": ["iran-bourse-mcp"]}})No MCP support? Use the shell
# Any agent that can run commands can use every tool:
uvx iran-bourse-mcp tools
uvx iran-bourse-mcp call quote symbol=فولاد --compact
uvx iran-bourse-mcp call top_movers kind=buy_queue limit=5 --compactWhat you can ask
«وضعیت فولاد رو کامل بررسی کن: صف، ورود پول حقیقی، سهامداران عمده و آخرین اطلاعیههای کدال» «امروز کدوم سهمها صف خرید قوی دارن و پول حقیقی وارد شده؟» «ریز معاملات فولاد دیروز رو خلاصه کن و بزرگترین معاملهها رو نشون بده» «صف خرید خودرو از چه ساعتی شکل گرفت و چقدر بزرگ شد؟» «سهامدار عمده شستا چه سهمهای دیگهای داره؟» «سهمهایی رو پیدا کن که امروز حجمشون بیش از دو برابر میانگین ۲۰ روز بوده، دیروز بیش از ۱٪ رشد کرده و امروز هم مثبته» ← اسکرینر «زنجیره اختیار معامله اهرم رو با نزدیکترین سررسید بده» · «تاریخچه شاخص کل از اول مهر» · «افزایش سرمایههای هفته آینده کدوم نمادهاست؟»
The stock screener
screen_stocks is the filter box of tsetmc.com, written by your agent. Describe what you want; the agent writes a short condition and gets back only the stocks that pass it, with the evidence for each hit. It reads today's live values, up to 60 past trading days (adjusted for capital increases), real-vs-legal flow and a five-level order book for every instrument of the exchange's own market watch (about 3,700, including funds, bonds, options and futures).
You: stocks trading over twice their 20-day average volume, up more than 1% yesterday, positive today, over 5 billion rial
Agent: screen_stocks(filter="volume > 2 * avg(volume, 20) and close_pct[1] > 1 and close_pct > 0 and value > 5B")
35 of 625 stocks match, 3.6 s: انتخاب (9.4x volume, +2.97% yesterday, +2.85% today), پکرمان, کرماشا, خراسان ...The language is a safe expression grammar (parsed with ast, never eval), accepts the field names and JavaScript spellings of the exchange's own filter (pl, pc, tvol, tmax, pd1, ct.Buy_I_Volume, ===), ships 15 ready-made presets (volume_surge, smart_money, breakout_20d, buy_queue ...) and reports mistakes with suggestions. Checked against an independent re-implementation straight from raw exchange data: identical results on three different screens. Guide and every field: docs/SCREENER.md.
Coverage
Data | Tools |
Market state, indices, industry indices |
|
Whole-market tables (~3,700 instruments: shares, funds, bonds, options, futures) |
|
Stock screener (filter language, history, presets) |
|
Index history, members and their effect |
|
Options and futures |
|
The exchange's own best-of lists (برترینها) |
|
Corporate-action calendar |
|
Halts and supervision |
|
One-call symbol dossier |
|
Price, limits, VWAP, P/E, market cap |
|
Technical indicators (computed from adjusted daily prices) |
|
Order book and queues (صف خرید/فروش) |
|
Tick-by-tick trades (ریز معاملات) |
|
Real vs legal investors (حقیقی/حقوقی) |
|
Shareholders (سهامداران عمده) |
|
Commodity and energy exchanges |
|
Funds |
|
Fundamentals (read from Codal) |
|
Codal |
|
Supervisor notices |
|
Vocabulary |
|
Also four prompts (analyze_symbol, daily_market_report, smart_money_scan, find_stocks) and a glossary resource. Full parameters: docs/TOOLS.md.
Benchmarks
Measured against the live exchange, not claimed. The raw route is the best case for an agent that already knows the hidden endpoints. Scripts, ground truth and raw results live in benchmarks/ and can be re-run.
Task | Raw route | iran-bourse-mcp | Tokens saved |
Live quote with correct % change | 3 req · 0.4s · 6,225 tok | 1 call · 0.5s · 337 tok | 18x |
Order book with queue detection | 3 req · 0.3s · 6,298 tok | 1 call · 0.6s · 388 tok | 16x |
One day of ticks: VWAP, biggest trades, bars | 3 req · 0.7s · 2,142,302 tok | 1 call · 1.1s · 3,380 tok | 634x |
Real vs legal money flow, 10 days | 12 req · 0.9s · 612,009 tok | 1 call · 1.2s · 1,332 tok | 460x |
Major shareholders | 3 req · 0.4s · 7,018 tok | 1 call · 0.7s · 686 tok | 10x |
Market-wide ranking of buy queues | 222 req · 15.0s · 695,971 tok | 1 call · 9.4s · 1,241 tok | 561x |
Latest 5 Codal filings with links | 1 req · 1.6s · 6,489 tok | 1 call · 1.6s · 1,539 tok | 4x |
One year of daily prices, adjusted | 2 req · 0.4s · 610,549 tok | 1 call · 0.8s · 19,517 tok | 31x |
Screen the market: volume > 2x 20-day average, up yesterday and today | 22 req · 5.8s · 7,437,128 tok | 1 call · 3.9s · 723 tok | 10,286x |
Data-plane benchmark, 2026-11-04 15:51:55 UTC. Tokens are a tiktoken o200k_base proxy; the ratios matter more than the absolute numbers. A single-endpoint task takes about as long either way; the server wins where the raw route needs many sequential requests, and on tokens everywhere.
Traps in the raw data (each found on the live endpoints and handled by the server):
Trap | Naive reading | Correct |
The exchange's own |
|
|
Counting holders / summing percent from the dated shareholder endpoint |
|
|
Reading real-buyer count with the key used by the live endpoint ( |
|
|
Calling every limit-up stock without visible sell orders a buy queue, using the gateway's market watch alone |
|
|
Matching the company name the user types (Persian letters) against the exchange's text (Arabic letters) |
|
|
Agent trials (one LLM agent model, identical in every arm, 2026-11-04; 6 tasks, graded against independent ground truth):
Agent | Accuracy | Net tokens (mean/task) | Time (mean/task) | Tool calls | Answered |
Browser-only agent (page fetch) | 21% | 100,054 | 190s | 9.2 | 4/6 |
Shell agent (curl/python + web, no MCP) | 94% | 17,129 | 83s | 6.8 | 6/6 |
Agent + iran-bourse-mcp | 100% | 11,512 | 36s | 3.0 | 6/6 |
Six tasks, one model, runs per task: 1 (2 for T2 and T6 in the shell and MCP arms). The shell agent used its own knowledge of the exchange's endpoints. On T4 it classified a fixed-price symbol (فولاد3) as an ordinary share, a different but defensible reading of 'ordinary shares'; queue sizes also drift by tens of percent within minutes after the close, so T4 is graded on the ranking only.
Verified, not assumed
Ticks are complete. For فولاد the 6,819 ticks of 3 Nov and the 15,643 ticks of 2 Nov matched the exchange's own daily totals at 100.0% of volume and trade count.
trade_summaryreports this coverage on every call so you do not have to trust us. (A community reference claimed a 36-38% shortfall; we could not reproduce that.)Price limits and queues come from the day's actual allowed price range, not a guess, and queue rankings are confirmed against the real order book.
Derived numbers are labelled. Anything the exchange does not publish (tick-rule pressure, adjusted prices, same-day value of real money flow) sits under an
estimate/estimatedkey.Tested. Offline tests on recorded real fixtures (CI: Python 3.10 to 3.13 on both MCP SDK generations), a live smoke test of every tool (
scripts/smoke_live.py) and an end-to-end stdio test (scripts/e2e_stdio.py).
Architecture
Pure transformation logic (shape.py) is separated from I/O so every number can be tested offline. Details: docs/ARCHITECTURE.md (فارسی).
The Iranian IP requirement
TSETMC and Codal are built for Iranian users. Their servers often reject foreign or VPN addresses. So:
Run the server on a machine in Iran, not behind a foreign VPN, or
point it at an in-Iran proxy:
IRAN_BOURSE_PROXY=http://host:port, orrun it on an Iranian server and connect remotely over HTTP (use an SSH tunnel or a reverse proxy with authentication; the server has no auth of its own):
iran-bourse-mcp serve --transport streamable-http --host 127.0.0.1 --port 8000iran-bourse-mcp doctor tells you which sources are reachable. A Dockerfile is included (docker build -t iran-bourse-mcp . && docker run -i --rm iran-bourse-mcp); images are pushed to ghcr.io on tagged releases.
Configuration
Variable | Purpose | Default |
| HTTP(S) proxy for all requests | none (system proxy variables are honoured) |
| Request timeout, seconds |
|
| Package source used in generated install snippets ( | the GitHub repository |
| Override the TSETMC API base |
|
| Override the TSE gateway base |
|
| Override the Codal search API |
|
Good to know
Prices and values are in Rial (1 Toman = 10 Rial). Dates accept Gregorian (
2026-11-03) or Jalali (1405/08/12, Persian digits fine).Persian/Arabic letter variants are interchangeable on input (
کگل=كگل) and normalised on output.The market trades Saturday-Wednesday 09:00-12:30 Tehran time, except on official public holidays.
market_statusknows the 1405 holiday calendar (holiday,next_session,upcoming_holidays); for years not yet in the table only the fixed Solar Hijri holidays are known. The exchange also closes on some days without a holiday;market_statusflags it when the exchange's own data disagrees with the calendar. Outside the session you get the last session's data.Order-book history for the current trading day may be partial. TSETMC publishes the full intraday book history only after the day ends.
order_book_historytells you when it is cut short (events_span,warning). Useorder_bookfor the live book.The unofficial endpoints can change without notice. Every quirk we found is in docs/DATA_SOURCES.md (فارسی).
Requests are cached briefly (seconds for live data, hours for history) and limited to 6 in flight. Please be gentle: this is somebody else's server.
Troubleshooting
Symptom | Fix |
| GUI clients (Claude Desktop, Cursor) may not see your shell |
First start takes ~10 seconds |
|
| The Iranian IP requirement above. Run |
"The exchange server answered HTTP 502/503" | TSETMC is overloaded. The server already retried; try again in a few seconds. |
Empty or old live data | The market is closed (Saturday-Wednesday 09:00-12:30 Tehran time); you get the last session. |
Persian text looks reversed in a terminal | Terminal bidi rendering, not a data problem. The JSON is correct. |
Safety
All tools are read-only (readOnlyHint). There is deliberately no order placement, no login and no credential handling.
Development
uv sync
uv run pytest # offline, a few seconds
uv run ruff check .
uv run python scripts/smoke_live.py # needs access to TSETMC
uv run python scripts/e2e_stdio.py # real MCP handshake against live data
uv run python benchmarks/data_plane.py # re-measure tokens, requests, timeSee CONTRIBUTING.md, AGENTS.md and docs/ARCHITECTURE.md.
Roadmap
Holiday table for Jalali year 1406 (once the official calendar is final)
Published PyPI release (
uvx iran-bourse-mcp)
Citing
See CITATION.cff. Licensed under MIT. Market data belongs to its respective owners; check the exchange's terms before redistributing it.
Available Tools
45 toolscapital_calendarARead-onlyIdempotent
Market-wide corporate-action calendar (افزایش سرمایه و تعدیل قیمت), sorted by date: capital increases with the old and new share count, added shares and increase %, and price adjustments (reference-price cuts around dividends and rights) with the adjustment factor, for the days after today, the days up to today, or both. Forward visibility is short: the exchange lists a share-count change only a few days before it takes effect, and price adjustments only after the fact. Not in this feed: dividend per share, ex-dividend and AGM dates, rights exercise price; they are in Codal letters (use codal_filings).
Inputs: days, flow, kind, limit, +1 more.
codal_companyBRead-onlyIdempotent
Issuer profile from Codal: CEO, ISIC, address, activity description (اطلاعات ناشر).
Inputs: symbol (required).
codal_filingsBRead-onlyIdempotent
Search Codal disclosures (کدال): title, publish time, tracing number and links to the page, PDF, Excel and attachments.
Inputs: page, limit, symbol, to_date, +4 more.
codal_letterARead-onlyIdempotent
Read the CONTENT of any Codal letter (متن و جدولهای اطلاعیه کدال): financial statements, monthly activity reports, meeting decisions (DPS, capital increases), explanations and notices. Structured reports come back as tables (columns from the report's own headers, numbers parsed, usually million rial: see unit_note), one sheet per call, with the other sheets listed in 'sheets'; a statement sheet also gets 'key_items' (revenue, profits, EPS, assets, equity, cash flows...) and a monthly report a 'monthly_summary' (month and year-to-date sales, by product). Plain letters come back as text. For the usual questions prefer financial_statements, monthly_activity or fundamentals, which find and read the right letters for you.
Inputs: tracing_no (required), sheet.
commodity_marketARead-onlyIdempotent
Iran Mercantile Exchange physical market (بورس کالای ایران: steel, copper, aluminium, zinc, cement, petrochemicals, oil products, bitumen, agricultural goods), straight from ime.co.ir. view='trades' lists a session's offers and contracts: product, producer, hall (تالار), contract type (cash نقدی, forward سلف, credit نسیه; matching مچینگ), delivery date, offered / demand / traded tons, weighted-average closing price with low, high and base price in RIAL PER KILOGRAM, and value in RIAL, with totals by hall and contract type and the top products by value. view='summary' gives IME's roll-ups: value and traded / offered tons per ring, traded value per market (physical, futures, options, financial, certificates), one row per session and IME's dollar rate. Units are in the key names (volume_tons, price_rial_per_kg, value_rial). Without a date the latest session is used; IME trades Saturday to Wednesday, so Thursday and Friday are empty. The trades list leaves out the sub-market and is smaller than the summary: never add them. The exchange-traded boards (gold and saffron certificates, standard forwards, commodity funds, futures) are in top_lists (commodity group) and market_watch (security_type='commodity').
Inputs: date, view, group, limit, +4 more.
corporate_actionsARead-onlyIdempotent
Capital increases and price adjustments (افزایش سرمایه، تعدیل قیمت) with dates and factors.
Inputs: symbol (required).
energy_marketARead-onlyIdempotent
Iran Energy Exchange (بورس انرژی ایران, IRENEX): physical auctions (liquefied gas, solvents, CSO, hexane, liquid nitrogen and other oil, gas and petrochemical products; domestic and international rings) and the electricity market (standard, free and green power contracts), from the exchange's own site (iee.ir). view='trades' gives each auction's result: product, supplier, ring and destination, contract type, offered / demand / traded volume, base and average price and the exchange's value in RIAL; view='offers' the announced auctions; view='auction' one auction's terms, price units, buy and sell order levels and trades; view='overview' whether the market is open and today's traded value. Units differ by product and are spelled out per row: tonne auctions in rial are priced per KILOGRAM, dollar auctions per TONNE, premium auctions as a premium on a reference price, electricity in kW of capacity over the delivery period with kwh the energy and the price per kWh (see price_basis and totals.volume_by_unit; volumes of different units are never added). Without a date the latest session is used; the exchange trades Saturday to Wednesday. The traded boards (electricity forwards and base-load contracts, capacity and energy-saving certificates, energy futures) are in top_lists (energy group).
Inputs: date, view, limit, market, +5 more.
financial_statementsARead-onlyIdempotent
A company's financial statements from Codal (صورتهای مالی): income statement, balance sheet and cash flow, each as key items for this period, the same period last year and the last full year (revenue, cost of revenue, gross/operating/net profit, EPS, total assets, equity, debt, cash, operating cash flow, capex, dividends paid...), plus margins, growth, ROE/ROA on trailing twelve months, current ratio and leverage. Banks (loans, customer deposits, loan interest, fee income, loans-to-deposits) and insurers (premiums, claims, technical reserves, loss ratio) are read in their own templates. Amendments and audited re-issues replace earlier versions. Amounts in million rial, EPS in rial. For the full tables of a letter use codal_letter.
Inputs: symbol (required), period, history, consolidated.
fundamentalsARead-onlyIdempotent
One-call fundamental picture of a company (تحلیل بنیادی): price and market cap, the exchange's EPS and P/E, the latest Codal statements (revenue, net profit, EPS, equity), margins, growth, ROE/ROA, liquidity and leverage, valuation computed on trailing twelve months (EPS, P/E, P/S, P/B, marked estimated), and the last three months of sales from the monthly reports.
Inputs: symbol (required).
fund_rankingARead-onlyIdempotent
Ranking and screening of the investment-fund registry (صندوقهای سرمایهگذاری): about 580 funds of 15 types, not only the exchange-traded ones, with net assets, units, redemption/issue/statistical NAV (ابطال، صدور، آماری), returns over 1 day to 1 year and since inception, portfolio mix (stock/bond/deposit), manager and NAV date. Sort by any return or size, filter by type and minimum net assets. Returns are percent as published, null where the fund is too young. The registry has no ticker: find the traded unit with search_symbol on the fund's name, then etf_nav for its NAV premium. Market-maker and very young funds show extreme returns, so filter them for a fair ranking.
Inputs: limit, detail, sort_by, fund_type, +2 more.
futures_marketBRead-onlyIdempotent
Futures (آتی) of the Tehran derivatives market (about 16 contracts): last and close price, bid/ask, volume, value, open interest, expiry and days left, plus the basis against the underlying - absolute, percent and an annualised estimate (formula in the notes). Contracts that did not trade today show no price and no basis.
Inputs: limit, sort_by, descending, underlying.
glossaryBRead-onlyIdempotent
Explain Iranian market terms (صف خرید، سرانه خرید، حقیقی/حقوقی، دامنه نوسان …) so answers use them correctly.
Inputs: term.
index_constituentsARead-onlyIdempotent
Member stocks of an index (سهام شاخص) with close, change %, volume, value and each stock's effect in index points on the total index (تاثیر در شاخص, from the exchange), plus totals: members, advancers/decliners, traded value, sum of effects. The exchange publishes no index weights, so market-cap share is only a derived proxy (sort_by market_cap). Effects are for the latest session and are left out, with a note, when the exchange's table does not add up to the index move; for a sector index they are the effect on the total index, not on the sector index.
Inputs: index (required), limit, sort_by, descending.
index_contributorsBRead-onlyIdempotent
Stocks pushing the total index up or down the most, in index points (بیشترین تاثیر بر شاخص).
Inputs: limit.
index_historyARead-onlyIdempotent
History of any index (تاریخچه شاخص) in index points, not rial: the total index (شاخص کل) back to 2008, equal-weight, free-float, any industry index such as فلزات or بانک, and the Fara Bourse indices. Rows ascending with close, low, high and daily change %, plus a summary of the whole requested range: change %, highest and lowest close with dates, maximum drawdown, up/down days and a volatility estimate. Days the market was closed are flagged flat and kept out of the statistics. With intraday=true: today's 5-minute path with day high/low and the previous close.
Inputs: index (required), limit, to_date, intraday, +2 more.
indicesBRead-onlyIdempotent
All indices: total, equal-weight, free-float and every industry index with change % (شاخصها و شاخص صنایع).
Inputs: market, only_headline.
industry_summaryBRead-onlyIdempotent
Per-industry breakdown: traded value, average and cap-weighted change, index effect, queue counts (گروههای صنعتی).
Inputs: limit, market.
market_holder_movesARead-onlyIdempotent
Large holders whose positions changed most over the last 5 reported days, market-wide (تغییرات سهامداران عمده).
Inputs: limit.
market_overviewCRead-onlyIdempotent
Index value, equal-weight index, total value/volume/trades and market cap for the market (نمای کلی بازار).
Inputs: market.
market_snapshotBRead-onlyIdempotent
End-of-day table for every instrument on a past date; ordinary stocks unless security_type says otherwise (تاریخچه کل بازار در یک روز).
Inputs: date (required), limit, sort_by, security_type.
market_statusARead-onlyIdempotent
Is the Tehran market open right now, and when does it open next? Tehran time, today's status (open, before_open, after_close, weekend or holiday), the public holiday if any, next_session (skipping weekends and holidays), the next upcoming_holidays, the bourse state and totals (وضعیت بازار). Holidays come from the official calendar of 1405; days the exchange closes without notice are flagged in calendar_check when its own data disagrees.
Inputs: no named parameters.
market_watchARead-onlyIdempotent
Whole-market table (دیدهبان بازار) of the exchange's own feed: about 3,700 instruments (shares, base market, funds, bonds, options, futures, rights, commodities) on Bourse and Fara Bourse, filtered, sorted and paged in one call. To find instruments by conditions use screen_stocks.
Inputs: board, limit, detail, market, +6 more.
monthly_activityARead-onlyIdempotent
A company's monthly activity reports from Codal (گزارش فعالیت ماهانه، ن-۳۰): sales of each month and year to date, growth on the same span last year, month-on-month change, and for the newest month each product's production, sales quantity, rate and amount (domestic, export and services). Banks give operating income, loans and deposits at the month end and net interest; insurers premiums and claims; investment companies operating income and their portfolio. Amended reports replace the originals. Amounts in million rial.
Inputs: symbol (required), months, products.
option_chainARead-onlyIdempotent
Option chain (اختیار معامله) of the Tehran derivatives market: for an underlying ('اهرم', 'شستا', 'وبملت' ...) and expiry, every strike with its call (خرید) and put (فروش) leg - last/close price, bid/ask, volume, value, open interest, change % - plus derived (computed, not published) moneyness ITM/OTM, intrinsic and time value, break-even, bid-ask spread, put/call ratios, top open-interest strikes and an estimated max pain, and on every call the covered-call figures (net cost, return if called or unchanged, annualized, downside protection). For «کاورد کال برج ۹» pass expiry=9. Omit underlying to list the underlyings that have options. Prices are rial per underlying unit, one contract = contract_size units; legs with no trade today show no price; open interest is the clearing house's daily figure.
Inputs: limit, expiry, market, sort_by, +6 more.
order_bookARead-onlyIdempotent
Five-level order book (عمق بازار) with order counts, imbalance and buy/sell queue (صف) detection.
Inputs: symbol (required).
order_book_historyARead-onlyIdempotent
Intraday order-book evolution rebuilt from every event: sampled depth plus buy/sell queue episodes with peak sizes (تاریخچه صف خرید و فروش).
Inputs: symbol (required), date, to_time, from_time, +1 more.
price_historyARead-onlyIdempotent
OHLCV price history since listing (تاریخچه قیمت), daily or aggregated to weekly/monthly/yearly bars, optionally back-adjusted for capital increases and dividends. For long ranges prefer granularity='monthly' or 'yearly' over thousands of daily rows.
Inputs: symbol (required), limit, to_date, adjusted, +2 more.
quoteARead-onlyIdempotent
Live/last quote with correct change %, volume, value, VWAP, price limits, ranges, P/E and market cap (قیمت لحظهای).
Inputs: symbol (required).
real_legal_flowBRead-onlyIdempotent
Real vs legal buying/selling (حقیقی و حقوقی): counts, per-capita, buyer power, net money flow, with daily history.
Inputs: symbol (required), days.
screener_referenceARead-onlyIdempotent
Fields, functions, ready-made presets and examples for screen_stocks filters. Call it when a filter is rejected or you need a field name.
Inputs: topic.
screen_stocksARead-onlyIdempotent
Stock screener (فیلتر نویسی): the filter box of tsetmc.com driven by an expression. Returns only the stocks that pass your condition right now, using today's live values plus up to 60 past trading days (close[1], avg(volume, 20), count(close_pct > 0, 3)) and real/legal money flow, in one call with a validated, safe expression (nothing is executed).
Inputs: sort, limit, filter, market, +7 more.
search_symbolARead-onlyIdempotent
Find instruments by symbol or name fragment; returns symbol, name, market, board, insCode (جستجوی نماد).
Inputs: query (required), limit.
supervisor_messagesBRead-onlyIdempotent
Exchange supervisor notices (پیام ناظر): trading restrictions, clarifications, halts.
Inputs: limit, market, symbol, full_text.
symbol_overviewARead-onlyIdempotent
One-call dossier for a symbol: identity, quote, order book, real/legal flow, top shareholders, latest Codal filings and supervisor notices. Start here.
Inputs: symbol (required).
symbol_statisticsARead-onlyIdempotent
Exchange-computed averages and stats for the symbol (e.g. average traded value over 3 months).
Inputs: symbol (required).
technical_indicatorsARead-onlyIdempotent
Technical analysis indicators of one symbol (اندیکاتورهای تکنیکال) from its daily prices: SMA 20/50/200, EMA 12/26, RSI 14 (Wilder), MACD 12/26/9 with signal and histogram, Bollinger 20/2 with %B and bandwidth, ATR 14, stochastic 14/3, OBV trend, volume vs its 20-session average, distance from the 52-week high and low, support and resistance from recent swing lows and highs, recent crosses (MACD/signal, SMA50/SMA200) and a plain-language summary ("RSI 72: overbought", "price above SMA50 and SMA200"). Computed by this server from the exchange's adjusted daily closing prices, not published by the exchange.
Inputs: symbol (required), days, adjusted.
top_listsARead-onlyIdempotent
The exchange's own best-of tables («برترینها» of tsetmc.com): most trades, biggest traded value or volume, price gainers and losers, last price above or below the close, block trades (معاملات عمده), closing-price-only TAL trades, rights (حق تقدم), ETFs, options and futures by volume or open interest, debt papers, energy and commodity markets, the largest buy and sell queues (برترین تقاضا و عرضه), market-value gainers and losers and industries by traded value, for the Bourse, the Fara Bourse and their sub-markets. Rows keep the exchange's own ranking with stable keys (symbol, close, close_pct, last, trades, volume, value ...; rial). Call it first with list_name='catalogue' to see all lists and the flows each one supports.
Inputs: flow, limit, list_name.
top_moversARead-onlyIdempotent
Ranked lists of the live session: top gainers/losers, most traded, buy/sell queues (صف خرید/فروش, confirmed against each symbol's real order
book; about 10 s on a strong day), real-person money inflow/outflow (ورود/خروج پول حقیقی), buyer power.
With date (queues only): the queues at the close of a past session, found from that day's end-of-day table and confirmed against each candidate's
order-book history, with queue size at the close and since when it held (can take 20-40 s on a strong day; repeated calls are fast).
Before 09:00 Tehran time the live lists are empty because the exchange resets the day's data: read note, and pass date= for queues.
Inputs: date, kind, limit, market, +1 more.
tradesARead-onlyIdempotent
Raw tick-by-tick trades (ریز معاملات) with time, price, volume, value. Filter by time and size; prefer trade_summary for analysis.
Inputs: symbol (required), date, limit, to_time, +3 more.
trade_summaryARead-onlyIdempotent
Aggregate a day's ticks: intraday bars, VWAP, biggest trades, volume by price level, tick-rule pressure estimate, and a completeness check against official totals.
Inputs: symbol (required), date, to_time, from_time, +1 more.
trading_statusARead-onlyIdempotent
Which symbols are halted or flagged. 'suspended' lists symbols whose trading is suspended (تعلیق شده) with the exchange's reasons; 'supervision' lists symbols that still trade but are in the suspension process (مشمول فرآیند تعلیق) or under caution (معامله تحت احتیاط); 'state_changes' is the market-wide log of order-entry states (مجاز, ممنوع, محفوظ, متوقف), decoded into what each means; 'symbol_history' gives one symbol's state history with its current supervision status and since when. Reasons are plain Persian lines.
Inputs: kind, limit, market, symbol.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 45 tools
The set has many adjacent views: market_watch vs market_snapshot vs screen_stocks vs top_lists, quote vs symbol_overview vs fundamentals, and codal_letter vs financial_statements/monthly_activity. Descriptions often explicitly steer selection, which keeps ambiguity manageable, but an agent still faces several plausible entry points for common questions.
All names use snake_case and cluster into coherent prefixes such as market_, index_, shareholder_, and codal_, making them readable and predictable. The convention is mostly noun-phrase/resource-based with a few verb-led exceptions like search_symbol and screen_stocks, so it is not perfectly uniform.
45 tools is far above the comfortable 3-15 range and creates a large selection surface, even though the domain genuinely spans equities, derivatives, Codal, commodity, energy, and funds. Several tools could be combined or tiered behind higher-level entry points.
Coverage is unusually broad: market status, indices, quotes, order books, trades, fundamentals, Codal, options, futures, commodity, energy, screening, shareholders, and corporate actions. Minor gaps such as DPS/ex-dividend dates are explicitly routed to Codal, so agents have workarounds rather than dead ends.
Maintenance
Related MCP Connectors
Licensed Borsa Istanbul (BIST) data for AI assistants: live or 15-minute delayed prices, OHLCV bars from 1 minute to monthly, financial statements, ratios, KAP disclosures, indices and sectors, indicator backtests and portfolio tracking for 600+ Turkish stocks. OAuth sign-in with an istfin subscription. Never places orders.
Global prices, fundamentals and holdings data for stocks, ETFs and funds, built for AI agents.
Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.
Live crypto + IDX stock market intelligence for AI agents — 19 tools, no API key.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to read Tehran Stock Exchange and Iran Fara Bourse market data—quotes, top movers, order books, price history, sector indices, and real vs legal trading—through read-only tools. Requires no API key, returning compact JSON in Rial directly to Claude, Cursor, or Copilot.8348 PyPI10PolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceEnables AI agents to search and read Iranian listed companies’ Codal disclosures, including financial statements, EPS and monthly activity reports as tables, meeting decisions, and PDF/Excel links, plus company and fiscal-year lookups.5383 PyPI11PolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceEnables AI agents to search, rank, and compare Iranian mutual funds and ETFs; inspect NAV, returns, size, flows, investors, and managers; and retrieve Tehran and Farabourse market overviews, indices, stock quotes, and industry data read-only without an API key.11181 PyPIPolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceGives AI agents read-only access to the public trade and supply data of the Iran Mercantile Exchange, covering commodity trades, upcoming supply offers, daily price series, market totals, options, certificates, rankings, news and weekly reports. Requires no API key or account, and works in Claude, Cursor, Copilot and any other MCP client.14280 PyPIPolyForm Noncommercial 1.0.0