
Qavanin
io.github.sepehr071由 GitHub 帳號 sepehr071 發布v0.2.0更新於 Nov 7, 2026
Unofficial read-only qavanin.ir: search Iranian laws and regulations, read full text and status.
概覽
非官方唯讀 MCP 伺服器,讓助理檢索並閱讀 qavanin.ir 上的伊朗法律、法規、法院裁判與法律意見。
- 可以做什麼
- 依標題或全文檢索約 16.8 萬份文件,可依類別、核准機關、執行機關、主題、文件類型、狀態、日期與公報號篩選
- 查詢這些篩選條件所需的 id,例如核准機關、執行機關、主題、文件類型與狀態
- 以章節形式閱讀法律、閱讀單一條文及其附註,或閱讀某一歷史日期的文本
- 查看中繼資料:核准與公布日期、公報號與日期、最新狀態、執行機關
- 追溯修正關係,包括某條文的每次修正及其替代文本
- 查找與某部法律相關的法規、法院裁判與法律意見
- 適用情境
- 適合在需要了解某部伊朗法律、法規、法院裁判或法律意見的內容、核准與公布時間、是否被修正或廢止,以及有哪些文件引用它時使用。它只是研究輔助工具,不提供法律意見或具拘束力的解釋。
- 執行需求
- 透過 uvx(或 pip install)以 stdio 在本機執行,需要 uv 與 Python 3.10+。不需帳號或 API 金鑰。需要能連線到 qavanin.ir;選用環境變數 QAVANIN_MCP_PROXY 可設定 HTTP 代理或逗號分隔的代理清單,系統代理設定會被忽略。僅支援桌面用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Qavanin,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
qavanin-mcp: Iranian laws and regulations MCP server for AI agents
Let your AI agent read Iranian law (قوانین و مقررات ایران).
An unofficial, read-only MCP server for qavanin.ir (سامانه ملی قوانین و مقررات جمهوری اسلامی ایران), the national database of Iranian laws, regulations, court votes and legal opinions.
Search about 168,000 documents by title or full text, read a law or a single article, see how an article was amended, and follow the regulations and court votes that cite it, all from Claude, Cursor or Copilot.
[PyPI] [Python] [CI] [MCP Registry] [License: MIT] [mcpfarsi]
For AI agents · Why · What it can do · Quick start · Tools · How it works · Good to know · FAQ · Configuration · فارسی · Development · Related · Disclaimer · License
For AI agents
- What: unofficial MCP server (model context protocol) for qavanin.ir, Iran's national laws and regulations database. Queries work in Persian (Arabic ي/ك and Persian ی/ک are equivalent); dates are Jalali
YYYY/MM/DD. - Install:
uvx qavanin-mcporclaude mcp add qavanin -- uvx qavanin-mcp. Transport: stdio. Needs uv (Python 3.10+). - Auth: none, no API key or account. Optional
QAVANIN_MCP_PROXY(HTTP proxy URL, or a comma-separated list tried in turn); system proxy settings are ignored. - Access: read-only. No login, subscription or purchase calls exist, so no confirmation is needed before calling any tool.
- Tools: 7, all prefixed
qv_. Typical sequence:qv_search->qv_law(witharticle) ->qv_amendments->qv_article_history. - Units: dates are Jalali strings (
1405/07/22); document ids (id, the site'sIDS) are 20-digit strings, keep them as strings; text uses Persian ی/ک. - Use when: looking up what an Iranian law, regulation, court ruling or legal opinion says, when it was approved and published, whether it was amended or repealed, and what cites it.
- Do not use when: the user needs legal advice or a binding interpretation. The site is a reference database; always say which version and status you read. Sections marked
repealedoramendedare not current text. - Machine-readable:
server.jsonand the iran-mcp catalog (TOOLS.md,servers.json,llms.txt).
Why
Iranian legislation is spread over thousands of laws, by-laws, court votes and opinions, and a law's current text depends on later amendments. Answering "what does article 10 of the civil code say, was it ever amended, and which regulations cite it?" means a lot of searching on a slow, server-rendered site. With qavanin-mcp an agent does it in a few calls and returns only the relevant article instead of an 892 KB law.
You: ماده ۱۰ قانون مدنی چه میگوید؟
Agent: calls
qv_search(query="قانون مدنی", kind="law")->qv_law(ids=..., article="10")It finds the civil code, reads just article 10 with its notes, and can follow up with
qv_article_historyto show whether that article was changed.
What it can do
- Search about 168,000 laws, regulations, court votes and legal opinions by title or full text, with filters for kind, approving body, executor, subject, document type, status, dates and gazette numbers
- Read a law as sections, a single article with its notes, or the text as of a past date
- Check status: approval, notification and gazette numbers and dates, last status, executors
- Trace amendments: which laws amended this one, which it amends, and every amendment of one article with its replacing text
- Follow citations: regulations, court votes and legal opinions related to a law
- Look up filter ids: approving bodies, executing bodies, subjects, document types, statuses and curated lists
- Read-only by design: no login, no comments, no subscriptions, no purchases
Quick start
You need uv. No API key or account.
Claude Code
Claude Desktop
Settings → Developer → Edit Config, then add:
Cursor
Add the Claude Desktop block to ~/.cursor/mcp.json.
VS Code (Copilot agent mode)
Click Install in VS Code above, or add to .vscode/mcp.json:
Codex CLI
Or in ~/.codex/config.toml:
Gemini CLI
Add to ~/.gemini/settings.json:
Windsurf
Add the Claude Desktop block to ~/.codeium/windsurf/mcp_config.json.
Anything else
It's a standard stdio MCP server: run uvx qavanin-mcp, or pip install qavanin-mcp and run qavanin-mcp.
Then just ask:
- "What does article 10 of the Iranian civil code say?"
- "Was article 1 of this law ever amended? Show the amendment history."
- "Find the latest laws approved by the Majlis and list their gazette numbers."
- "Which regulations and court votes are related to the Iranian Commercial Code?"
- "Show the text of this law as it was on 1400/01/01."
- ماده ۱۰ قانون مدنی چه میگوید؟
- آیا ماده ۱ این قانون اصلاح شده است؟ تاریخچه اصلاحات را نشان بده.
- آییننامهها و آرای مرتبط با قانون تجارت کداماند؟
Tools
All tools return compact JSON. Document ids from qv_search go to the other tools; qv_lookup finds the ids that qv_search filters take.
All 7 tools are annotated readOnlyHint: true.
How it works
qavanin-mcp runs locally and reads the same pages the qavanin.ir website serves (server-rendered HTML plus two small JSON lookups). There is no hosted server in between and no API key. The site's bot-check cookie is solved in Python, so no browser is needed.
Good to know
- The site is slow: 1-15 s per call. The civil code takes about 15 s on first read; it is cached for 5 minutes, so paging through it is fast.
- Dates are Jalali (
1405/07/22), ids stay strings (20-digit), and text is normalised to Persian ی/ک. Placeholder dates such as0000/00/00are dropped. - Status matters: sections marked
repealedoramendedare not current text. Say which version and status you read. - Full-text search shows no snippet. With
in_textit finds words inside the law text, so open candidates withqv_law(article=...). - The site sometimes ignores search filters and answers with the whole database; the server detects that and retries.
- Sorting by date has ties, so paging a long list can repeat or skip a row: narrow the filters instead of paging deep.
- Not covered: comments, subscriptions, purchases and any account feature. It is a research aid, not legal advice.
FAQ
Is there an MCP server or API for Iranian laws (qavanin.ir)?
Yes: qavanin-mcp is an unofficial MCP server with 7 read-only tools for searching and reading laws, regulations, court votes and legal opinions on qavanin.ir. It reads the same pages as the website; no API key is needed.
How do I use it with Claude, Cursor or Copilot?
Add the server with claude mcp add qavanin -- uvx qavanin-mcp (or the matching config in Quick start), then ask in plain language, in Persian or English.
Is it official, safe and free?
It is unofficial and not affiliated with qavanin.ir or the Iranian government. It is read-only, runs on your machine, and is free under the MIT license.
Is the text legally binding or up to date?
No. It shows what the site shows. Check each document's status and amendments (qv_law_info, qv_amendments) before relying on it, and consult a lawyer for legal advice.
Can I search with Arabic letters (ي/ك)?
Yes. The site stores Arabic ي/ك, and queries in either form match. Output is normalised to Persian ی/ک.
Why is it slow on the first read of a big law?
The site returns a whole law in one response (the civil code is about 892 KB). The server caches it for 5 minutes, so reading further articles is fast.
Can it log in, comment or subscribe?
No. It has no login and never calls comment, subscription or purchase endpoints.
I get a bot-check or connection error
The server solves qavanin.ir's cookie challenge itself. If your network still cannot reach the site, set QAVANIN_MCP_PROXY to an HTTP proxy that can. System proxy variables are ignored on purpose.
Claude Desktop says uvx is not found
Use the full path to uvx (where uvx on Windows, which uvx on macOS/Linux) as command.
Configuration
فارسی
سرور MCP قوانین و مقررات ایران برای دستیار هوش مصنوعی
qavanin-mcp یک سرور MCP غیررسمی و فقطخواندنی برای سامانه ملی قوانین و مقررات جمهوری اسلامی ایران (qavanin.ir) است. دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) با آن میتواند در حدود ۱۶۸ هزار سند شامل قوانین، مقررات، آرای قضایی و نظرات حقوقی جستجو کند.
چه کارهایی میکند
- جستجو در عنوان یا متن اسناد، با فیلتر نوع سند، مرجع تصویبکننده، دستگاه اجرایی، موضوع، وضعیت، تاریخ و شماره روزنامه رسمی.
- خواندن متن قانون، یک ماده با تبصرههایش، یا متن قانون در یک تاریخ گذشته.
- اطلاعات سند: تاریخ تصویب و ابلاغ، شماره روزنامه رسمی، آخرین وضعیت و دستگاههای اجرایی.
- اصلاحات: کدام قوانین این قانون را اصلاح کردهاند و تاریخچهٔ اصلاح هر ماده.
- مقررات و آرای مرتبط: آییننامهها، آرای دادگاهها و نظرات مرتبط با هر قانون.
نکتهها
- فقط خواندنی است: وارد حساب نمیشود، اشتراک یا خرید ندارد.
- تاریخها شمسی (مثل
1405/07/22) هستند و حروف عربی «ي» و «ك» در جستجو با «ی» و «ک» یکی حساب میشوند. - سایت کند است (۱ تا ۱۵ ثانیه برای هر درخواست). این ابزار مشاوره حقوقی نیست؛ وضعیت و اصلاحات هر متن را بررسی کنید.
- روی سیستم خود شما اجرا میشود و کلید API لازم ندارد.
کلیدواژهها: قوانین و مقررات ایران، سامانه ملی قوانین و مقررات، قوانین کشور، متن قانون، قانون مدنی، آرای قضایی، نظرات مشورتی، اصلاحات قانون، سرور MCP قوانین.
نصب (اول uv را نصب کنید). در Claude Code:
در Claude Desktop، Cursor و بقیه برنامهها همان تنظیم بخش Quick start را بگذارید.
نمونه پرسشها
- «ماده ۱۰ قانون مدنی چه میگوید؟»
- «آیا ماده ۱ این قانون اصلاح شده است؟»
- «آییننامههای مرتبط با قانون تجارت را فهرست کن.»
- «متن این قانون در تاریخ ۱۴۰۰/۰۱/۰۱ چه بود؟»
Development
Tools live in src/qavanin_mcp/search.py and law.py; each is a typed async function with a docstring that tells the agent when to use it. Issues and PRs are welcome.
Releases: bump the version in pyproject.toml and server.json, then push a v* tag. GitHub Actions tests, publishes to PyPI and the MCP Registry, and creates the GitHub Release.
Related servers
- Iran Tax MCP server for Iranian tax and Codal data
- Paziresh24 MCP server for doctors and appointments
- Iran News MCP server for Iranian news
- Iran Apps MCP server for Iranian apps
- iran-mcp: catalog of all Iranian-service MCP servers
- Listed on mcpfarsi.ir, the Persian MCP marketplace
Disclaimer
Unofficial and not affiliated with or endorsed by qavanin.ir or the Iranian government. It reads the pages of the qavanin.ir website, which can change without notice, and it is a research aid, not legal advice. Please keep request rates reasonable.
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
If this saves you time, a star helps others find it.
來源:README.md,提交 5df8dfd
工具
0版本歷史
4- v0.2.0最新Nov 7, 2026
- v0.1.2Oct 23, 2026
- v0.1.1Oct 22, 2026
- v0.1.0Oct 20, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分