mcp -legifrance
Legifrance MCP Server
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:
- Create a virtual environment and activate it
python -m venv venv
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate
- 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
- 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/
- 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
- 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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP