Fr Eli Mcp

io.github.matematicsolutions由 GitHub 帳號 matematicsolutions 發布v0.5.3更新於 Oct 24, 2026

MCP server for French Legifrance (PISTE): legislation and case law with citations and ECLI.

概覽

AI 產生的概覽

讓助理檢索法國 Legifrance(PISTE)的法規、判例與相關文本,並提供可驗證的引註。

可以做什麼
透過 PISTE 連接法國 Legifrance API,回傳原文並附上引註約定:穩定的 eli_uri、法式可讀引註與可解析的 source_url。工具支援依 fond 關鍵字檢索(LODA、CODE、JURI、CONSTIT、CETAT、CNIL、KALI、ACCO),依 LEGITEXT 編號取得法律或法令與其目錄,依 LEGIARTI 或 KALIARTI 編號取得單一條文原文,依 JURITEXT、CONSTEXT 或 CETATEXT 編號取得裁判及其原生 ECLI,取得 CNIL 決議原文,取得團體勞動協約,以及取得企業協議中介資料。另有涵蓋範圍工具說明已收錄與未收錄內容,並為缺口提供替代做法。
適用情境
當助理需要依據官方來源回答法國法律問題並精確引註時使用,例如查找法典條文、核對最高法院、憲法委員會或行政法院判例,或查閱 CNIL 決議與團體協約。適合需要可追溯引註的研究與草擬工作,而非一般網頁檢索;不涵蓋法國以外法律。
執行需求
本機 Python 程序,可用 uvx 執行 PyPI 套件 fr-eli-mcp,或以 python -m fr_eli_mcp 啟動。需要免費 PISTE 帳號並訂閱 Legifrance API,透過環境變數提供 OAuth2 憑證:FR_ELI_CLIENT_ID 與 FR_ELI_CLIENT_SECRET 為必填,FR_ELI_OAUTH_URL、FR_ELI_BASE_URL、FR_ELI_CACHE_DIR、FR_ELI_AUDIT_DIR 為選填。需要連線至 Legifrance/PISTE 的網路。僅支援桌面端。
安裝前請注意
需要 PISTE OAuth 憑證(FR_ELI_CLIENT_ID、FR_ELI_CLIENT_SECRET),以環境變數保存,應視為機密。此伺服器對 Legifrance 僅供讀取,但會寫入本機稽核記錄與磁碟快取(FR_ELI_AUDIT_DIR、FR_ELI_CACHE_DIR)。查詢內容與文件 id 會傳送至 PISTE/Legifrance 服務。說明指出其透過受管控管道散布,而非隨意下載安裝。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

fr-eli-mcp

Install (one command)

Published on PyPI + MCP Registry (io.github.matematicsolutions/fr-eli-mcp). Run without cloning:

bash
uvx fr-eli-mcp

Requires PISTE credentials in env: PISTE_CLIENT_ID, PISTE_CLIENT_SECRET (Legifrance/PISTE).

Configure your MCP client (stdio):

json
{ "mcpServers": { "fr-eli-mcp": { "command": "uvx", "args": ["fr-eli-mcp"] } } }

Windows 11 with Smart App Control

Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe and the fr-eli-mcp.exe launcher that pip writes at install time. The python.exe and py.exe from the python.org installer are signed by the Python Software Foundation, so running the module through the interpreter works:

bash
python -m pip install fr-eli-mcppython -m fr_eli_mcp

pip.exe is blocked for the same reason, so install with python -m pip, not pip install. If python is not on PATH, use the Windows launcher: py -3 -m fr_eli_mcp.

json
{ "mcpServers": { "fr-eli-mcp": { "command": "python", "args": ["-m", "fr_eli_mcp"] } } }

Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.

Building from source: see Install.

An MCP server for the French Legifrance API via PISTE. It searches French legislation (LODA laws & decrees, codes), case law from three jurisdictions - Cour de cassation / cours d'appel (JURI), the Conseil constitutionnel (CONSTIT - QPC/DC decisions) and the administrative courts (CETAT - Conseil d'Etat, cours administratives d'appel, tribunaux administratifs) - plus CNIL deliberations (CNIL), collective labour agreements (KALI) and company-level agreements (ACCO), and returns verbatim text with verifiable citations. Part of the eu-legal-mcp line of national legal connectors by MateMatic.

Every response carries the citation contract: a stable eli_uri, a human_readable_citation (French convention) and a resolvable source_url.

Read-only. The server only queries Legifrance and writes a local audit log. It never modifies official text and never sends anything beyond your query / document id.

Tools

ToolWhat it does
fr_search(query, fond, page_size)Keyword search a fond: LODA (laws & decrees), CODE (codes), JURI (Cour de cassation case law), CONSTIT (Conseil constitutionnel decisions), CETAT (administrative case law: Conseil d'Etat, CAA, TA), CNIL (CNIL deliberations), KALI (collective labour agreements), ACCO (company-level agreements). Returns hits with the citation contract; CODE hits expose matched article_ids.
fr_get_act(text_id, date)Consult a LODA law/decree by LEGITEXT... id. Returns metadata + a table of contents (articles).
fr_get_text(article_id)Verbatim text of a single article by LEGIARTI... id (legislation/codes) or KALIARTI... id (collective agreements).
fr_get_decision(decision_id)A court decision by JURITEXT..., CONSTEXT... or CETATEXT... id, with its native ecli (when populated), court, formation, solution and text.
fr_get_deliberation(deliberation_id)A CNIL deliberation by CNILTEXT... id (sanctions, authorizations, opinions) with its verbatim text and the citation CNIL, deliberation n° ... du ....
fr_get_convention(convention_id)A collective labour agreement text by KALITEXT... id. Returns metadata + a table of contents whose KALIARTI... ids resolve via fr_get_text.
fr_get_company_agreement(agreement_id)A company-level agreement by ACCOTEXT... id - metadata only (company, SIRET, IDCC, sector, themes, unions, dates). Legifrance ships the full ACCO text only as a .docx attachment, so the tool cites source_url instead of re-serving it.
fr_coverage()Declare what this connector covers, when each family was captured, and - explicitly - what it does NOT cover. Every gap carries a fallback.

Fonds covered (live totals, sandbox, 2026-07-08)

FondCorpusVerified total
CNILCNIL deliberations>= 26 759 (totalResultNumber on a broad stopword query)
KALICollective labour agreements (conventions collectives)>= 35 790
ACCOCompany-level agreements>= 387 656

Jurisdictions covered

FondCourt(s)Id prefixNative ECLI
JURICour de cassation, cours d'appelJURITEXT...Yes
CONSTITConseil constitutionnel (QPC + DC decisions, ~7 400+ live on PISTE)CONSTEXT...Yes (ECLI:FR:CC:...)
CETATConseil d'Etat, cours administratives d'appel (CAA), tribunaux administratifs (TA)CETATEXT...Yes for Conseil d'Etat; frequently null for CAA/TA (uneven ECLI coverage upstream - never fabricated)

Conseil constitutionnel decisions get the French citation convention: Cons. const., decision n° 2025-1173 QPC du 7 novembre 2025 - [case name]. JURI/CETAT decisions cite the Legifrance titre (court, formation, date, dossier number) verbatim.

Judilibre (api.piste.gouv.fr/cassation/judilibre) was evaluated as an alternative Cour de cassation source but requires its own PISTE API subscription beyond the Legifrance one already held by this connector. Re-verified 2026-07-08: a valid Legifrance token (granted scope openid resource.READ) gets 403 on the sandbox host for every endpoint and auth shape tried (Bearer, KeyId, no-auth -> 400), and the sandbox application is rejected outright by the production OAuth endpoint (invalid_client). Subscribing the Judilibre API to the PISTE application is a dashboard action outside this connector. Not integrated - JURI already covers Cour de cassation case law through the existing Legifrance subscription.

A note on ELI vs ECLI

France has an official ELI scheme, but the PISTE lf-engine-app consult API returns the native ELI field null for the legislation we tested. Following this line's rule - say what you do not have, never fabricate an ELI - eli_uri carries the stable, resolvable Legifrance resource URL (CID-keyed), not a /eli/... string parsed from prose. Each response repeats this in eli_note.

Case law is different: the API returns a native, authoritative ECLI for Cour de cassation (e.g. ECLI:FR:CCASS:2025:C100399), Conseil constitutionnel (e.g. ECLI:FR:CC:2025:2025.1173.QPC) and Conseil d'Etat (e.g. ECLI:FR:CECHR:2026:506507.20260529), surfaced verbatim in fr_get_decision. CAA/TA decisions under CETAT frequently have no ECLI - the field is null, never fabricated.

Configuration

Legifrance requires OAuth2 application credentials from a free PISTE account (piste.gouv.fr → Applications → subscribe to the Legifrance API → OAuth Credentials). Credentials are read from the environment only:

VariableMeaning
FR_ELI_OAUTH_URLOAuth token endpoint (sandbox default shown in .mcp.json.example).
FR_ELI_BASE_URLLegifrance lf-engine-app base.
FR_ELI_CLIENT_IDYour PISTE application client id (required).
FR_ELI_CLIENT_SECRETYour PISTE application client secret (required).
FR_ELI_CACHE_DIRDisk cache dir (default ~/.matematic/cache/fr-eli).
FR_ELI_AUDIT_DIRAudit log dir (default ~/.matematic/audit).

Copy .mcp.json.example to .mcp.json (gitignored) and fill in your credentials, or set the variables in your host environment. The OAuth token is cached in memory and refreshed automatically.

Install

bash
py -3.13 -m venv .venv.\.venv\Scripts\python.exe -m pip install -e ".[dev]"   # Windows# or: python -m pip install -e ".[dev]"                  # POSIX

Tests

bash
pytest tests/test_instructions_drift.py tests/test_parse.py   # offline, no credspytest tests/test_smoke.py -v                                 # live, needs PISTE creds in .env

Distribution

Because Legifrance requires a PISTE key, this connector is distributed through the PATRON / appliance channel (governed), not casual drop-in download. See the eu-legal-mcp line notes.

Licence

Apache-2.0. Legifrance content is © the French Republic / DILA and subject to the Legifrance / PISTE terms of use; this software only retrieves and cites it.

來源:README.md,提交 d3b5b13

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分