home / mcp / droit francais mcp server
Serveur MCP pour des recherches directement sur Légifrance et Judilibre.
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.
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.
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 dependenciesSet 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_secretConfigure 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"]
}
}
}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
}
}
}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.
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.
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.
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.
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.
Run tests to validate Legifrance and JudiLibre integrations. Use the provided Python test scripts to verify API access and response handling.
MIT license applies to this project.
Perform advanced multi-criteria searches across all French legal fonds (codes, laws, JORF, jurisprudence, conventions collectives) with full-text results and metadata
Retrieve full text of a legal article or document with complete metadata
Search jurisprudence with filters by jurisdiction, chamber, theme, and dates and get full-text decisions with structured zones
Obtain the complete text of a decision with structured sections and metadata
Access lists of valid taxonomy values (jurisdictions, chambers, themes, etc.)