home / mcp / droit francais mcp server

Droit Francais MCP Server

Serveur MCP pour des recherches directement sur Légifrance et Judilibre.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jmtanguy-droit-francais-mcp": {
      "command": "/chemin/absolu/vers/Droit FrancaisMCP/.venv/bin/python3",
      "args": [
        "/chemin/absolu/vers/DroitFrancaisMCP/droit_francais_MCP.py"
      ],
      "env": {
        "PISTE_CLIENT_ID": "YOUR_PRODUCTION_CLIENT_ID",
        "PISTE_CLIENT_SECRET": "YOUR_PRODUCTION_CLIENT_SECRET",
        "PISTE_SANDBOX_CLIENT_ID": "YOUR_SANDBOX_CLIENT_ID",
        "PISTE_SANDBOX_CLIENT_SECRET": "YOUR_SANDBOX_CLIENT_SECRET"
      }
    }
  }
}

You have a Python-based MCP server that provides a unified interface to query French legal data sources through the Model Context Protocol (MCP). It lets you search and consult codes, laws, decrees, jurisprudence, and official publications from public APIs, enabling reliable access to French legal information in tools like Claude Desktop or Cursor.

How to use

Install and run the MCP server, then connect your MCP client (Claude Desktop or Cursor). The server exposes tools that let you search Legifrance and JudiLibre data sources, so you can retrieve articles from codes, laws, JORF items, and court decisions. Use natural language prompts to ask for specific legal texts, filtered results, or full decision texts. Your client will route requests to the appropriate tools and present the results in-context.

Typical workflows include searching for specific articles in a code, querying recent jurisprudence on a given topic, or pulling documents from JORF with date and keyword filters. Your MCP client will automatically select the right tool based on your request and show the structured results along with relevant metadata.

How to install

Prerequisites you need to have before installing: Python 3.8 or newer, pip for package management, Git to clone the repository, and an MCP client such as Claude Desktop or Cursor to connect to the server.

Step-by-step commands you should run in your terminal:

git clone https://github.com/jmtanguy/DroitFrancaisMCP.git
cd DroitFrancaisMCP

# Windows
# Run the Windows installer script
# install.ps1

# macOS / Linux
# Run the installation script for your OS
# install.sh

# Follow prompts to create a virtual environment and install dependencies

Configuration

Set up environment variables and client IDs before starting the server. You will create an environment file from a template and fill in your PISTE API credentials.

# Copy the example environment file
cp .env.example .env

# Edit the file and insert your PISTE credentials
# Production credentials
PISTE_CLIENT_ID=your_production_client_id
PISTE_CLIENT_SECRET=your_production_client_secret

# Optional Sandbox credentials for testing
PISTE_SANDBOX_CLIENT_ID=your_sandbox_client_id
PISTE_SANDBOX_CLIENT_SECRET=your_sandbox_client_secret

Claude Desktop configuration

Configure Claude Desktop to run the MCP server from your local path.

{ 
  "mcpServers": {
    "droit-francais": {
      "command": "/chemin/absolu/vers/DroitFrancaisMCP/.venv/bin/python3",
      "args": ["/chemin/absolu/vers/DroitFrancaisMCP/droit_francais_MCP.py"]
    }
  }
}

Cursor configuration

Add a Cursor MCP server entry pointing to your local MCP installation.

{
  "mcpServers": {
    "DroitFrancaisMCP": {
      "command": "<PATH_TO_DroitFrancaisMCP>/.venv/bin/python3",
      "args": [
        "-u",
        "<PATH_TO_DroitFrancaisMCP>/droit_francais_MCP.py"
      ],
      "cwd": "<PATH_TO_DroitFrancaisMCP>",
      "env": {
        "PYTHONPATH": "<PATH_TO_DroitFrancaisMCP>",
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8"
      },
      "envFile": "<PATH_TO_ENV_FILE>",
      "description": "MCP server for French legal research (Légifrance, JudiLibre)",
      "enabled": true
    }
  }
}

Usage notes

After configuring, restart the MCP client you use (Claude Desktop or Cursor). The server will appear in the list of MCP servers, and you can start sending queries that leverage Legifrance and JudiLibre data sources.

Examples of usage

Ask Claude or Cursor to retrieve code articles, jurisprudence, or JORF publications. For example, request full-text articles from a specific code, or pull the latest court decisions on a topic, and filter by date or jurisdiction.

Ongoing notes

Keep your .env file secure; never commit it to version control. When using Sandbox credentials for testing, ensure they are scoped for non-production use.

Tools available

The MCP server exposes specialized tools to search and retrieve legal texts. Use these tools through your MCP client to perform Legifrance searches and JudiLibre jurisprudence lookups with rich metadata and full-text access.

Architecture

The server components include a Python-based MCP server, an Legifrance API client, and a JudiLibre API client. The architecture supports OAuth 2.0 authentication, automatic token handling, request validation, and structured error logging.

Tests

Run tests to validate Legifrance and JudiLibre integrations. Use the provided Python test scripts to verify API access and response handling.

License

MIT license applies to this project.

Available tools

legifrance_search

Perform advanced multi-criteria searches across all French legal fonds (codes, laws, JORF, jurisprudence, conventions collectives) with full-text results and metadata

legifrance_consult

Retrieve full text of a legal article or document with complete metadata

judilibre_search

Search jurisprudence with filters by jurisdiction, chamber, theme, and dates and get full-text decisions with structured zones

judilibre_consult

Obtain the complete text of a decision with structured sections and metadata

judilibre_taxonomy

Access lists of valid taxonomy values (jurisdictions, chambers, themes, etc.)