# Leyes MX: Mexican federal law at any date

> Leyes MX: Mexican federal law at any date is an open-source MCP server for legal and government. MCP server giving AI clients point-in-time access to Mexican federal law texts and reforms. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, macOS, Windows
- **Repository:** https://github.com/beg-lag/mcp-leyes
- **MCP Registry name:** io.github.BEG-lag/mcp-leyes
- **Categories:** [legal and government](https://ai-powered.com/categories/legal-and-government)
- **Listing updated:** 2026-11-18

## About

The README describes this as a way for Claude and other agents to look up Mexican federal statutes as they read on a chosen date, rather than relying on memory. It reads the public leyes-mx repository, where 36 federal laws are stored as Markdown and each archived version is a git commit dated to its Diario Oficial de la Federación publication.

The server exposes tools for fetching an article as of a date, tracing an article's history, diffing article text or whole reforms word by word, full-text searching laws on a given day, and listing reform decrees and transitory provisions. Results cite the DOF date, the decree and a GitHub link to the exact lines, and flag where the archive cannot be certain.

It suits lawyers, compliance staff and developers building legal tools who need to know what a provision said at a specific time. The README states it is unofficial, that only the DOF is authoritative, and that it is not legal advice.

## Features

- **Article text by date:** Returns the text of an article as it stood on a given date, with the version date and source commit.
- **Reform history and diffs:** Lists every version that changed an article and shows word-level or unified diffs between dates.
- **Point-in-time search:** Runs accent-insensitive full-text search over the laws as they read on a chosen day.
- **Reform decree tracking:** Lists reform decrees of a law and the archived version that carries each one.
- **Transitory provisions lookup:** Returns transitory articles of the original text or of a specific decree.
- **Caveat reporting:** Warns when a version groups several reforms, when text predates the archive, or when a reform is not yet consolidated.

## Good for

- Checking what an article of a federal law said on a past date
- Reviewing what a specific reform changed, article by article
- Finding when a legal term or phrase first appeared in federal law
- Tracing the entry-into-force terms set by a reform's transitory articles
- Giving an AI assistant verified historical law text instead of recalled text

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-leyes -- docker run -i --rm ghcr.io/beg-lag/mcp-leyes:1.0.0
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-leyes": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/beg-lag/mcp-leyes:1.0.0"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "mcp-leyes": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/beg-lag/mcp-leyes:1.0.0"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-leyes": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/beg-lag/mcp-leyes:1.0.0"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-leyes": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/beg-lag/mcp-leyes:1.0.0"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "mcp-leyes": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/beg-lag/mcp-leyes:1.0.0"
      ]
    }
  }
}
```

## Tools

- `list_laws`: Catalog of laws with last reform, articles, versions and oldest archived version.
- `get_article`: Exact text of an article as it stood on a date, with version, decrees and caveats.
- `article_history`: Every version that added, changed, repealed or dropped an article, with its decree.
- `diff_article`: Changes to an article between two dates as a word or unified diff.
- `diff_reform`: Articles modified, added and removed by a reform, with diffs, paginated.
- `search`: Full-text search over laws as they read on a date.
- `reforms`: Reform decrees of a law and the version in git carrying each one.
- `transitorios`: Transitory articles of the original text or of one decree.

## FAQ

### Does it need an internet connection?

The README says the first start clones leyes-mx and builds an index, and after that it works offline. The Docker image includes a snapshot so it can run with networking disabled.

### Is the content official?

No. The README says it is unofficial, only the DOF is authoritative, and it is not legal advice.

### Which laws are covered?

The README states coverage is 36 federal laws and codes from leyes-mx, with history only where the Internet Archive kept copies. It does not include regulations, NOMs, state law or case law.

### What do I need to run it?

The README says you need git installed, and uv if running through uvx. It can also run from a Docker image published to GitHub Container Registry.

### Is Leyes MX: Mexican federal law at any date free?

Yes. Leyes MX: Mexican federal law at any date is open source, so you can use and self-host it for free.

### How do I add Leyes MX: Mexican federal law at any date to Claude Code?

Run this command in your terminal: claude mcp add mcp-leyes -- docker run -i --rm ghcr.io/beg-lag/mcp-leyes:1.0.0

### What are the best alternatives to Leyes MX: Mexican federal law at any date?

The closest alternatives to Leyes MX: Mexican federal law at any date are DOF: Diario Oficial de la Federación, Lex API MX, Global law, JurisNet: Latin American legal data and nu:legal Deutsches Recht.

## Where this comes from

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

## Alternatives

- [DOF: Diario Oficial de la Federación](https://ai-powered.com/mcp/dof-diario-oficial-de-la-federacion): DOF: Diario Oficial de la Federación is an open-source MCP server for legal and government.
- [Lex API MX](https://ai-powered.com/mcp/lex-api-mx): Lex API MX is a free MCP server for legal and government.
- [Global law](https://ai-powered.com/mcp/global-law): Global law is an open-source MCP server for legal and government.
- [JurisNet: Latin American legal data](https://ai-powered.com/mcp/jurisnet-latin-american-legal-data): JurisNet: Latin American legal data is an MCP server for legal and government.
- [nu:legal Deutsches Recht](https://ai-powered.com/mcp/nu-legal-deutsches-recht): nu:legal Deutsches Recht is a free MCP server for legal and government.
- [Biblioteca abierta de Cumplida](https://ai-powered.com/mcp/biblioteca-abierta-de-cumplida): Biblioteca abierta de Cumplida is a free MCP server for legal and government.
- [japanlaw.org — Japanese law](https://ai-powered.com/mcp/japanlaw-org-japanese-law): japanlaw.org — Japanese law is a free MCP server for legal and government.
- [Pelnora: Polish law and court rulings](https://ai-powered.com/mcp/pelnora-polish-law-and-court-rulings): Pelnora: Polish law and court rulings is a free MCP server for legal and government.

---
Source: https://ai-powered.com/mcp/leyes-mx-mexican-federal-law-at-any-date
