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 分