Skip to main content

Lex API MX — servidor MCP

Servidor Model Context Protocol que conecta Claude Desktop, Claude Code, Cursor o cualquier agente MCP con la legislación federal mexicana vigente de Lex API MX.

El servidor es un adaptador ligero y de código abierto (MIT): no contiene el corpus. Cada llamada consulta la API de Lex API MX con tu clave y devuelve el paquete normativo tal cual, con cita canónica, vigencia, fuente oficial y checksum SHA-256 del texto.

Herramientas

Herramienta Endpoint Para qué
resolve_legal_citation POST /api/v1/resolve Resolver una cita o situación a un paquete normativo verificable.
search_mexican_law GET /api/v1/articulos/search Buscar artículos vigentes por texto, norma o materia.
get_norm_structure GET /api/v1/normas/{slug}/estructura Recorrer el árbol de una norma; el texto completo (include_text) requiere un plan de la API.

Todas exigen fecha ("vigente" o YYYY-MM-DD). Las de búsqueda y resolución exigen además jurisdiccion; hoy la única cobertura es "federal".

Instalación

Requiere uv y una clave de Lex API MX. El plan gratuito incluye 500 créditos al mes: crea tu cuenta con tu correo y genera la clave en lexapi.mx/#cuenta.

{
  "mcpServers": {
    "lex-api-mx": {
      "command": "uvx",
      "args": ["lex-api-mx-mcp"],
      "env": { "LEX_API_MX_KEY": "tu_clave" }
    }
  }
}
  • Claude Desktop: Settings → Developer → Edit Config y pega el bloque anterior en claude_desktop_config.json; reinicia la aplicación.
  • Claude Code: claude mcp add lex-api-mx --env LEX_API_MX_KEY=tu_clave -- uvx lex-api-mx-mcp
  • Cursor: el mismo bloque en ~/.cursor/mcp.json (global) o .cursor/mcp.json (proyecto).

Pruébalo preguntando: ¿Cuáles son las causas de rescisión de la relación de trabajo sin responsabilidad para el patrón? Cita el artículo exacto.

Variables de entorno

Variable Obligatoria Valor por defecto
LEX_API_MX_KEY Sí —
LEX_API_MX_BASE_URL No https://api.lexapi.mx

Errores

Los errores de la API llegan al modelo como errores de herramienta legibles: clave inválida (401), permiso faltante (403), saldo agotado (402) y límite de peticiones (429).

Código fuente

github.com/Julio-Patron/lexapi-mx (licencia MIT). También está en el MCP Registry como io.github.Julio-Patron/lex-api-mx.

Metadata

Release files for lex-api-mx-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lex-api-mx-mcp 0.1.2
File Size Uploaded
lex_api_mx_mcp-0.1.2.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lex-api-mx-mcp 0.1.2
File Interpreter ABI Platform
lex_api_mx_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / lex_api_mx_mcp-0.1.2.tar.gz

Download URL lex_api_mx_mcp-0.1.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1cc07a9ea07e553679bcff0c8992994b5546e50dd78e8768d4a78db2c881b948
BLAKE2b-256 checksum
How to use checksums
2da4c3195ece3b933bc03709d0170a47bf16221b657b8a3456ad40c4c5fbcab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / lex_api_mx_mcp-0.1.2-py3-none-any.whl

Download URL lex_api_mx_mcp-0.1.2-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f18a180fff579b69372dce4c00e93c2c249982259e2953f643b9b71083b70f8c
BLAKE2b-256 checksum
How to use checksums
2d106304909f2c80969c2985647c7041b88c0e7809695600e8d4dc0b1900d586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page