Get the FREE Ultimate OpenClaw Setup Guide →

mcp -legifrance

Legifrance MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio pylegifrance-mcp-server-legifrance <PATH_TO_VENV>/bin/python <PATH_TO_REPO>/src/server.py \
  --env DASSIGNIES_API_KEY="your_legifrance_api_key" \
  --env DASSIGNIES_API_URL="https://lab.dassignies.law/api/"

How to use

This MCP server exposes French legal data through Legifrance via the MCP interface, allowing a compatible LLM (such as Claude) to perform targeted legal queries. The server implements three main tools: rechercher_dans_texte_legal for searching legal texts (laws, codes, decrees, ordinances) by text_id and keywords; rechercher_code for querying articles within French codes (e.g., Code civil) with flexible search fields; and rechercher_jurisprudence_judiciaire to search case law and jurisprudence with advanced filters. The configuration example shows how to register the legifrance MCP server with Claude Desktop, so the model can invoke these tools as structured actions. You can start Claude, enable the legifrance tool, and then issue natural-language prompts or structured requests that map to these tools to retrieve precise legal information in a context the model can reason about. The tools leverage the Legifrance API through the pylegifrance-based backend to fetch results and present structured outputs to the model.

How to install

Prerequisites:

  • Python 3.9+ installed on your system
  • A Legifrance API key (DASSIGNIES_API_KEY) and API URL (DASSIGNIES_API_URL)
  • Access to a compatible MCP-enabled environment (e.g., Claude Desktop) and a local setup to run the server

Install and run locally:

  1. Create a virtual environment and activate it
python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate
  1. Install the MCP server from GitHub via uv (or install dependencies as needed)
uv pip install git+https://github.com/rdassignies/mcp-server-legifrance.git
  1. Configure environment variables for API access (create a .env at project root or export variables)
export DASSIGNIES_API_KEY=your_clé_api
export DASSIGNIES_API_URL=https://lab.dassignies.law/api/
  1. Run the MCP server (example using the virtual environment Python interpreter as shown in the config)
# Ensure you’re in the project root and the virtualenv is activated
<PATH_TO_VENV>/bin/python <PATH_TO_REPO>/src/server.py
  1. Integrate with Claude Desktop or other MCP clients by adding the provided JSON snippet to the client’s configuration (see README for example).

Additional notes

Notes and tips:

  • Ensure your DASSIGNIES_API_KEY is valid and has access to Legifrance data; monitor for rate limits or API changes.
  • The environment variable DASSIGNIES_API_URL should point to the API endpoint you intend to query; adjust if you run a self-hosted or test instance.
  • The MCP configuration uses a Python interpreter inside a virtual environment; adjust the paths in the mcp_config section accordingly.
  • If you update the server code or dependencies, regenerate the virtual environment and re-activate it before running.
  • The example config assumes a local invocation via Claude Desktop; if you deploy in a container or different runtime, adapt the command and arguments accordingly.
  • The server currently exposes three tools; you can extend or customize the tool set by modifying the underlying Python server implementation and updating the MCP manifest used by your client.

Related MCP Servers

Sponsor this space

Reach thousands of developers