Leyes MX: Mexican federal law at any date
MCP server giving AI clients point-in-time access to Mexican federal law texts and reforms
- Pricing
- Open source
- Platforms
- CLI, API, Linux
- Runs
- Locally
- Version
- 1.0.0
- Listing updated
- today
Similar MCP servers
About 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. It runs locally on your machine and is started by your AI client.
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.
Install
Run in a terminal
claude mcp add mcp-leyes -- docker run -i --rm ghcr.io/beg-lag/mcp-leyes:1.0.0Add to claude_desktop_config.json
{
"mcpServers": {
"mcp-leyes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/beg-lag/mcp-leyes:1.0.0"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-leyes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/beg-lag/mcp-leyes:1.0.0"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-leyes": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/beg-lag/mcp-leyes:1.0.0"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-leyes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/beg-lag/mcp-leyes:1.0.0"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-leyes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/beg-lag/mcp-leyes:1.0.0"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
MCP_LEYES_REFRESH_HOURSHours between git fetches of leyes-mx (default 24; 0 never fetches and uses the snapshot in the image).
Tools this server provides (8)
Taken from the project documentation; the running server may differ.
- 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.
What it does
- 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
Pricing
Open source
Open source under MIT; law texts come from leyes-mx under its data license.
Leyes MX: Mexican federal law at any date 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.