# Légifrance (unofficial)

> Légifrance (unofficial) is an open-source MCP server for legal and government. Search, read and cite French law through the Légifrance API, read-only. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Linux, macOS, Windows, CLI, Self-hosted
- **Repository:** https://github.com/muchiny/mcp-legifrance
- **MCP Registry name:** io.github.muchiny/mcp-legifrance
- **Categories:** [legal and government](https://ai-powered.com/categories/legal-and-government)
- **Listing updated:** 2026-11-23

## About

This Rust server queries official French law from Légifrance through the PISTE portal and returns text as Légifrance publishes it, with a citation and source address. It is explicitly unofficial and says it is not affiliated with or endorsed by DILA. Coverage includes laws and decrees, codes, case law from the Cour de cassation and appeal courts, constitutional, Conseil d'Etat and CNIL decisions, collective agreements and company agreements.

Its distinctive tools are about checking. fr_verify_citations checks every legal citation in a text of up to 20,000 characters, such as a draft answer, against Légifrance. fr_resolve turns a citation written out in words into official identifiers with a confidence level, and the README says nothing is guessed. Law can be read as it stood on a given date, and fr_diff_article compares two versions of an article.

Each user supplies their own free PISTE credentials, which the project does not provide, and the server talks to PISTE directly on your machine so no third party sees queries. An optional offline mode reads codes, laws and decrees from a local DILA index, which may lag Légifrance. Long texts return a summary first to save context, and the README notes that the binaries are unsigned. Prompts are in French.

## Features

- **Citation verification:** Checks all legal citations in a text against Légifrance.
- **Citation resolution:** Converts a written citation or ECLI into official identifiers with a confidence level.
- **Law at a date:** Reads a text or article as it stood on a given day.
- **Article version diff:** Compares an article between two dates, showing removed and added passages.
- **Multi-fund search:** Searches laws, codes, case law, collective agreements and more.
- **Progressive reading:** Long texts return a summary first, with offset-based full reading.
- **Offline index option:** Reads codes, laws and decrees from a local DILA copy without network.

## Good for

- Check the citations in a draft legal answer
- Look up an article of a French code as it applied on a past date
- See how an article changed between two versions
- Find case law that cites a particular article
- Read a collective agreement's structure

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mcp-legifrance --env LF_PISTE_CLIENT_ID='<LF_PISTE_CLIENT_ID>' --env LF_PISTE_CLIENT_SECRET='<LF_PISTE_CLIENT_SECRET>' -- docker run -i --rm -e LF_PISTE_CLIENT_ID -e LF_PISTE_CLIENT_SECRET ghcr.io/muchiny/mcp-legifrance:1.5.0
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp-legifrance --env LF_PISTE_CLIENT_ID='<LF_PISTE_CLIENT_ID>' --env LF_PISTE_CLIENT_SECRET='<LF_PISTE_CLIENT_SECRET>' -- docker run -i --rm -e LF_PISTE_CLIENT_ID -e LF_PISTE_CLIENT_SECRET ghcr.io/muchiny/mcp-legifrance:1.5.0
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp-legifrance]
command = "docker"
args = ["run", "-i", "--rm", "-e", "LF_PISTE_CLIENT_ID", "-e", "LF_PISTE_CLIENT_SECRET", "ghcr.io/muchiny/mcp-legifrance:1.5.0"]
env = { LF_PISTE_CLIENT_ID = "<LF_PISTE_CLIENT_ID>", LF_PISTE_CLIENT_SECRET = "<LF_PISTE_CLIENT_SECRET>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e LF_PISTE_CLIENT_ID='<LF_PISTE_CLIENT_ID>' -e LF_PISTE_CLIENT_SECRET='<LF_PISTE_CLIENT_SECRET>' mcp-legifrance docker -- run -i --rm -e LF_PISTE_CLIENT_ID -e LF_PISTE_CLIENT_SECRET ghcr.io/muchiny/mcp-legifrance:1.5.0

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-legifrance": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "LF_PISTE_CLIENT_ID",
        "-e",
        "LF_PISTE_CLIENT_SECRET",
        "ghcr.io/muchiny/mcp-legifrance:1.5.0"
      ],
      "env": {
        "LF_PISTE_CLIENT_ID": "<LF_PISTE_CLIENT_ID>",
        "LF_PISTE_CLIENT_SECRET": "<LF_PISTE_CLIENT_SECRET>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 9 of 13 tools read data; 4 names don't say. From the server's own tool labels and tool names; not verified by us.

- `fr_search` (name suggests: reads): Keyword search in one fund such as laws, codes or case law.
- `fr_get_act` (name suggests: reads): Returns the table of contents of a text at a given date.
- `fr_get_text` (name suggests: reads): Returns the text of an article with progressive reading.
- `fr_get_decision` (name suggests: reads): Returns a court decision.
- `fr_get_deliberation` (name suggests: reads): Returns a CNIL deliberation.
- `fr_get_convention` (name suggests: reads): Returns a collective agreement's metadata and contents.
- `fr_get_company_agreement` (name suggests: reads): Returns company agreement metadata.
- `fr_coverage`: Reports what the server covers and its configuration state.
- `fr_resolve`: Turns a written citation into official identifiers.
- `fr_verify_citations`: Verifies all legal citations in a text.
- `fr_get_related` (name suggests: reads): Lists legal links of an article or decision.
- `fr_diff_article`: Compares an article between two dates.
- `fr_search_all` (name suggests: reads): Searches several funds at once.

## FAQ

### Do I need credentials?

Yes, your own PISTE application credentials, free after accepting the API terms. The project provides none, and sandbox credentials do not work in production.

### Is Légifrance (unofficial) official?

No. It is an unofficial project, not affiliated with DILA.

### Can Légifrance (unofficial) modify anything?

No. All thirteen tools are read-only.

### Does Légifrance (unofficial) work offline?

Optionally, for codes, laws and decrees from a local DILA index. The snapshot can lag Légifrance and never proves a text does not exist.

### Are the binaries signed?

No. SHA-256 sums and GitHub provenance attestations are provided to check downloads.

### Is Légifrance (unofficial) free?

Yes. Légifrance (unofficial) is open source, so you can use and self-host it for free.

### How do I add Légifrance (unofficial) to Claude Code?

Run this command in your terminal: claude mcp add mcp-legifrance --env LF_PISTE_CLIENT_ID='<LF_PISTE_CLIENT_ID>' --env LF_PISTE_CLIENT_SECRET='<LF_PISTE_CLIENT_SECRET>' -- docker run -i --rm -e LF_PISTE_CLIENT_ID -e LF_PISTE_CLIENT_SECRET ghcr.io/muchiny/mcp-legifrance:1.5.0

### What are the best alternatives to Légifrance (unofficial)?

The closest alternatives to Légifrance (unofficial) are China Law MCP, x402 Micropayments MCP, Swiss Housing MCP, Lie Detector Test and Norman: Start a company.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [China Law MCP](https://ai-powered.com/mcp/china-law-mcp): China Law MCP is an open-source MCP server for legal and government.
- [x402 Micropayments MCP](https://ai-powered.com/mcp/x402-micropayments-mcp): x402 Micropayments MCP is a paid MCP server for finance and payments.
- [Swiss Housing MCP](https://ai-powered.com/mcp/swiss-housing-mcp): Swiss Housing MCP is an open-source MCP server for legal and government.
- [Lie Detector Test](https://ai-powered.com/mcp/lie-detector-test): Lie Detector Test is an MCP server for legal and government.
- [Norman: Start a company](https://ai-powered.com/mcp/norman-start-a-company): Norman: Start a company is an MCP server for legal and government.
- [Belgian Legal Lexicon Nl Fr](https://ai-powered.com/mcp/belgian-legal-lexicon-nl-fr): Belgian Legal Lexicon Nl Fr is a free MCP server for legal and government.
- [AllVisas](https://ai-powered.com/mcp/allvisas): AllVisas is an MCP server for relocation data.
- [TurkActuary](https://ai-powered.com/mcp/turkactuary): TurkActuary is an open-source MCP server for legal and government.

---
Source: https://ai-powered.com/mcp/legifrance-unofficial
