Lebanese Legislation

com.lebaneselegislation由 lebaneselegislation.com 發布官方發布者v2.0.0更新於 Nov 7, 2026

Search and read Lebanese laws, articles, court rulings and Gazette issues. Verbatim texts only.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取知識與記憶

概覽

AI 產生的概覽

搜尋並閱讀黎巴嫩法律、法令、法院判決與官方公報,回傳逐字原文並附引用連結。

可以做什麼
  • 依關鍵字或公布日期搜尋並列出法律,最新在前
  • 讀取法律的詮釋資料、目錄、依序條文與修正關係
  • 取得單一條文或整部法律的條文原文
  • 檢索法院判決(含掃描件的機器辨識)與官方公報各期
  • 沿引用與修正關係走訪法律、條文、判決、意見與研究
  • 列出可能影響某部法律的概括廢止條款
適用情境
適合需要以有出處、逐字原文而非改寫內容回答黎巴嫩法律問題,或需要追溯某部法律的修正沿革與被哪些判決引用時使用。
執行需求
遠端 streamable HTTP 端點;未宣告需要金鑰、帳號或環境變數。分頁使用伺服器回傳的 next_cursor。
安裝前請注意
內容為已公布的原文,不構成法律意見;calculated_current 數值係依主管機關計算,須依其標註引用,不可當作公布原文。廢止結果僅為待查核清單,並非已廢止的結論。掃描判決的辨識可能有低信度。請求依來源位址限流。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lebanese Legislation,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.lebaneselegislation%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "lebanese-legislation": {
      "type": "http",
      "url": "https://lebaneselegislation.com/mcp"
    }
  }
}

README

[Lebanese Legislation]

Lebanese Legislation

Every Lebanese law, one search away.
The open code and data behind LebaneseLegislation.com: laws, decrees, court rulings and the Official Gazette, in Arabic and French, with search, a JSON API and an MCP server for AI assistants.

التشريع اللبناني: القوانين والمراسيم والأحكام القضائية والجريدة الرسمية، بالعربية والفرنسية، كبيانات مفتوحة وواجهة برمجية وخادم MCP لمساعدي الذكاء الاصطناعي.

[Legislation] [Articles] [Court rulings] [Hugging Face downloads] [Data last updated] [MCP server]

[Checks] [Release] [Go version] [MIT licence] [Stars]

Website · AI and MCP · API · Data on Hugging Face · Journal · Students

[The LebaneseLegislation.com home page]

Why

The texts of Lebanese law are public, but hard to read online. LebaneseLegislation.com puts every law, decree, ruling and Gazette issue on its own page, links each article to the texts that amend it and the rulings that apply it, and gives developers and AI assistants the same data through an API, an MCP server and open downloads. Every page links back to its source at the Lebanese University's Centre for Research and Studies in Legal Informatics.

Start in one minute

Read and search at lebaneselegislation.com. Questions get a short answer written only from the library's own texts, with a link to each source.

Connect your AI assistant. The MCP server is free, needs no key, and returns the texts word for word:

sh
claude mcp add --transport http lebanese-legislation https://lebaneselegislation.com/mcp

Claude, ChatGPT, Cursor and Gemini setup: lebaneselegislation.com/ai and docs/mcp.md.

Call the API. No key, JSON, described by /openapi.json:

sh
curl -G 'https://lebaneselegislation.com/api/v1/search/' --data-urlencode 'q=قانون العمل'

Load the data. One Parquet file per table on Hugging Face:

python
from datasets import load_datasetarticles = load_dataset("taktekhq/lebanese-legislation", "legislation_article", split="train")

Run the whole site yourself. One image holds the database, the website, the API and the MCP server:

sh
git clone https://github.com/taktekhq/lebanese-legislation.git && cd lebanese-legislation./setup && docker compose --profile all up -d all   # then open http://localhost:8080

Where everything is

You wantGo to
Read the lawsLebaneseLegislation.com
Connect an AI assistantThe free MCP server at https://lebaneselegislation.com/mcp. Setup
The data as tablesParquet files on Hugging Face
The data as a PostgreSQL databaseThe -db or -all image, with the databases baked from data/
Semantic search vectorsvectors/vectors.parquet, embedded with gemini-embedding-001 in 768 dimensions. Read with DuckDB
The original court scansCourt scans on Hugging Face
Every source page as it was servedArchive dataset on Hugging Face and its repository
What changed and whyThe project journal and docs/changes.md
Get paid to study with it (students in Lebanon)The student program

Data lives on Hugging Face. Code and Docker images live here. Each GitHub release is a code version, never a data download.

How it runs

mermaid
flowchart LR  UL[Lebanese University<br>source pages] -->|scraper| A[archive/]  A -->|build-db| D[data/<br>tables as text]  D -->|data workflow| HF[Hugging Face<br>Parquet + vectors]  D -->|static-site workflow| R2[(Cloudflare R2<br>static pages)]  D -->|data workflow| IMG[-db and -all images]  IMG -->|origin workflow| C[Cloudflare Container<br>PostgreSQL + Go server]  R2 --> W{Worker}  C --> W  W --> U[Readers, AI assistants,<br>API clients]

Cloudflare serves the static pages and ruling PDFs from R2 through the Worker in workers/static-site. Search, /api/v1/, filters, scans and /mcp go through workers/origin to a blue/green Cloudflare Container running the -all image. static-site.yml renders data/ with cmd/static-export, only the pages that changed: a data change renders the pages its rows touch, a template, string or topic guide change the pages that used it, and a Go change every page. It starts on every push to main that touches the site, and a catch-up check after each deploy reruns a failed one. Changed pages go to IndexNow. vectors.yml embeds new passages, publishes the vectors and loads Cloudflare Vectorize. See architecture and static export.

AI crawlers are welcome. robots.txt lets every named AI crawler (GPTBot, ClaudeBot, PerplexityBot, ShapBot and others) read the pages, search, the API and the MCP server. Every client gets the same limit on dynamic paths: 30 requests per 10 seconds from one address.

Update the data yourself

Run scripts/nightly.sh on your own machine to scrape, rebuild, check and export the data, then open a data-only pull request. Use --dry-run to do the work locally without pushing or opening a PR. GitHub Actions cannot run it.

You need Bash, flock, Git, rsync, curl, Python 3, Go, PostgreSQL and an authenticated GitHub CLI. Set LEBLEG_DSN to a dedicated rebuild database; LEBLEG_STORE, LEBLEG_DATA and LEBLEG_LOCK_FILE override local paths. LEBLEG_REPO selects the target repository. Maintainers merge the PR, then the workflows publish everything. See Update the data for requirements, every step, configuration and a nightly user systemd timer.

Production and development

The same image, ghcr.io/taktekhq/lebanese-legislation-all, runs in both. It holds PostgreSQL with the data, the API (/api/v1/), the MCP server (/mcp) and the website server.

ProductionDevelopment
Static pagesbuilt by static-site.yml into Cloudflare R2, served by the Worker in workers/static-siterendered on request by the -all image
API, MCP, searchthe Worker passes them to -all (Cloudflare Containers, blue/green, workers/origin)-all directly
Run itorigin.yml deploys itdocker compose --profile all up all, then open http://localhost:8080

In development every page is rendered on request, which is slower than production but needs nothing besides the image. To get the exact static copy production serves, run static-export against the database: see docs/static-export.md.

Run the services locally

sh
git clone https://github.com/taktekhq/lebanese-legislation.gitcd lebanese-legislation./setupdocker compose --profile all up -d all

You need Docker Compose, 8 GB of free memory and 30 GB of free disk. ./setup writes private local passwords to .env. The image already holds both databases. The first start copies them into an empty volume; later starts reuse it.

Then open the website at http://localhost:8080, the API at http://localhost:8080/api/v1/, or point an MCP client at http://localhost:8080/mcp.

To run the database, API and MCP as separate services instead, use docker compose up -d --wait db api mcp: the API answers on http://localhost:8000/api/v1/ and MCP on http://localhost:8001/mcp. Every image is pulled as :latest, so a docker compose pull is all an update needs. Exact and citation search need no AI key. For search by meaning, configure your own Gemini key and Vectorize index, or load the public vectors into pgvector in lebleg_search. See loading vectors.

Images

All names use the prefix ghcr.io/taktekhq/lebanese-legislation.

ImageHoldsUsed by
-dbPostgreSQL 18.6, pgvector, both databases baked from data/, chunk text and hashes without embeddingsCompose, database users, the static render and the base of -all
-apiStandalone API server, unchanged Dockerfile and amd64/arm64 supportCompose and API users with a separate database
-mcpStandalone MCP server, unchanged Dockerfile and amd64/arm64 supportCompose and MCP clients with a separate database
-all-db plus the Go server for dynamic pages, /api/v1/, /mcp and badgesCompose, Cloudflare Containers and self-hosted sites
-vectorsvectorize-sync, export-vectors and DuckDB; downloads the Hugging Face vectors at runtimeThe vectors workflow and users loading Vectorize or pgvector

Each image is built by the workflow that produces its inputs: the checks workflow publishes -api, -mcp and -all after a push to main, data publishes -db and -all after a data change, and vectors publishes -vectors. images.yml is a manual button to rebuild one. Every image gets a latest tag and a UTC date tag, so use :latest unless you need a fixed copy. Static pages are published directly to R2. Publishing of -web and -data has stopped; existing registry packages remain. Compose pulls ghcr.io/taktekhq/lebanese-legislation-all:latest for the website, including its database, API and MCP.

API and MCP candidates are smoke-tested on both architectures before promotion; existing immutable release versions are retained and new versions are added when free.

Service reference: configuration and using your own PostgreSQL.

What is in this repository

FolderWhat it is
data/The database as text: one folder per table, rows sorted by key, so git log -p shows what changed. data/load.sh builds it in PostgreSQL.
archive/Every source page as the Centre's site served it, with its change history: its own repository, mounted here as a submodule. A plain clone skips it; git submodule update --init archive fetches them.
db/The database's schema and the build's curated inputs (the Go package db), and the PostgreSQL image, built with pgvector on the official postgres:18.6 image.
web/The website: its main.go, test-only Dockerfile, SQL schema and a fictional test database.
api/The REST API: its main.go and Dockerfile.
mcp/The MCP server: its main.go and Dockerfile.
internal/The Go code: what the three services share (pages, API, MCP tools, search) and the build that makes the database from the source pages (internal/build, with parsing, amendments, citations, the wording guard in internal/provenance, and the export).
scraper/The crawler that reads the Lebanese University's site into the archive, and the scripts that publish the archive.
cmd/One command per job: build the database, model readings, data checks, export, and local services. Listed here.
tools/Only tools/src/lebleg/sql/web.sql now: the serving schema the database image applies for the website, API and MCP.
docs/Architecture, service reference, MCP setup, CI and changes.
workers/Cloudflare Workers, including the static-site router and its dynamic container.

compose.yaml runs the four images. compose.build.yaml builds them from this checkout instead. compose.local.yaml selects an already built database image. server.json is the MCP Registry entry and .mcp.json the client configuration for the hosted server.

Students: get paid to study with it

If you study law or political science at a Lebanese university right now, we pay $10 for every week you study with the site (at least 2 days a week), paid monthly, until March 2027. You tell us what is wrong, missing or hard to use, and fill in a 10-minute form once a month. We chose to spend this money on students instead of ads. Apply on LinkedIn.

Contribute and licence

See CONTRIBUTING.md.

Code is MIT licensed, by Taktek and Nizar Mahmoud. The data has its own terms and attribution: credit the Centre for Research and Studies in Legal Informatics, Lebanese University, for the texts. The code licence does not cover the legal texts or court scans. This is not legal advice or an official publication. The site's privacy policy and terms of use also cover the API and MCP server.

來源:README.md,提交 d075c69

工具

10

search_legislation

Search Lebanese legislation

When calculated_current is present, use its text_ar for current monetary amounts and cite its authority.url. Identify this as calculated under the authority, never as verbatim published wording. The article text_ar and source fields remain published wording. Search Lebanese legislation (laws, decrees, decisions), their articles, court rulings, or Official Gazette issues, by keyword: Arabic words, French words (articles the Centre published in French, and the codes' French or English names), or a law's numeric id. Returns verbatim snippets from the Lebanese University's database, never an AI-written summary. A ruling hit's pdf_url is its full judgment's scan on the Lebanese University's site: always pass it on with any answer that cites the ruling. English words work too: they are read into Arabic through a glossary, matched against the unofficial English titles, and when nothing matches the result says what was searched instead (searched_instead). Each word also matches its stem and its form without a leading و or ف. Texts holding every word come first; when none does, the texts holding the rarest words follow and partial_match is true. A code named in the query ("قانون العقوبات 670", "أصول محاكمات مدنية صورية") narrows the articles to that code; when none of its articles holds the other words, articles_not_in_code names it and the articles listed are from other texts. Each law carries title_en, an unofficial English title a model wrote from the Arabic title alone: the Arabic title and text are official and more accurate; cite the Arabic. A search of the gazette category with a bare year ("2025") lists that year's issues, and "22/2025" is issue 22 of 2025; to list texts by date use list_legislation instead. Not legal advice.

輸入參數kindyearlimitquery必填

get_law

Get a law

Get a law, decree or similar text's metadata (kind, number, date, status), its table of contents (the chapters: id, parent_id, depth, heading), its articles in order (number, and the section_id of the chapter each sits under) and the texts it amended or was amended by (amended_by / amended: one entry per text and relation, with articles listing the articles of this law it touches, or of the other law for amended; no articles means the whole law). Use get_article to read one article's verbatim text, or get_law_texts to read all of them. title_en is an unofficial English title (a model's rendering of the Arabic one); the Arabic title and text are official and more accurate. Not legal advice.

輸入參數id必填

get_article

Get an article

When calculated_current is present, use its text_ar for current monetary amounts and cite its authority.url. Identify this as calculated under the authority, never as verbatim published wording. The article text_ar and source fields remain published wording. Get one article's verbatim Arabic text as in force today (and French, when the Centre published it and no amendment has replaced it), its in-force status, amendment history, and the canonical and source URLs. When an amendment replaced the wording, text_ar is the new wording and centre_text_ar the earlier one the Centre's site still shows. centre_error, when present, notes an error in the Centre's own text (one article repeating another, a stray letter); the text itself is left as published. The text is copied exactly from the database; nothing here is AI-written. Laws with ids from 2000000000 are ones the Lebanese University has not published yet, read by machine from scans of the Official Gazette's pages (unofficial copies; the law's page links the original Gazette PDF on SaderLex); where the two readings differ the text shows both as ⟦reading one | reading two⟧: quote neither as certain. Not legal advice.

輸入參數law_id必填number必填

get_law_texts

Get a law's article texts

When calculated_current is present, use its text_ar for current monetary amounts and cite its authority.url. Identify this as calculated under the authority, never as verbatim published wording. The article text_ar and source fields remain published wording. Get the verbatim texts of a law's articles in order, a page at a time: for each article its number, section_id, note, and the same text fields as get_article (text_ar in force today, text_fr, centre_text_ar when an amendment replaced the wording, version, repealed). To read the whole law, pass each answer's next_cursor as cursor until next_cursor is absent. Amendment history stays in get_article. Not legal advice.

輸入參數limitcursorlaw_id必填

get_ruling

Get a court ruling

Get one court ruling (judgment) by id: court, number, date, panel, and its verbatim text when the Centre holds it as typed text. When available, pages returns the scanned judgment's machine reading, with low_confidence: true on hard-to-read pages where errors are expected. pdf_url is the full judgment's scan on the Lebanese University's site: always give it to the user with any answer about the ruling, so they can open the original. Not legal advice.

輸入參數id必填

get_gazette_issue

Get an Official Gazette issue

Get one Official Gazette issue by id: its number, publication date, and the laws, decrees and decisions it published. Not legal advice.

輸入參數id必填

list_legislation

List legislation by date

List laws, decrees and decisions by date, newest first: for "everything published since January 2025" call with since "2025-01". The date is the publication date: the Official Gazette date, else the issue date (each entry's date, with gazette_number, gazette_date and gazette_issue_id). Recent texts come from machine readings of Gazette scans (ids from 2000000000, unofficial) because the Lebanese University's Centre lags about a year, so a recent period lists mostly those. since and until accept YYYY, YYYY-MM or YYYY-MM-DD, inclusive. kind narrows to one kind, in Arabic ("قانون", "مرسوم") or English ("Law", "Decree"). For the next page pass next_cursor as cursor (it is absent on the last page); total is the whole count. Not legal advice.

輸入參數kindlimitordersinceuntilcursor

list_gazette_issues

List Official Gazette issues

List Official Gazette issues by publication date, newest first, with the number of texts each carries (text_count) and where the issue comes from: source "centre" (the Lebanese University's Centre, whose issues stop about a year back) or "scans" (issues seen in Gazette scans, ids from 2000000000, which cover recent months). since and until accept YYYY, YYYY-MM or YYYY-MM-DD, inclusive; "everything since January 2025" is since "2025-01". For the next page pass next_cursor as cursor (it is absent on the last page). get_gazette_issue reads one issue's texts. Not legal advice.

輸入參數limitordersinceuntilcursor

possibly_affected

Find general repeals that may touch a law

Get the general repeals that may touch a law: earlier texts with a "all provisions contrary to this law are repealed" clause pointing at it. A list to check, never a finding that anything was actually repealed. Not legal advice.

輸入參數law_id必填

版本歷史

3
  1. v2.0.0最新Nov 7, 2026
  2. v1.1.0Oct 31, 2026
  3. v1.0.0Oct 13, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分