mcp-fr-legal
This server provides offline, citation-grounded access to the French legal corpus (Legifrance/DILA) via MCP tools.
fr_search: full-text (FTS5) search over French legal provisions, with optional document filter and verbatim snippets plus citations.fr_article: retrieve the complete verbatim text of a specific provision bydocument_idandprovision_ref.fr_validate_citation: check whether a document/provision citation actually exists in the corpus (fail-closed anti-hallucination grounding).fr_list_documents: discover available legal documents (codes/statutes) and theirdocument_idvalues.All tools return structured citations with provenance (DILA, Etalab license, snapshot age/staleness).
Runs fully offline against a local SQLite FTS5 database; no runtime network calls.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-fr-legal Show me article 1240 of the French Civil Code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-fr-legal
An MCP server exposing an offline corpus of French law (Legifrance / DILA, full text)
in a local SQLite FTS5 database, with tools for search and citation grounding. Snippets are
returned verbatim from the database (zero-LLM), each with a document_id, a provision_ref and a
Legifrance URL. Anti-hallucination by mechanism, not by trust in the model.
Scope: consolidated LEGI codes and statutes (Code civil, Code du travail, Code penal, Code de commerce, Code de la defense, Code de la securite interieure, ...) - 3,953 documents / 193,681 provisions in the bundled snapshot. No case law (jurisprudence) and no full JORF.
Part of the MateMatic law-connector family: mcp-saos
(PL case law), mcp-eu-compliance
(EU law), mcp-eu-sparql (live EUR-Lex).
Installation
npm install # Node 22.5+ (node:sqlite built in, FTS5)
npm run fetch-corpus # downloads database.db (~303 MB) from the DILA/Ansvar artifact (Apache-2.0 + Etalab)
npm run build
npm startAir-gapped / fully offline: point FR_LEGAL_DB at a local copy of database.db.
MCP client configuration:
{ "name": "fr-legal", "command": "node", "args": ["/path/to/mcp-fr-legal/dist/index.js"] }Related MCP server: French Law MCP Server
Tools
Tool | Description |
| Full-text (FTS5) over provisions, verbatim snippets + citations. |
| Full verbatim text of a provision (tolerant |
| Grounding: whether the citation exists (fail-closed) - anti-hallucination. |
| List documents (discovery of |
Every tool returns structuredContent.citations (document_id, provision_ref, Legifrance URL,
source_authority DILA, license Etalab v2.0, snapshot, age_days, and a staleness_advisory
when the snapshot is older than the FR_STALENESS_DAYS threshold (365 by default) - provenance and
staleness modelled on russellbrenner/jurisd, Apache-2.0).
Grounding (anti-hallucination)
fr_validate_citation is a grounding primitive: it mechanically checks whether document_id + provision_ref exists in the corpus. Fail-closed - a missing document or provision yields
provision_exists=false (not "probably ok"). It plugs into
citation-grounding-pl
as the anchor resolver for French law (EXISTENCE level).
Where data goes
No network calls at runtime (the database is opened read-only). Corpus bootstrap (fetch-corpus) is
the only moment a network is used. Text is returned verbatim (grounding). For currency, check
Legifrance (a snapshot is not the authoritative source - the Journal officiel is).
License and attribution
Code: MIT (MateMatic Solutions).
Corpus: the
database.dbartifact from Ansvar-Systems/French-law-mcp (Apache-2.0); the legal text is under the Licence Ouverte v2.0 (Etalab), DILA/Legifrance, commercial reuse with attribution. Full attribution: THIRD_PARTY_INSPIRATIONS.md.
Citation: MateMatic Solutions (2026), mcp-fr-legal - an offline MCP corpus of French law (Legifrance/DILA), MIT. Data: DILA, Licence Ouverte v2.0.
Available Tools
4 toolsfr_articleARead-onlyIdempotent
Pelny verbatim tekst przepisu (document_id + provision_ref, np. 'code-travail' + 'L1233-15'). provision_ref tolerancyjny ('Article L. 1233-15' == 'L1233-15'). Kody bledow: missing_arg, not_found, corpus_error.
Inputs: document_id (required), provision_ref (required).
fr_list_documentsARead-onlyIdempotent
Lista dostepnych dokumentow (kody/ustawy) - discovery document_id. Opcjonalnie filtr type (np. 'statute') i query (fraza w tytule). Kody bledow: corpus_error.
Inputs: type, limit, query.
fr_searchARead-onlyIdempotent
Pelnotekstowo (FTS5) po przepisach prawa francuskiego (kody + ustawy LEGI). Snippety verbatim z markerami [ ]. Opcjonalny filtr documents (lista document_id, np. ['code-travail']). Zwraca structuredContent.citations. Kody bledow: missing_arg, empty_query, corpus_error.
Inputs: query (required), limit, documents.
fr_validate_citationARead-onlyIdempotent
Grounding: czy cytat (document_id + provision_ref) ISTNIEJE w korpusie (anti-halucynacja). Fail-closed: brak dokumentu/przepisu => provision_exists=false. Zwraca document_exists, provision_exists, in_force + citation. Kody bledow: missing_arg, corpus_error.
Inputs: document_id (required), provision_ref (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: retrieving a specific article, listing available documents, full-text search, and citation validation. No overlap or ambiguity.
All tool names follow a consistent pattern with 'fr_' prefix and snake_case verbs/nouns (article, list_documents, search, validate_citation).
Four tools is well-scoped for a legal research server, covering essential operations without unnecessary complexity.
The set covers retrieval, listing, search, and validation—core operations for legal reference. No obvious missing functionality given the domain.
Maintenance
Related MCP Connectors
French case law (Judilibre) and codes (Légifrance) from official sources, with citation checking.
Resolve, search and verify legal citations against the official sources, with provenance.
Verified, citable German & EU law for any LLM. Daily updates from official sources, hosted in DE.
Verified, citable German & EU law for any LLM. Daily updates from official sources, hosted in DE.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to official French legal databases (Légifrance and JudiLibre) to search and retrieve French legislation, legal codes, case law, and judicial decisions through authenticated APIs.37MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying and retrieving legal texts and decisions from French public APIs Légifrance and JudiLibre for legal research.MIT
- AlicenseNot gradedqualityCmaintenanceProvides local, offline semantic search across 24 Russian Federation legal codes using natural-language queries, with tools to retrieve full articles by identifier and list available codes.BSD 2-Clause "Simplified"
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to look up Chinese laws and statutory articles fully offline from a local SQLite database, resolving a law name plus article number to verbatim text, searching articles by keyword, and retrieving a law's chapter structure and version history. It also verifies citations in bulk, checking whether each quoted provision exists word-for-word and is currently in force.6MIT