Skip to main content
Glama
iran-brokers-mcp

iran-brokers-mcp

by sepehr071

iran-brokers-mcp: Iranian broker (کارگزاری بورس) market data MCP server for AI agents

iran-brokers-mcp is an unofficial, read-only MCP server that lets an AI agent read Tehran Stock Exchange market data through two Iranian brokers, Mofid Securities (کارگزاری مفید, emofid.com) and Agah (کارگزاری آگاه, agah.com). Its 22 tools cover stocks, ETFs and funds (صندوق سرمایه‌گذاری), options (آپشن), bonds and sukuk (اوراق), gold coins (سکه) and currency, screeners, Codal announcements and education articles, on Tehran Stock Exchange (بورس تهران) and Fara Bourse (فرابورس). No API key or broker account is needed, and it works in Claude, Cursor, Copilot and any other MCP client.

PyPI Python CI MCP Registry License: PolyForm Noncommercial

Install in VS Code Install in Cursor

For AI agents · What it can do · Quick start · Tools · Limits · FAQ · فارسی


Last verified 2026-11-01 against the live Mofid and Agah APIs.

For AI agents

  • What: unofficial MCP server (model context protocol) for Mofid and Agah: symbol search, stock cards, OHLC candles and daily history, market snapshot, 36 Mofid rankings, Agah market watch and screener, ETFs with price vs NAV, fund detail/history/comparison, options chain and contract, bonds and T-bills, currency/coin/gold/commodity prices and history, Codal filings, valuation scores, technical tally, education articles and courses.

  • Install: uvx iran-brokers-mcp or claude mcp add iran-brokers -- uvx iran-brokers-mcp. Transport: stdio. Needs uv (Python 3.10+).

  • Auth: none. Optional IRAN_BROKERS_MCP_PROXY (one HTTP proxy URL for every request, or a comma-separated list); system proxy settings are ignored.

  • Access: read-only market data. It cannot log in, read a portfolio, cash or orders, place, edit or cancel orders, or pay. No confirmation is needed before calling any tool.

  • Tools: 22, all prefixed br_. Typical sequences: br_search -> br_stock / br_history; br_market -> br_market_top or br_stocks; br_etfs -> br_stock or br_fund; br_screener; br_rates; br_announcements; br_learn -> br_learn(ref=...).

  • source argument: each source answers in its own block ({"mofid": ..., "agah": ...}). With all, a source that fails shows {"error": ...} and the other still answers. Blocks are never blended into one row, because the fields differ.

  • Use when: the user asks for a stock, fund, option, index, gold or dollar price on the Iranian market, a ranking or screen, a chart, a company's Codal filings, or how something in the bourse works.

  • Do not use when: the user wants to trade, see their own portfolio, or needs real-time tick data (everything here is a polled snapshot). For raw exchange data use tsetmc-mcp; for full financial statements use codal-mcp.

  • Output: compact JSON. Prices are Rial (divide by 10 for Toman). Text Persian.

  • Machine-readable: server.json and the iran-mcp catalog.

Related MCP server: codal-mcp

What it can do

  • Get Tehran Stock Exchange data in Claude: find a symbol, read its price card (P/E, EPS, NAV, buyer and seller flows, order book), candles from 1 minute to weekly, and the market snapshot with indices and movers

  • Compare Iranian ETFs from an AI agent: list ETFs with price, NAV and the bubble gap (Mofid 375 ETFs, Agah 331 listed ETFs), then read one fund's detail, NAV history or compare several

  • Read the options chain (call and put contracts) and one contract's detail

  • Screen stocks, ETFs or funds on any column with the Agah screener, or use Mofid's 36 rankings (top gainers, value, queues and more)

  • Bonds, sukuk and T-bills with yield, plus currency, crypto, coin (سکه), gold and commodity prices with history

  • Codal announcements by company, type and date, plus notices, news and research PDFs

  • Valuation and technical scores: theoretical price, fundamental and technical scores, indicator tally per stock or industry

  • Education: Mofid blog, Agah Pedia articles and Agah Academy courses

  • Read-only by design: no login, no orders, no captcha solving

Example prompts:

  • "Get today's Tehran Stock Exchange summary: indices, top movers and the dollar and coin prices."

  • "Compare Iranian ETFs by price versus NAV and show which trade at the biggest premium."

  • "Show the options chain for Foolad and the details of one call contract."

  • "Which stocks have the lowest P/E and a positive money flow this week?"

  • قیمت و نسبت قیمت به NAV صندوق‌های طلا را مقایسه کن.

  • بیشترین صف خرید امروز بورس کدام نمادهاست؟

  • آخرین اطلاعیه‌های کدال نماد فولاد را بیاور.

Quick start

You need uv. No API key or account.

claude mcp add iran-brokers -- uvx iran-brokers-mcp

Settings → Developer → Edit Config, then add:

{
  "mcpServers": {
    "iran-brokers": { "command": "uvx", "args": ["iran-brokers-mcp"] }
  }
}

Click Install in Cursor above, or add the Claude Desktop block to ~/.cursor/mcp.json (or .cursor/mcp.json in a project).

Click Install in VS Code above, or add to .vscode/mcp.json:

{
  "servers": {
    "iran-brokers": { "type": "stdio", "command": "uvx", "args": ["iran-brokers-mcp"] }
  }
}

It is a standard stdio MCP server: run uvx iran-brokers-mcp, or pip install iran-brokers-mcp and run iran-brokers-mcp.

Tools

Merged tools take source: mofid, agah or all (the default is in brackets). Single-source tools say which broker they use.

Tool

Source

What it does

br_search

both [all]

Find the id of a stock, fund, option or index by symbol or name

br_stock

both [all]

One stock or ETF in detail: Mofid price card (P/E, EPS, NAV, flows, scores, optional 5-level order book) and Agah card (ratios, returns, flows, order book)

br_history

both [mofid]

Mofid OHLC candles (1 minute to weekly, any ISIN) or Agah daily rows with buyer/seller flows

br_market

both [all]

Today's indices, value, queues (Mofid) and total index, money flow, movers, dollar/coin/gold/oil prices (Agah)

br_industries

both [all]

Industry ranking with valuation ratios, returns and money flow; one industry with its stocks

br_index

both [all]

Index card (Mofid) and daily index history (both)

br_etfs

both [mofid]

ETFs with price, NAV and gap/bubble: Mofid 375 ETFs, Agah 331 listed ETFs with NAV returns

br_learn

both [all]

Search and read Mofid blog and Agah Pedia articles, list categories, search Agah Academy courses

br_quotes

Mofid

Up to 30 live quotes in one call

br_market_top

Mofid

36 market rankings

br_bonds

Mofid

Bonds, sukuk and T-bills with yield

br_rates

Mofid

Currency, crypto, coin, gold and commodity prices and their history

br_news

Mofid

Notices, Codal letters, Telegram posts and research PDFs

br_announcements

Mofid

Codal filings by company, type and date

br_scores

Mofid

Theoretical price, technical and fundamental scores

br_mofid_funds

Mofid

Mofid-branded fund catalogue

br_stocks

Agah

Market watch of about 750 stocks

br_screener

Agah

Filter stocks, ETFs or all funds on any column

br_fund

Agah

Fund detail, NAV and bubble history, comparison of funds

br_options

Agah

Options chain, or one contract

br_technical

Agah

Technical indicator tally for a stock or industry

br_stock_events

Agah

Dividends, capital changes, notices and holders

Every tool is read-only. If you used the separate mofid-mcp or agah-mcp servers: mf_search and ag_search -> br_search; mf_symbol, mf_depth, ag_stock -> br_stock; mf_history, ag_stock_history -> br_history; mf_market_summary, ag_market_pulse, ag_market_overview -> br_market; mf_industries, ag_industries -> br_industries; mf_index, ag_index_history -> br_index; mf_etfs -> br_etfs; mf_learn, mf_learn_categories, ag_articles, ag_article, ag_academy -> br_learn; mf_fx_gold, mf_rate_history -> br_rates; ag_fund, ag_fund_trend, ag_fund_compare -> br_fund; ag_options, ag_option -> br_options; the others keep their name with the br_ prefix (mf_quote -> br_quotes).

Limits

  • No portfolio, orders or cash. Those need a broker login (EasyTrader, AsaTrader); nothing here logs in or can place an order, and this is not built.

  • Agah Pedia and Academy answer only from an Iranian network (pediaapi.agah.com, academyapi.agah.com time out from abroad). The error says so; the Mofid side of br_learn still answers. Do not put a foreign proxy in front of them.

  • Mofid depends on the accept-info header of the Bourse View gateway (derived from the server clock; the client resyncs on a 401). If the site changes that check, Mofid tools fail with an HTTP 401 error and the Agah side keeps working.

  • Data is polled snapshots, cached 30 to 60 seconds, delayed or unaudited; the market trades Saturday to Wednesday about 09:00-12:30 Tehran time.

  • The two sources use different ids for funds (Mofid ISIN, Agah national code like 14010557380_A01) and different fields, so merged tools show them side by side.

  • Prices are Rial; divide by 10 for Toman. Dates follow each site.

FAQ

Add iran-brokers-mcp with claude mcp add iran-brokers -- uvx iran-brokers-mcp, then ask in plain language. The agent finds the symbol with br_search, reads it with br_stock or br_history, and gets the market overview from br_market.

Use br_etfs for the list with price, NAV and gap (bubble), br_fund for one fund's detail, NAV history or a side-by-side comparison, and br_screener to filter funds on any column.

Neither broker documents a public API. This server calls the same public JSON the websites use, without login, and returns compact JSON.

No. It is read-only and has no login. Portfolio, cash and orders need your broker account and are not built.

Yes for Mofid and Agah Research. Agah Pedia and Academy answer only from an Iranian network. Set IRAN_BROKERS_MCP_PROXY to route through a proxy; do not use a foreign one for Pedia and Academy.

It calls the public endpoints the websites use, two requests at a time per broker and with caching.

tsetmc-mcp and codal-mcp read the exchange and Codal directly; this server reads the brokers' own views of the same market (rankings, screeners, NAV gaps, options, education).

No to both. Data is polled snapshots cached for 30 to 60 seconds. Nothing it returns is financial advice.

Configuration

Variable

Default

Meaning

IRAN_BROKERS_MCP_PROXY

unset

Optional HTTP proxy URL for all Mofid and Agah requests; system proxy settings are ignored. A comma-separated list is used one at a time: the next proxy takes over when one is blocked or cannot connect

فارسی: سرور MCP کارگزاری‌های مفید و آگاه برای دستیار هوش مصنوعی

پروژه iran-brokers-mcp یک سرور MCP غیررسمی و فقط‌خواندنی است که داده‌های عمومی بازار سرمایه را از دو کارگزاری، کارگزاری مفید (emofid.com) و کارگزاری آگاه (agah.com)، در اختیار دستیار هوش مصنوعی (Claude، Cursor، Copilot و ...) می‌گذارد.

چه کارهایی می‌کند

  • سهام بورس تهران و فرابورس: جستجوی نماد، کارت قیمت، کندل، تاریخچه روزانه، خلاصه بازار و شاخص‌ها.

  • صندوق‌های سرمایه‌گذاری و ETF: قیمت، NAV، حباب، تاریخچه و مقایسه صندوق‌ها.

  • اوراق و آپشن: اوراق بدهی، صکوک، اوراق خزانه با بازده؛ زنجیره آپشن و جزئیات هر قرارداد.

  • سکه، طلا و ارز: قیمت و تاریخچه.

  • غربالگر و رتبه‌بندی: ۳۶ رتبه‌بندی مفید و غربالگر آگاه روی هر ستون.

  • اطلاعیه‌های کدال، خبر و آموزش: مقاله‌ها و دوره‌های مفید و آگاه.

نکته‌ها

  • فقط‌خواندنی است: ورود به حساب، سبد دارایی، موجودی و ثبت سفارش ندارد.

  • پدیا و آکادمی آگاه فقط از اینترنت ایران جواب می‌دهد.

  • داده‌ها لحظه‌ای نیست و هر ۳۰ تا ۶۰ ثانیه تازه می‌شود. مبلغ‌ها ریال است. توصیه سرمایه‌گذاری نیست.

  • کلید API لازم نیست و سرور روی سیستم خود شما اجرا می‌شود.

نصب (اول uv را نصب کنید). در Claude Code:

claude mcp add iran-brokers -- uvx iran-brokers-mcp

Development

git clone https://github.com/sepehr071/iran-brokers-mcp && cd iran-brokers-mcp
uv sync
uv run ruff check . && uv run ruff format --check .
uv run python -m pytest -q          # offline unit tests on recorded responses
uv run python -m pytest -m live -q  # live pass against Mofid and Agah
uv build

Releases: bump the version in pyproject.toml and server.json, then push a v* tag. GitHub Actions publishes to PyPI. Issues and PRs are welcome.

  • tsetmc-mcp for Tehran Stock Exchange prices, order book, real vs legal trading and indices

  • codal-mcp for Codal disclosures and financial statements

  • iran-gold-mcp for live 18k gold prices on Iranian platforms

  • iran-mcp: catalog of all Iranian-service MCP servers

Disclaimer

Unofficial and not affiliated with or endorsed by Mofid Securities or Agah. It is read-only and uses the public endpoints of their websites, which can change without notice. Data is informational, delayed and unaudited. Nothing here is investment advice.

Author

Built and maintained by Sepehr Radmard (سپهر رادمرد). Connect on LinkedIn or follow @sepehr071 on GitHub for more MCP servers for Iranian websites, all listed in iran-mcp. If this saves you time, a star on the repo helps other people find it.

مجوز استفاده (License)

استفادهٔ شخصی و غیرتجاری رایگان است. استفاده در شرکت، محصول پولی یا پروژهٔ مشتری به مجوز تجاری نیاز دارد؛ از راه لینکدین یا گیت‌هاب با سپهر رادمرد تماس بگیرید. متن کامل: PolyForm Noncommercial 1.0.0. نسخه‌های پیش از 0.2.1 با مجوز MIT منتشر شده‌اند و همان مجوز را دارند.

Free for personal and non-commercial use under the PolyForm Noncommercial License 1.0.0. Using it in a company, a paid product or a client project needs a commercial license: contact Sepehr Radmard on LinkedIn or GitHub. Versions before 0.2.1 were released under MIT and stay under it.

Available Tools

22 tools
br_announcementsCodal announcementsA
Read-onlyIdempotent

Search Codal filings (financial statements, board notices, AGM invitations, monthly activity) by company, report type and date.

Source: Mofid only. Rows have title, publish time, company, period and links to the Codal page, PDF and attachments.

Inputs: limit, offset, symbol, to_date, +2 more.

br_bondsBonds and sukukA
Read-onlyIdempotent

List exchange-traded bonds, sukuk and treasury bills with maturity, coupon, price and yield to maturity.

Source: Mofid only; bonds are not in br_search. Prices are Rial per 1,000,000 par. ytm is percent per year; coupon_rate is a fraction (0.18 = 18%).

Inputs: sort, group, limit, query, +2 more.

br_etfsETFs with price vs NAVA
Read-onlyIdempotent

List exchange-traded funds with price, NAV and the gap between them (bubble), traded value and returns.

Use for "cheapest gold ETF" or "lowest bubble". Money is Rial. Next: br_stock (Mofid card) or br_fund (Agah) for one fund; br_screener (kind='etf' or 'mutual') filters funds on any column.

Inputs: sort, type, limit, query, +2 more.

br_fundFund detail, history or comparisonA
Read-onlyIdempotent

Show an investment fund from Agah: type, NAV, returns, asset mix and holdings, a daily history, or a side-by-side comparison.

Source: Agah only (Mofid ETFs: br_stock, br_etfs; Mofid funds: br_mofid_funds). metric gives a daily series, oldest first. Money is Rial, returns percent. Find codes with br_search(kind='fund'); filter many with br_screener.

Inputs: funds (required), metric, points, columns.

br_historyPrice historyA
Read-onlyIdempotent

Return price history of a stock: Mofid OHLC candles (1 minute to weekly) or Agah daily rows with buy and sell flows.

Mofid candles are oldest first, Tehran time, and work for indices, funds and options too. Agah rows have no OHLC. Prices are Rial. Use br_index for index history.

Inputs: symbol (required), days, limit, source, +2 more.

br_indexIndex card and index historyA
Read-onlyIdempotent

Show a market index (Mofid: market cap, free float, ratios, intraday move, members) and its daily history.

Without days only Mofid answers. With days, Mofid adds daily candles and Agah its total-index series. Next: br_industries for sector indices, br_market for today's snapshot.

Inputs: days, index, source, members.

br_industriesIndustriesB
Read-onlyIdempotent

Rank the bourse industries by value, return, market cap, P/E or money flow, from Mofid and Agah.

With industry (Agah) it shows that industry's return table and member stocks. Money is Rial. Next: br_technical with an industry ISIN, or br_stock.

Inputs: sort, limit, source, industry, +1 more.

br_learnLearn: education articles and coursesA
Read-onlyIdempotent

Search the Mofid learning blog and Agah Pedia for bourse, fund, option and gold explainers, or read one article.

Search first, then call again with ref from a result to read it (ref picks the source itself). Agah Pedia and Academy answer only from an Iranian network. Article text is third-party content.

Inputs: ref, kind, page, query, +4 more.

br_marketMarket overviewA
Read-onlyIdempotent

Show today's market snapshot: indices, traded value, money flow and buy/sell queues, from Mofid and Agah.

Start here for "how is the bourse today". Money is Rial. Next: br_market_top or br_stocks for rankings, br_industries for sectors, br_rates for price history.

Inputs: movers, prices, source, breadth.

br_market_topMarket rankingsB
Read-onlyIdempotent

Return one of the market's live top-N lists (most traded, buy queues, best return, lowest P/E, net individual buying, ...).

Source: Mofid only (Agah's ranking: br_stocks). Prices are Rial.

Inputs: board (required), limit.

br_mofid_fundsMofid's own fundsA
Read-onlyIdempotent

List the 19 investment funds managed under the Mofid brand with type, risk level, dividend policy and asset mix.

Source: Mofid only. A catalogue without prices or NAV: use br_etfs or br_stock for those.

Inputs: no named parameters.

br_newsMarket news and noticesA
Read-onlyIdempotent

Return the newest market news items: exchange notices, Codal letters, Telegram channel posts or Mofid research reports.

Source: Mofid only. Dates are Jalali. For a company's filing history use br_announcements.

Inputs: kind, chars, count, symbol.

br_optionsStock options: chain or one contractA
Read-onlyIdempotent

List stock-option contracts (about 1,600) with strike, expiry, moneyness, open interest and flows, or show one contract.

Source: Agah only. Prices are Rial per underlying share. Pass option (ISIN from the chain) for one contract with margin, break-even and order book. Use br_search first if unsure of the underlying.

Inputs: side, sort, limit, expiry, +2 more.

br_quotesGet quotesA
Read-onlyIdempotent

Return live price rows for 1 to 30 symbols at once: last and closing price, change, volume, limits, bid and ask, returns.

Source: Mofid only. Prices are Rial. last is the last trade, close the closing (weighted) price used for change. Index and fund ids work too.

Inputs: isins (required).

br_ratesCurrency, gold, coin and commodity pricesA
Read-onlyIdempotent

Return free-market prices of currencies, crypto, coins, 18k gold, the global ounce, oil and metals, or one code's daily history.

Source: Mofid only. Rial prices: divide by 10 for Toman. History is oldest first, back to 2019-2021.

Inputs: kind, limit, query, history_days.

br_scoresValuation scoresA
Read-onlyIdempotent

Return Bourse View's valuation scores: theoretical vs market price, a Buy/Neutral/Sell technical rating and a fundamental score out of 10.

Source: Mofid only. Pass ISINs for specific symbols, a section to rank the market on one aspect, or nothing for the best fundamental scores overall.

Inputs: isins, limit, section, technical, +1 more.

br_screenerScreen stocks or funds by any columnA
Read-onlyIdempotent

Filter, sort and compare all stocks or funds on any column, like Agah's screener pages (900 stocks, 330 ETFs, 475 funds).

Source: Agah only. Use it for "P/E under 6 and ROE over 30" or "best 1-year fixed-income funds"; br_etfs is the plain ETF list. Returns are percent; money and fund Nav are Rial. Column names are the site's (see list_columns); for ETFs names ending in 2 are NAV returns, the others market-price returns.

Inputs: kind (required), sort, limit, columns, +6 more.

br_stockOne stock or ETF in detailA
Read-onlyIdempotent

Show one stock (or, on Mofid, an ETF) in detail: price, ratios, returns, real vs legal flows, from Mofid and Agah.

Use it after br_search. The two sources have different fields, so both are shown. Prices are Rial. Next: br_history, br_stock_events (dividends), br_technical; for an Agah fund use br_fund.

Inputs: symbol (required), source, order_book.

br_stock_eventsDividends, capital changes, notices and major holders of a stockB
Read-onlyIdempotent

List a stock's cash dividend history, capital increases, recent exchange notices and major shareholders.

Source: Agah only. Dividends are Rial per share with the fiscal year.

Inputs: stock (required), holders.

br_stocksStock market watch with sortingA
Read-onlyIdempotent

Rank all listed stocks (about 750) by today's change, traded value, money flow, buyer power, queue or past returns.

Source: Agah only (Mofid's equivalents: br_market_top). Money and prices are Rial. net_money_flow is positive for money entering; buyer_power is the individual buyer vs seller average-size ratio. Then br_stock for one symbol.

Inputs: sort, limit, scale, market, +2 more.

br_technicalTechnical analysis summary of a stock or industryA
Read-onlyIdempotent

Show Agah's technical-indicator summary (moving averages and oscillators vote, RSI, MACD and others) for a stock or industry.

Source: Agah only. action: 2 strong buy, 1 buy, 0 neutral, -1 sell, -2 strong sell; an indicator tally, not advice.

Inputs: target (required), timeframe.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 22 tools

    Disambiguation4/5

    Tools are separated by asset class and action, with descriptions explicitly cross-referencing alternatives such as br_stock vs br_quotes and br_etfs vs br_fund. Residual overlap exists among ranking/filtering tools like br_stocks, br_market_top and br_screener, and across source-specific fund/ETF views, but the boundaries are mostly clear.

    Naming Consistency5/5

    All tools use a consistent br_ prefix and snake_case nouns, with predictable variants like br_stock/br_stocks and br_etfs/br_fund. Minor labels such as br_mofid_funds and br_market_top still fit the same pattern.

    Tool Count4/5

    The 22 tools are high but reasonable for a broad market-data domain covering stocks, funds, ETFs, bonds, options, indices, rates, news and screening across two sources. Each tool appears to earn its place, though the set sits at the upper end of comfortable scope.

    Completeness4/5

    The surface covers search, quotes, history, fundamentals, events, screening and multiple asset classes, supporting most core workflows. Minor gaps remain, such as bond/option history and some Mofid-specific fund detail, but agents can generally work around them.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      8
      210 PyPI
      10
      PolyForm Noncommercial 1.0.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      5
      383 PyPI
      10
      PolyForm Noncommercial 1.0.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      11
      181 PyPI
      PolyForm Noncommercial 1.0.0
    • A
      license
      A
      quality
      B
      maintenance
      Gives 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.
      14
      280 PyPI
      PolyForm Noncommercial 1.0.0