codal-mcp: Codal (کدال) disclosure and financial statement MCP server for AI agents
codal-mcp lets an AI agent search and read Codal, the official disclosure system of Iranian listed companies.
Codal (codal.ir, سامانه جامع اطلاعرسانی ناشران) is where companies and funds on the Tehran Stock Exchange, Iran Fara Bourse
and the other Iranian exchanges publish financial statements, monthly activity reports, meeting decisions and material news.
codal-mcp is an unofficial, read-only MCP server with 5 tools that turns those letters into text and tables for Claude, Cursor or Copilot.
For AI agents · Quick start · What it can do · Tools · FAQ · فارسی
For AI agents
- What: unofficial MCP server (model context protocol) for codal.ir, the disclosure system of companies and funds listed on Iranian exchanges (Tehran Stock Exchange, Iran Fara Bourse, commodity and energy exchanges, and registered unlisted companies).
- Install:
uvx codal-mcporclaude mcp add codal -- uvx codal-mcp. Transport: stdio. Needs uv (Python 3.10+). - Auth: none, no API key or account. Optional
CODAL_MCP_PROXY(HTTP proxy URL, or a comma-separated list); system proxy settings are ignored. - Access: read-only. It cannot log in or file anything, so no confirmation is needed before calling any tool.
- Tools: 5, all prefixed
cd_. Typical sequence:cd_company->cd_search_letters->cd_letter.cd_letter_typesgives letter type ids for filtering;cd_financial_yearsgives a company's fiscal year ends. - Use when: the user asks what a listed company disclosed: its latest interim or annual financial statements, EPS, monthly sales and production, shareholder meeting decisions, dividend schedule, capital increase, or the text of one Codal letter.
- Do not use when: the user wants share prices, order books or market indices (use tsetmc-mcp), or wants to trade.
- Output: compact JSON with ASCII digits. Dates are Jalali (
YYYY/MM/DD), Tehran time. Report amounts are as published, usually million Rial (seeunit_note). - Rate limit: codal.ir blocks an IP for up to an hour after a burst of requests. Make few, targeted calls and reuse results. If a tool says codal.ir is rate limiting, stop and wait.
- Network: codal.ir often answers only Iranian connections. If requests time out, set
CODAL_MCP_PROXYto an Iranian HTTP proxy. - Machine-readable:
server.jsonand the iran-mcp catalog.
Why
Everything an Iranian listed company publishes is on Codal, but behind a search form, Persian digits and report
pages rendered by JavaScript, with one statement sheet per page. Answering "how did Foolad do in the first half of
the year?" means finding the right letter among 1,475 and reading a table on screen. codal-mcp searches with the
site's own filters and returns the statement as rows an agent can read:
You: What did Foolad (فولاد) report for its first six months of 1405?
Agent: calls
cd_search_letters(symbol="فولاد", letter_type=6, period_months=6)->cd_letter(tracing_no=1612323)Mobarakeh Steel's unaudited six-month statements to 1405/06/31 (published 1405/07/30) show operating revenue of 2,509,422,184 million Rial, 56% more than the same period a year earlier, and a net profit of 591,629,286 million Rial, up 133%. Basic earnings per share were 308 Rial.
Real figures from tracing number 1612323, read with codal-mcp on 2026-10-31 and checked against the letter page on codal.ir.
What it can do
- Search disclosures of any publisher on Codal, newest first: by symbol, letter group, letter type, words in the title, Jalali date range, report period (1-12 months) or tracing number
- List the newest letters of the whole market when no filter is given
- Read financial statements as tables, one sheet at a time: income statement, comprehensive income, balance sheet, changes in equity, cash flows and the interpretive report pages, with the unit note and listed capital
- Read monthly activity reports: raw material purchases, production and sales by product, energy use and foreign currency sources and uses
- Read text letters such as explanations, clarifications and notices, without the page's hidden form templates
- Get the links to each letter's page, PDF, Excel file and attachments (with their descriptions and dates)
- Look up companies and funds by symbol or name: ISIC code, market, kind, industry and reporting type
- List letter groups and letter types with the ids the search takes, and a company's fiscal year ends
- Read-only by design: no login, no captcha solving
Example prompts:
- "What did Foolad report in its latest interim financial statements?"
- "Show the balance sheet from that letter."
- "List Iran Khodro's monthly activity reports for 1405."
- "Which companies published monthly activity reports this week?"
- "When does Foolad's fiscal year end, and when were its last annual statements published?"
- آخرین صورتهای مالی میاندورهای فولاد در کدال چه بود؟
- گزارش فعالیت ماهانه مهر ۱۴۰۵ ایران خودرو را بیاور.
- تصمیمات آخرین مجمع عمومی سالیانه فولاد را از کدال بخوان.
Quick start
You need uv. No API key or account.
Claude Code
claude mcp add codal -- uvx codal-mcp
Claude Desktop
Settings → Developer → Edit Config, then add:
{
"mcpServers": {
"codal": { "command": "uvx", "args": ["codal-mcp"] }
}
}
Cursor
Add the Claude Desktop block above to ~/.cursor/mcp.json (or .cursor/mcp.json in a project).
VS Code (Copilot agent mode)
Click Install in VS Code above, or add to .vscode/mcp.json:
{
"servers": {
"codal": { "type": "stdio", "command": "uvx", "args": ["codal-mcp"] }
}
}
Codex CLI
codex mcp add codal -- uvx codal-mcp
Or in ~/.codex/config.toml:
[mcp_servers.codal]
command = "uvx"
args = ["codal-mcp"]
Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"codal": { "command": "uvx", "args": ["codal-mcp"] }
}
}
Windsurf
Add the Claude Desktop block to ~/.codeium/windsurf/mcp_config.json.
Anything else
It is a standard stdio MCP server: run uvx codal-mcp, or pip install codal-mcp and run codal-mcp.
Tools
Pass the trading symbol in Persian (فولاد, خودرو). Dates are Jalali YYYY/MM/DD; Persian digits are accepted.
| Tool | What it does |
|---|---|
cd_search_letters |
Search codal.ir disclosures (letters) of Iranian listed companies, newest first, 20 per page |
cd_letter |
Read one codal.ir letter: its text or tables, plus links to its page, PDF, Excel and attachments |
cd_company |
Find companies and funds on codal.ir by symbol or name, with their market, industry and type |
cd_letter_types |
List codal.ir letter groups, or the letter types of one group with the ids cd_search_letters takes |
cd_financial_years |
List the fiscal year-end dates codal.ir knows for one company, newest first (Jalali) |
All 5 tools are annotated readOnlyHint: true.
How it works
AI agent (Claude, Cursor, Copilot, ...)
│
│ MCP over stdio
▼
codal-mcp (runs on your machine)
│
│ HTTPS, one request at a time, at least 2 s apart
├──────▶ search.codal.ir search API, company list, letter types, fiscal years
└──────▶ www.codal.ir letter pages, sheets, attachment lists
codal-mcp runs locally and calls the same search API and letter pages the codal.ir website uses. It has no hosted
server in between and no API key. Structured reports carry their tables as data inside the letter page; the server
reads that data and returns each row as one line, in the site's column order. Other letters come back as their
visible text. Requests go out through a Chrome-impersonating client, only to search.codal.ir and www.codal.ir.
It only reads.
Good to know
- Rate limit. codal.ir answers HTTP 429 and shows a captcha after a burst of requests, then blocks the IP for up to an hour. The server sends one request at a time, at least 2 seconds apart, keeps the company list and letter types for 12 hours, letters for an hour and searches for 2 minutes, and never retries a 429. After a 429 it stops calling codal.ir for 10 minutes and tells the agent to wait. It never solves captchas.
- Iranian connection. codal.ir often does not answer connections from outside Iran (from a foreign VPN exit, requests timed out in our tests). Set
CODAL_MCP_PROXYto an HTTP proxy with an Iranian exit. System proxy variables are ignored on purpose. - Units. Statement and report amounts are as published, usually million Rial;
unit_notequotes the page. EPS is in Rial. Divide Rial by 10 for Toman. - Tables are text. Each table row is one line with cells separated by
|. Numbers have no thousands separators, and negatives are-Nwhere the site shows(N). Income statements have two «درصد تغيير» columns: change against the same period last year and against the last full year. - One sheet at a time. Financial statements are split into sheets;
cd_letterreturns the list ofsheetsand takessheetto read another one (for example0for the balance sheet). - Attachments are listed, not read. Explanation letters often carry their content in an attached image or PDF.
cd_letterreturns the links. - Long letters are cut at 16,000 characters (
truncated); the PDF link has the whole letter. - Search tips.
period_months=12finds annual reports,6half-year and3quarterly;titlematches words in the letter title.cd_letter_typeslists letter type ids (6 financial statements, 58 monthly activity report, 20 annual general meeting decisions). - Persian text. Letter text is returned as the company wrote it, including Arabic ي/ك. Digits are converted to ASCII.
- What it does not do: no share prices (see tsetmc-mcp), no XBRL parsing, no reading of attached files, no login and no captcha solving.
FAQ
What is Codal (کدال)?
Codal (codal.ir, سامانه جامع اطلاعرسانی ناشران) is the official disclosure system run under Iran's Securities and Exchange Organization (SEO). Companies and funds listed on the Tehran Stock Exchange, Iran Fara Bourse and the other Iranian exchanges publish their financial statements, monthly activity reports, meeting notices and decisions, capital increases and material news there. About 5,400 publishers are on it.
How can an AI read a company's financial statements from Codal?
Add codal-mcp to your agent, then ask in plain language. The agent finds the letter with cd_search_letters
(for example symbol="فولاد", letter_type=6, period_months=6) and reads it with cd_letter(tracing_no=...), which
returns the income statement as rows; sheet=0 gives the balance sheet.
Is there an official Codal API?
There is no documented public API. codal-mcp uses the same search API and letter pages that the codal.ir website
uses, without login, and returns compact JSON.
Does it work outside Iran?
Often not directly: codal.ir did not answer requests from a foreign VPN exit in our tests. Run it on an Iranian
connection, or set CODAL_MCP_PROXY to an HTTP proxy with an Iranian exit.
Why does it say codal.ir is rate limiting?
codal.ir blocks an IP for up to an hour after many requests in a short time. The server spaces and caches requests to avoid it; if it still happens, wait and ask again with fewer calls. Results you already have stay valid.
How is it different from tsetmc-mcp?
tsetmc-mcp gives market data from the Tehran Stock Exchange: prices,
order book, trades and indices. codal-mcp gives what the companies themselves publish: statements, reports and
notices. Use both for a full picture of a stock.
Does it parse XBRL or give financial ratios?
No. It returns the tables as the site shows them; the agent can compute ratios from the rows. For a spreadsheet,
use the excel link that cd_letter returns.
Can it give investment advice?
No. It only reads what companies published. Nothing it returns is financial advice.
How do I debug what the agent sees?
npx @modelcontextprotocol/inspector uvx codal-mcp
Configuration
| Variable | Default | Meaning |
|---|---|---|
CODAL_MCP_PROXY |
unset | Optional HTTP proxy URL for codal.ir 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 کدال برای دستیار هوش مصنوعی
پروژه codal-mcp یک سرور MCP غیررسمی و فقطخواندنی برای کدال (codal.ir) است، سامانهای که شرکتها و صندوقهای بورس تهران، فرابورس و بقیه بورسهای ایران اطلاعیهها و صورتهای مالی خود را در آن منتشر میکنند. با این سرور، دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) اطلاعیههای کدال را جستجو میکند و متن و جدولهای آنها را میخواند.
چه کارهایی میکند
- جستجوی اطلاعیهها با نماد، گروه و نوع اطلاعیه، کلمههای عنوان، بازه تاریخ شمسی، طول دوره گزارش یا شماره پیگیری؛ جدیدترینها اول.
- خواندن صورتهای مالی به شکل جدول، هر بار یک برگه: سود و زیان، وضعیت مالی، جریانهای نقدی و بقیه برگهها.
- خواندن گزارش فعالیت ماهانه: خرید مواد اولیه، تولید و فروش هر محصول، مصرف انرژی و منابع و مصارف ارزی.
- متن اطلاعیههای توضیحی و شفافسازی، همراه با لینک PDF، فایل اکسل و پیوستها.
- جستجوی شرکتها و صندوقها با نماد یا نام، با کد آیسیک، بازار، صنعت و سالهای مالی.
نکتهها
- فقط اطلاعات منتشرشده را میخواند؛ وارد حسابی نمیشود و توصیه سرمایهگذاری نیست.
- مبلغها همانطور است که در کدال آمده، معمولاً میلیون ریال. تاریخها شمسی است.
- کدال بعد از تعداد زیادی درخواست، دسترسی را تا یک ساعت میبندد. این سرور درخواستها را یکییکی و با فاصله دستکم ۲ ثانیه میفرستد و نتیجه را نگه میدارد.
- کدال معمولاً فقط به اینترنت ایران جواب میدهد. اگر درخواستها بیجواب ماند، متغیر
CODAL_MCP_PROXYرا روی یک پراکسی HTTP با خروجی ایران بگذارید. - کلید API لازم نیست و سرور روی سیستم خود شما اجرا میشود.
نصب (اول uv را نصب کنید). در Claude Code:
claude mcp add codal -- uvx codal-mcp
در Claude Desktop، Cursor و بقیه برنامهها همان تنظیم بخش Quick start را بگذارید.
نمونه پرسشها
- «آخرین صورتهای مالی ششماهه فولاد را بیاور و سود خالص را با پارسال مقایسه کن.»
- «ترازنامه همان اطلاعیه را هم نشان بده.»
- «گزارشهای فعالیت ماهانه ایران خودرو در سال ۱۴۰۵ را فهرست کن.»
- «این هفته کدام شرکتها گزارش فعالیت ماهانه منتشر کردهاند؟»
- «سال مالی فولاد کی تمام میشود؟»
Development
git clone https://github.com/sepehr071/codal-mcp && cd codal-mcp
uv sync
uv run ruff check . && uv run ruff format --check .
uv run python -m pytest -q # offline unit tests on recorded codal.ir pages
uv run python -m pytest -m live -q # one pass over every tool against codal.ir (about 8 requests)
uv build
All tools live in src/codal_mcp/codal.py; all HTTP, pacing and caching in src/codal_mcp/http.py. Keep the live
suite small: codal.ir rate-limits hard. Issues and PRs are welcome.
Releases: bump the version in pyproject.toml and server.json, then push a v* tag. GitHub Actions publishes to PyPI.
Related servers
- tsetmc-mcp for Tehran Stock Exchange prices, order book, real vs legal trading and indices
- iran-tax-mcp for Iranian tax data: goods IDs and VAT, activity codes, property values and tax laws
- iran-mcp: catalog of all Iranian-service MCP servers
Disclaimer
Unofficial and not affiliated with or endorsed by Codal or the Securities and Exchange Organization of Iran (SEO). It is read-only and uses the search API and pages of the codal.ir website, which can change without notice. Data is informational. Nothing here is financial 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
Metadata
Release files for codal-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codal_mcp-0.1.0.tar.gz | 453.4 kB | With provenance | Details for codal_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codal_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for codal_mcp-0.1.0-py3-none-any.whl |
Total release size: 478.8 kB
Release files / codal_mcp-0.1.0.tar.gz
| Download URL | codal_mcp-0.1.0.tar.gz |
|---|---|
| Size | 453.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ab1c39be4f557d112edd356bc82c3fa340e48c7d02564d38a214eb35c4d308f
|
|
BLAKE2b-256 checksum How to use checksums |
d180d6845516ba329294c710f88fa6dd6d37fe4678480d3b8941058a77f75448
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logRelease files / codal_mcp-0.1.0-py3-none-any.whl
| Download URL | codal_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11af7eb6c2ef25443316cd163c6958029fb92fb71272f1a620f03c1f1877475c
|
|
BLAKE2b-256 checksum How to use checksums |
0449f10354dc584938c4dc8d3b64d89a15dee6db3365c7c6bf379025ae72f42c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logSecurity for codal-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for codal_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.