Legifrance MCP Server

Serveur MCP [Model Context Protocol](https://modelcontextprotocol.io/introduction) expérimental permettant d'interroger les bases juridiques

Local serverstdioPython

What is the Legifrance MCP server?

Most developer tooling work still happens through a UI a human drives. Legifrance MCP server moves it into the conversation instead. Serveur MCP Model Context Protocol expérimental permettant d'interroger les bases juridiques françaises via l'API Legifrance dans des LLMs compatibles comme Claude.

The short version

Ce projet implémente un serveur MCP qui permet d'accéder aux ressources juridiques françaises (textes légaux, codes, jurisprudence) directement depuis un Large Language Model. Il facilite les recherches juridiques en rendant les données de Legifrance accessibles via des outils interactifs.

Getting it running

git on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

The tools it exposes

The server publishes 12 tools. What each one is for:

  • text_id — Identifiant du texte (ex: "78-17" pour la loi informatique et libertés)
  • search — Mots-clés ou numéro d'article
  • champ — Zone de recherche ("ALL", "TITLE", "TABLE", "NUM_ARTICLE", "ARTICLE")
  • type_recherche — Mode de recherche ("TOUS_LES_MOTS_DANS_UN_CHAMP", "EXPRESSION_EXACTE", "AU_MOINS_UN_MOT")
  • page_size — Nombre de résultats (max 100)
  • code_name — Nom du code (ex: "Code civil", "Code du travail")
  • sort — Tri des résultats
  • fetch_all — Si tous les résultats doivent être récupérés
  • publication_bulletin — Si publiée au bulletin ["T"] ou non ["F"]
  • juri_keys — Champs de réponse à extraire
  • juridiction_judiciaire — Liste des juridictions
  • agent_juridique_expert — Crée un agent juridique expert qui: - Cite systématiquement ses sources - Utilise les outils pertinents pour rechercher des informations - Fournit

What it needs from you

Configuration is passed through the environment: DASSIGNIES_API_KEY, DASSIGNIES_API_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 12 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Legifrance.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Legifrance's toolset — text_id, search, champ and 9 more — is a fair guide to whether it matches your workflow. It is maintained by rdassignies; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

ToolWhat it does
text_idIdentifiant du texte (ex: "78-17" pour la loi informatique et libertés)
searchMots-clés ou numéro d'article
champZone de recherche ("ALL", "TITLE", "TABLE", "NUM_ARTICLE", "ARTICLE")
type_rechercheMode de recherche ("TOUS_LES_MOTS_DANS_UN_CHAMP", "EXPRESSION_EXACTE", "AU_MOINS_UN_MOT")
page_sizeNombre de résultats (max 100)
code_nameNom du code (ex: "Code civil", "Code du travail")
sortTri des résultats
fetch_allSi tous les résultats doivent être récupérés
publication_bulletinSi publiée au bulletin ["T"] ou non ["F"]
juri_keysChamps de réponse à extraire
juridiction_judiciaireListe des juridictions
agent_juridique_expertCrée un agent juridique expert qui: - Cite systématiquement ses sources - Utilise les outils pertinents pour rechercher des informations - Fournit des analyses étape par étape - Inclut les liens officiels vers les textes

How to install the Legifrance MCP server

{
  "mcpServers": {
    "server-legifrance": {
      "command": "uvx",
      "args": ["git"],
      "env": {
        "DASSIGNIES_API_KEY": "your-value",
        "DASSIGNIES_API_URL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
DASSIGNIES_API_KEYCredential the server authenticates with.Yes
DASSIGNIES_API_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Legifrance to text id.
  • Use Legifrance to search.
  • Use Legifrance to champ.

Frequently asked questions

It connects Legifrance to MCP-compatible AI assistants such as Claude and Cursor, exposing 12 tools (text_id, search, champ, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Legifrance directly.