Sign In

@ansvar/mexican-law-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ansvar/mexican-law-mcp

Mexican federal law database covering data protection (LFPDPPP), fintech, cybercrime, commercial law, and consumer protection with Spanish full-text search

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
78
27.87%
Maintainers
1
Weekly downloads
 
Created
Source

Mexican Law MCP Server

The Camara de Diputados alternative for the AI age.

npm version MCP Registry License GitHub stars CI Daily Data Check Database Provisions

Query 185 Mexican federal statutes -- from the Constitucion and LFPDPPP to the Ley Fintech, Codigo Penal Federal, and more -- directly from Claude, Cursor, or any MCP-compatible client.

If you're building legal tech, compliance tools, or doing Mexican legal research, this is your verified reference database.

Built by Ansvar Systems -- Stockholm, Sweden

Why This Exists

Mexican legal research is scattered across diputados.gob.mx, the Diario Oficial de la Federacion, ordenjuridico.gob.mx, and dozens of state-level sites. Whether you're:

  • A lawyer validating citations in a contract or brief
  • A compliance officer checking data protection requirements (LFPDPPP, LGPDPPSO)
  • A legal tech developer building tools on Mexican law
  • A fintech company navigating Ley Fintech requirements
  • A researcher tracing legislative reforms

...you shouldn't need 47 browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.

This MCP server makes Mexican law searchable, cross-referenceable, and AI-readable.

Quick Start

Use Remotely (No Install Needed)

Connect directly to the hosted version -- zero dependencies, nothing to install.

Endpoint: https://mexican-law-mcp.vercel.app/mcp

ClientHow to Connect
Claude.aiSettings > Connectors > Add Integration > paste URL
Claude Codeclaude mcp add mexican-law --transport http https://mexican-law-mcp.vercel.app/mcp
Claude DesktopAdd to config (see below)
GitHub CopilotAdd to VS Code settings (see below)

Claude Desktop -- add to claude_desktop_config.json:

{
  "mcpServers": {
    "mexican-law": {
      "type": "url",
      "url": "https://mexican-law-mcp.vercel.app/mcp"
    }
  }
}

GitHub Copilot -- add to VS Code settings.json:

{
  "github.copilot.chat.mcp.servers": {
    "mexican-law": {
      "type": "http",
      "url": "https://mexican-law-mcp.vercel.app/mcp"
    }
  }
}

Use Locally (npm)

npx @ansvar/mexican-law-mcp

Claude Desktop -- add to claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "mexican-law": {
      "command": "npx",
      "args": ["-y", "@ansvar/mexican-law-mcp"]
    }
  }
}

Cursor / VS Code:

{
  "mcp.servers": {
    "mexican-law": {
      "command": "npx",
      "args": ["-y", "@ansvar/mexican-law-mcp"]
    }
  }
}

Example Queries

Once connected, just ask naturally:

  • "What does Article 1 of the LFPDPPP say about data protection scope?"
  • "Find provisions about datos personales in Mexican law"
  • "What are the cybercrime provisions in the Codigo Penal Federal?"
  • "What does the Ley Fintech say about virtual assets?"
  • "List all Mexican federal laws related to consumer protection"
  • "What are the ARCO rights under Mexican data protection law?"
  • "Find provisions about firma electronica in the e-signature law"
  • "What does Article 6 of the Constitution say about the right to information?"

What's Included

CategoryCountDetails
Constitution1Constitucion Politica de los Estados Unidos Mexicanos
Federal Codes9Civil, Commercial, Criminal, Tax, Procedure, Military Justice
Federal Laws116Data protection, fintech, telecom, labor, competition, etc.
General Laws43Health, education, environment, transparency, anti-corruption
Organic Laws9Judiciary, Congress, Public Administration, Attorney General
Regulatory Laws6Agrarian, mining, nuclear energy, professional practice
Other1Statutes
Total Statutes185Comprehensive Mexican federal legislation
Provisions583Full-text searchable with FTS5 (unicode61 for Spanish)
Definitions56Legal term definitions extracted from statutes
Database Size~0.7 MBOptimized SQLite, portable

Verified data only -- every citation is validated against official sources (diputados.gob.mx). Zero LLM-generated content.

Key Law Categories

Data Protection and Privacy

  • LFPDPPP -- Federal Law on Protection of Personal Data Held by Private Parties (2010)
  • LGPDPPSO -- General Law on Protection of Personal Data Held by Public Bodies (2017)

Financial Technology and Banking

  • Ley Fintech -- Law to Regulate Financial Technology Institutions (2018)
  • LIC -- Credit Institutions Law
  • LMV -- Securities Market Law
  • Ley Banxico -- Bank of Mexico Law

Cybercrime and Digital

  • Codigo Penal Federal -- Federal Criminal Code (Articles 211 bis 1-7: cybercrime)
  • Ley de Firma Electronica -- Advanced Electronic Signature Law (2012)
  • Codigo de Comercio -- Commercial Code (e-commerce provisions)

Consumer Protection and Competition

  • LFPC -- Federal Consumer Protection Law
  • LFCE -- Federal Economic Competition Law

Corporate and Commercial

  • LGSM -- General Law on Commercial Companies
  • Ley de Concursos -- Commercial Insolvency Law

Anti-Money Laundering

  • Ley Antilavado -- Federal Anti-Money Laundering Law

Transparency and Access to Information

  • LFTAIP -- Federal Transparency and Access to Public Information Law
  • LGTAIP -- General Transparency and Access to Public Information Law

Available Tools (8)

ToolDescription
search_legislationFTS5 search on 583 provisions with BM25 ranking
get_provisionRetrieve specific provision by law + article number
list_lawsList all 185 statutes with metadata
get_preparatory_worksGet linked reform history for a statute
validate_citationValidate citation against database (zero-hallucination check)
build_legal_stanceAggregate citations from multiple statutes
format_citationFormat citations per Mexican conventions (DOF reference)
check_currencyCheck if statute is in force, amended, or repealed

Data Sources and Freshness

All content is sourced from authoritative Mexican legal databases:

Automated Freshness Checks (Daily)

A daily GitHub Actions workflow monitors data sources for reforms published in the Diario Oficial de la Federacion.

Security

This project uses multiple layers of automated security scanning:

ScannerWhat It DoesSchedule
CodeQLStatic analysis for security vulnerabilitiesWeekly + PRs
SemgrepSAST scanning (OWASP top 10, secrets, TypeScript)Every push
GitleaksSecret detection across git historyEvery push
TrivyCVE scanning on filesystem and npm dependenciesDaily
Socket.devSupply chain attack detectionPRs
DependabotAutomated dependency updatesWeekly

See SECURITY.md for the full policy and vulnerability reporting.

Important Disclaimers

THIS TOOL IS NOT LEGAL ADVICE

Statute text is sourced from official Camara de Diputados publications. However:

  • This is a research tool, not a substitute for professional legal counsel
  • Verify critical citations against primary sources (DOF, diputados.gob.mx) for court filings
  • Mexican law is complex -- federal vs. state jurisdiction matters
  • Reforms may have transitional provisions not fully captured

Before using professionally, read: DISCLAIMER.md | PRIVACY.md

Client Confidentiality

Queries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See PRIVACY.md for guidance.

Development

Setup

git clone https://github.com/Ansvar-Systems/mexican-law-mcp
cd mexican-law-mcp
npm install
npm run build
npm test

Running Locally

npm run dev                                       # Start MCP server
npx @anthropic/mcp-inspector node dist/index.js   # Test with MCP Inspector

Data Management

npm run census                             # Enumerate all federal laws
npm run ingest                             # Full corpus ingestion from census
npm run ingest -- --resume                 # Resume interrupted ingestion
npm run ingest -- --limit 5                # Test with 5 laws
npm run ingest -- --skip-fetch             # Reuse cached HTML
npm run build:db                           # Rebuild SQLite database
npm run check-updates                      # Check for amendments

Census-First Workflow

census.ts -> data/census.json (185 laws)
    |
ingest.ts -> data/seed/*.json (per-law provision JSON)
    |
build-db.ts -> data/database.db (SQLite + FTS5)

Performance

  • Search Speed: <100ms for most FTS5 queries
  • Database Size: ~0.7 MB (efficient, portable)
  • FTS5 Tokenizer: unicode61 (optimized for Spanish accented text)

This server is part of Ansvar's Compliance Suite -- MCP servers that work together for end-to-end compliance coverage:

@ansvar/eu-regulations-mcp

Query 49 EU regulations directly from Claude -- GDPR, AI Act, DORA, NIS2, MiFID II, eIDAS, and more. npx @ansvar/eu-regulations-mcp

@ansvar/us-regulations-mcp

Query US federal and state compliance laws -- HIPAA, CCPA, SOX, GLBA, FERPA, and more. npx @ansvar/us-regulations-mcp

@ansvar/swedish-law-mcp

Query 2,415 Swedish statutes directly from Claude -- with EU cross-references. npx @ansvar/swedish-law-mcp

@ansvar/canadian-law-mcp

Query Canadian federal legislation -- consolidated Acts from Justice Laws Website. npx @ansvar/canadian-law-mcp

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Priority areas:

  • Full corpus re-ingestion when diputados.gob.mx is accessible
  • State-level legislation coverage
  • Reglamentos (federal regulations) ingestion
  • Jurisprudencia (judicial precedent) integration
  • English translations for key statutes

Roadmap

  • Census-first architecture -- 185 federal laws enumerated
  • Core law ingestion -- LFPDPPP, Ley Fintech, Codigo Penal, and 7 more fully parsed
  • FTS5 with unicode61 -- Optimized for Spanish text search
  • Full corpus re-ingestion (pending diputados.gob.mx availability)
  • Reglamentos coverage (80+ federal regulations)
  • State-level legislation
  • Jurisprudencia (SCJN case law)
  • English translations for key statutes

Citation

If you use this MCP server in academic research:

@software{mexican_law_mcp_2026,
  author = {Ansvar Systems AB},
  title = {Mexican Law MCP Server: Federal Legislation Research Tool},
  year = {2026},
  url = {https://github.com/Ansvar-Systems/mexican-law-mcp},
  note = {185 Mexican federal statutes with Spanish full-text search}
}

License

Apache License 2.0. See LICENSE for details.

Data Licenses

  • Federal Legislation: Mexican Government (public domain under Article 14 of the Federal Copyright Law -- government works are not subject to copyright)
  • Source: Camara de Diputados, diputados.gob.mx/LeyesBiblio

About Ansvar Systems

We build AI-accelerated compliance and legal research tools. This MCP server makes Mexican federal law searchable, cross-referenceable, and AI-readable.

ansvar.eu -- Stockholm, Sweden

Built with care in Stockholm, Sweden

Keywords

mcp

FAQs

Package last updated on 26 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts