Skip to main content

MCP server for the French Legifrance API via PISTE (legifrance.gouv.fr) — search legislation (LODA, codes) and case law (JURI) with verifiable citations and native ECLI.

Project description

fr-eli-mcp

An MCP server for the French Legifrance API via PISTE. It searches French legislation (LODA laws & decrees, codes) and case law (JURI), 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

Tool What it does
fr_search(query, fond, page_size) Keyword search a fond: LODA (laws & decrees), CODE (codes), JURI (case law). 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.
fr_get_decision(decision_id) A JURI court decision by JURITEXT... id, with its native ecli, court, formation, solution and text.

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 (e.g. ECLI:FR:CCASS:2025:C100399), surfaced verbatim in fr_get_decision.

Configuration

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

Variable Meaning
FR_ELI_OAUTH_URL OAuth token endpoint (sandbox default shown in .mcp.json.example).
FR_ELI_BASE_URL Legifrance lf-engine-app base.
FR_ELI_CLIENT_ID Your PISTE application client id (required).
FR_ELI_CLIENT_SECRET Your PISTE application client secret (required).
FR_ELI_CACHE_DIR Disk cache dir (default ~/.matematic/cache/fr-eli).
FR_ELI_AUDIT_DIR Audit 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

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

pytest tests/test_instructions_drift.py tests/test_parse.py   # offline, no creds
pytest 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fr_eli_mcp-0.1.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fr_eli_mcp-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file fr_eli_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: fr_eli_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fr_eli_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38727e59dd15756d8f19e0eb107289ecfd61903d59d8c6cefabc897d7400f976
MD5 03478a791ab5640cdef4244a72041fec
BLAKE2b-256 cb70e836f7b49edf1ad8b5ebdab916ef6bf42e17a6bc3ae038a9b1c90d833c93

See more details on using hashes here.

Provenance

The following attestation bundles were made for fr_eli_mcp-0.1.0.tar.gz:

Publisher: release.yml on matematicsolutions/fr-eli-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fr_eli_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fr_eli_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fr_eli_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e44cb6a4fd67a8704b88b4c71f66ebeba1f35fd36554c811a654cf2320feec2
MD5 ba9e935fdb484f6954f9b3b100dff957
BLAKE2b-256 57a74077363e32548a2cbcbdfbe6153811cbae738bec36942167a886efb152aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for fr_eli_mcp-0.1.0-py3-none-any.whl:

Publisher: release.yml on matematicsolutions/fr-eli-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page