What this is
MCP (Model Context Protocol) lets an AI assistant call tools on a server instead of guessing from training data. Connect one here and it can search this library, open a law, read one article's exact text (Arabic and French, as the Lebanese University's Centre for Research and Studies in Legal Informatics published it), and walk the citation graph between texts.
The MCP tools and the API never rewrite a law. Every text they return is copied from the database, the same text the pages on this site show. The answer box on the search page is different: Gemini writes it from passages of our texts, links every source, and can be wrong. Anything an AI tells you beyond the text can be wrong. Check the article it cites, and the Official Gazette, before relying on it.
The server
One address, no account, no key:
https://lebaneselegislation.com/mcp
It speaks Streamable HTTP, stateless JSON-RPC 2.0 (MCP protocol version 2025-06-18; 2025-03-26 also works). No sign-in, no session to keep open. It runs on Cloudflare: a Worker in front, and the same Go server and PostgreSQL database that answer the site's search, in a Cloudflare Container. The code is open on GitHub.
Claude (claude.ai and Claude Desktop)
- Open Settings, then Connectors.
- Click Add custom connector.
- Name it "Lebanese Legislation".
- Paste the URL above as the remote MCP server URL and click Add.
Claude Code
claude mcp add --transport http lebanese-legislation https://lebaneselegislation.com/mcp
ChatGPT
- Open Settings, then Connectors. On a paid plan, open Advanced and turn on Developer mode first.
- Click Add connector (or Create).
- Name it "Lebanese Legislation" and paste the URL above as the MCP server URL.
- Click Create, then switch the connector on in a new chat.
Cursor and VS Code (mcp.json)
{
"mcpServers": {
"lebanese-legislation": {
"url": "https://lebaneselegislation.com/mcp"
}
}
}
Gemini CLI (settings.json)
{
"mcpServers": {
"lebanese-legislation": {
"httpUrl": "https://lebaneselegislation.com/mcp"
}
}
}
What it can do
- search_legislation: search laws, articles, rulings or Gazette issues by keyword, Arabic or French, or a law by its id.
- get_law: a law's metadata, status, table of contents, and the texts it amended or was amended by.
- get_article: one article's verbatim text, status, amendment history and source.
- get_law_texts: all of a law's article texts in order, a page at a time, for reading or comparing a whole code.
- get_ruling: one court ruling, with its scanned judgment and, once read, a machine reading of it (it may contain errors; the scan is the reference).
- get_gazette_issue: one Official Gazette issue and what it published.
- list_legislation: laws, decrees and decisions by date, newest first (the Gazette date, else the issue date), with since, until, kind, order, limit and cursor. Texts read from Gazette scans are included.
- list_gazette_issues: Official Gazette issues by date, each with its number of texts and its source: the Centre, or the scans for recent issues.
- get_links: the graph edges into or out of a law, article, ruling, opinion, research study or Gazette issue, for walking citations and amendments directly.
- possibly_affected: the general repeals that may touch a law, a list to check, never a finding that anything was actually repealed.
Every result carries this site's own address for that law, article, ruling or issue, the Centre's own source page when known, and the not-legal-advice line.
The JSON API
The same data, over plain HTTP, for anything that isn't an MCP client:
GET /api/v1/search/?q=&type=laws|rulings|gazette|articles&year=&limit=&cursor=
GET /api/v1/law/{id}/
GET /api/v1/law/{id}/article/{n}/
GET /api/v1/ruling/{id}/
GET /api/v1/gazette/{id}/
GET /api/v1/laws/?since=&until=&kind=&order=newest|oldest&limit=&cursor=
GET /api/v1/gazette/?since=&until=&order=newest|oldest&limit=&cursor=
curl "https://lebaneselegislation.com/api/v1/search/?q=%D9%85%D9%88%D8%AC%D8%A8%D8%A7%D8%AA&limit=5"
Everything published since January 2025: since=2025-01. since and until take YYYY, YYYY-MM or YYYY-MM-DD, inclusive. Up to 100 a page; for the next one pass next_cursor as cursor, while it is there. The MCP tools list_legislation and list_gazette_issues take the same parameters.
curl "https://lebaneselegislation.com/api/v1/laws/?since=2025-01"
get_links takes cursor, order (newest or oldest) and, for a law, scope: "all" (the default) adds the links of its articles, "law" is the law alone. It answers with total and next_cursor.
In get_law and /api/v1/law/{id}/, amended_by and amended list each text with its relation, its date and articles: the articles of this law it changes (of the other text, for amended). No articles means the change is to the text as a whole.
The whole API, every endpoint, parameter and field, as an OpenAPI 3.1 description for code generators and AI agents: /openapi.json
updated_at is the day a record's page last changed on this site: an amendment in force, a ruling's reading, a correction. It is never the text's own date, and it is absent when we do not know it.
Limits
- 60 calls a minute per address, and at most 30 in any 10 seconds at Cloudflare's edge. Past that, a 429.
- Requests over 64 KB are rejected.
- Search results, 20 at a time at most.
- Every legal text is verbatim from the database. No tool paraphrases or summarizes a law.
- Not legal advice. Official texts from the Lebanese University's Centre for Research and Studies in Legal Informatics.
Browse data downloads and reuse terms
vectors/vectors.parquet contains 1,547,937 chunks embedded with gemini-embedding-001 in 768 dimensions. Columns: id, document, model, hash and values (FLOAT[768]). Hosted semantic search uses Cloudflare Vectorize.
Run it yourself
Want the website, the API and this MCP server on your own machine, with your own copy of the data? Read how to run it yourself.
Hear about changes
Watch the repository on GitHub for new releases, or follow taktekhq on Hugging Face for new data.