Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_LEYES_CACHENoWhere the clone and the index live (one subdirectory per source). Defaults: `~/Library/Caches/mcp-leyes` (macOS), `$XDG_CACHE_HOME/mcp-leyes` or `~/.cache/mcp-leyes` (Linux), `%LOCALAPPDATA%\mcp-leyes` (Windows).
MCP_LEYES_SOURCENoGit URL or local path to clone from (a local clone or a fork). Default: `https://github.com/BEG-lag/leyes-mx.git`.
MCP_LEYES_WEB_URLNoBase of the GitHub links in answers. Default: derived from the source, else `https://github.com/BEG-lag/leyes-mx`.
MCP_LEYES_REFRESH_HOURSNoHours between fetches; `0` never fetches. Default: `24`.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Point-in-time access to the Mexican federal laws tracked by the leyes-mx git repository (the Constitution, federal codes and laws: 36 laws and 375 versions as of November 2026). Every version is a commit dated on its publication in the Diario Oficial de la Federación (DOF).

Typical flow: list_laws (abbreviations) -> get_article(law, article, date) for the exact text as it stood on a date -> article_history to see when it changed -> diff_article or diff_reform to see what a reform did -> transitorios for entry into force. search finds articles by words. reforms lists the reform decrees of a law.

Laws accept the abbreviation (LFT, CPEUM, LGSM) or slug (lft). Articles accept '27', '3o. Bis', '15-A', '353-Ñ', '29-A Bis'. Dates accept YYYY-MM-DD, DD-MM-YYYY or 'hoy'/'today'.

Always relay the caveats the tools print: the date of a version is its DOF publication, not its entry into force; history starts at the oldest archived copy; several reforms between two archived copies are grouped in one version. Cite the GitHub line link and the DOF date. Texts are the Cámara de Diputados' consolidated versions: unofficial, only the DOF is authoritative, and nothing here is legal advice.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_lawsA

List the federal laws available: abbreviation, name, last reform (DOF), number of articles, number of versions in git and the date of the oldest archived version.

get_articleA

Exact text of one article as it stood on a date, with the DOF date and commit of the version, the decree(s) that version reflects, since when the article has this wording, and a link to the exact lines on GitHub at that commit.

article_historyA

Every change to one article across the archived versions: when it was added, modified, repealed or removed, with the DOF date, commit and decree of each change. In versions that group several reforms, the Cámara's editorial note tells which decree touched it.

diff_articleA

What changed in one article between two dates, as a word-level or unified diff, plus the versions in between that touched it.

diff_reformA

What a reform changed in a law: every article modified, added or removed between the version before and the version that carries the reform, new transitorios and headings, and the diffs. When the archive groups several reforms in one version, articles whose editorial note cites this reform date are listed first.

searchA

Full-text search over the articles of every law (or one law) as they stood on a date, ranked by number of hits, with a snippet and a link to each article.

reformsA

Reform timeline of a law from the LeyesBiblio data in leyes-mx: number, DOF date, title and PDF of each decree, and which version in git carries it (own version, grouped with others, older than the archive, or not consolidated yet).

transitoriosA

Transitory articles (entry into force, deadlines, repeals) of the original text of a law or of one reform decree, as kept at the end of the consolidated text.

Prompts

Interactive templates invoked by user choice

NameDescription
explain_reformExplain what a reform changed in a law, article by article, with entry into force.
trace_articleTrace how one article evolved across every archived version, reform by reform.

Resources

Contextual data attached and managed by the client

NameDescription
catalog_resourceThe laws available, with abbreviation, slug, dates and number of versions.
status_resourceSync status: data source, cache directory, indexed commit, last fetch.

TDQS

A3.8/5.0

Scored across 8 tools

Disambiguation5/5

Each tool has a clearly distinct scope: law listing, single-article retrieval, per-article history, article-level diff, reform-level diff, full-text search, law-level reform timeline, and transitorios. Overlap between article_history and reforms is minimal because one operates per article and the other per law/reform. An agent should reliably choose the correct tool for each task.

Naming Consistency3/5

Some names use a clear verb_noun pattern (list_laws, get_article, diff_article, diff_reform), but others are bare nouns or single verbs (article_history, search, reforms, transitorios). The mixed conventions are still readable and understandable, but not predictable enough for a top score.

Tool Count5/5

Eight tools is well-scoped for a legal-archive research server, covering discovery, retrieval, history, diffs, search, reform tracking, and transitorios. Each tool appears to earn its place without excessive fragmentation.

Completeness4/5

The surface covers the core legal-research lifecycle: listing laws, retrieving articles by date, tracing changes, diffing articles or reforms, searching text, and inspecting reforms and transitorios. Minor gaps may exist around direct decree full-text retrieval or bulk/version listing, but the main workflows are well supported.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues