Lex API MX
Current Mexican federal law with official source, SHA-256 checksum and validity dates
- Pricing
- Free
- Platforms
- API, CLI
- Runs
- Locally
- Version
- 0.4.2
- Listing updated
- 3 days ago
About Lex API MX
Lex API MX is a free MCP server for legal and government. It runs locally on your machine and is started by your AI client.
The server exposes a corpus of 300 federal Mexican norms, with 42,247 current articles, each stored with the URL of its official source, a SHA-256 hash of its text and a validity period. The site lists the Constitution, 9 codes, 201 laws and 89 regulations, drawn from sources such as the Cámara de Diputados and the DOF. That lets an agent cite an article and let a reader check it.
It is a light open-source adapter (MIT) that holds no corpus itself. Each call goes to the Lex API MX REST API with your key. Tools include resolve_legal_citation for queries like artículo 47 LFT, search_mexican_law, get_norm_structure, map_legal_topic, get_legal_article, list_legal_norms, get_legal_norm, get_legal_article_history and get_corpus_status. Text reads require a date, either vigente or YYYY-MM-DD, and jurisdiction is federal only for now.
It runs locally through uvx from PyPI and needs a free API key from a confirmed email account. Errors come back with the action to take, and a rate-limit wait of 30 seconds or less is retried up to twice.
Install
Run in a terminal
claude mcp add lex-api-mx --env LEX_API_MX_KEY='<LEX_API_MX_KEY>' -- uvx lex-api-mx-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"lex-api-mx": {
"command": "uvx",
"args": [
"lex-api-mx-mcp"
],
"env": {
"LEX_API_MX_KEY": "<LEX_API_MX_KEY>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"lex-api-mx": {
"command": "uvx",
"args": [
"lex-api-mx-mcp"
],
"env": {
"LEX_API_MX_KEY": "<LEX_API_MX_KEY>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"lex-api-mx": {
"type": "stdio",
"command": "uvx",
"args": [
"lex-api-mx-mcp"
],
"env": {
"LEX_API_MX_KEY": "<LEX_API_MX_KEY>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"lex-api-mx": {
"command": "uvx",
"args": [
"lex-api-mx-mcp"
],
"env": {
"LEX_API_MX_KEY": "<LEX_API_MX_KEY>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"lex-api-mx": {
"command": "uvx",
"args": [
"lex-api-mx-mcp"
],
"env": {
"LEX_API_MX_KEY": "<LEX_API_MX_KEY>"
}
}
}
}Configuration
LEX_API_MX_KEYClave de API; créala gratis en https://lexapi.mx/cuentaRequiredLEX_API_MX_BASE_URLSolo para desarrollo local; por defecto https://api.lexapi.mx
Tools this server provides (9)
Taken from the project documentation; the running server may differ.
- resolve_legal_citation
- Resolve a citation or situation to a verifiable legal package
- search_mexican_law
- Search current articles by text, norm or subject
- get_norm_structure
- Index of a norm's divisions and article numbers
- map_legal_topic
- Citations for a limited catalogue of topics
- get_legal_article
- Full article by UUID with source and validity
- list_legal_norms
- Paged catalogue of norms and slugs
- get_legal_norm
- Current metadata of a norm
- get_legal_article_history
- Preserved versions of an article
- get_corpus_status
- Public status of the corpus
What it does
- Citation resolver
- Turn a citation like artículo 47 LFT into the full article.
- Verifiable text
- Every article carries its official source URL and SHA-256 checksum.
- Validity dates
- Reads take a date so you get the text in force at that time.
- Norm structure index
- A compact index of books, titles and chapters, about 15 KB for the labour law.
- Article history
- Retrieve preserved versions with source and validity.
- Same account as REST
- MCP and API share permissions and usage limits.
Good for
- Cite the exact article on grounds for dismissal in the labour law
- Search federal law on a topic across 300 norms
- Check an article's text against its checksum
- See how an article changed over time
Pricing
Free
Free with an account and usage limits
Prices change. Check lexapi.mx before you buy.
Lex API MX FAQ
Is it free?
Yes. API and MCP are free by account and share usage limits.
What does it need?
uv and an API key created on lexapi.mx after confirming your email.
Which jurisdictions are covered?
Federal only for now.
How big is the corpus?
300 norms and 42,247 current articles.
Is Lex API MX free?
Yes. Lex API MX is free to use.
How do I add Lex API MX to Claude Code?
Run this command in your terminal: claude mcp add lex-api-mx --env LEX_API_MX_KEY='<LEX_API_MX_KEY>' -- uvx lex-api-mx-mcp
What are the best alternatives to Lex API MX?
The closest alternatives to Lex API MX are NY LLC Publication (FileMyPublication), TribuJus, SupplyClub Catalog, SynomosAI Governance MCP and MedXpert 标准检索连接器.
Alternatives to Lex API MX

NY LLC Publication (FileMyPublication)
MCP serverNew York LLC publication rules, deadline, county prices, clerks and notice text
- 8 tools
- Remote
- Free
- Legal and government
TribuJus
MCP serverRead-only access to UK bank accounts, cards and transactions via TrueLayer Open Banking
Not checked yet- 5 tools
- Remote
- Open source
- Legal and government

SupplyClub Catalog
MCP serverRussian statutes, Supreme Court guidance and court practice for AI assistants
- 3 tools
- Remote
- Free
- Legal and government
SynomosAI Governance MCP
MCP serverSelf-assess AI agent governance: A3 scorecard, ISO 42001 evidence and PII scan
Runs locally- 6 tools
- Open source
- Security
MedXpert 标准检索连接器
MCP serverRead-only local index of medical-device standards with official links, no standard text
Runs locally- 4 tools
- Free
- Legal and government

SigPen
MCP serverMCP server that drafts e-signature documents while you approve every send
Not checked yet- 13 tools
- Remote
- Freemium
- Files and documents