{"_id":"@ansvar/mexican-law-mcp","_rev":"3-8b7192e60b0cbd5ebb0051ec50250fee","name":"@ansvar/mexican-law-mcp","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.1":{"name":"@ansvar/mexican-law-mcp","version":"1.0.1","keywords":["mcp","model-context-protocol","mexican-law","lfpdppp","data-protection","fintech","cybercrime","inai","consumer-protection","legislation","legal","compliance","latin-america","ansvar"],"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","_id":"@ansvar/mexican-law-mcp@1.0.1","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"homepage":"https://ansvar.eu","bugs":{"url":"https://github.com/Ansvar-Systems/mexican-law-mcp/issues"},"bin":{"mexican-law-mcp":"dist/index.js"},"dist":{"shasum":"cf110823398ef714d6987a9b8ad884c74ce1da20","tarball":"https://registry.npmjs.org/@ansvar/mexican-law-mcp/-/mexican-law-mcp-1.0.1.tgz","fileCount":117,"integrity":"sha512-t/tBhp5dAFNMtn8R46llazg3TBYEwyNYalYFnagdkq6vOcFZR4a43sLFLz9dQ5TkNPZVCFrw1NO8pJ9Ka8T7MQ==","signatures":[{"sig":"MEQCIDVYuQpHZwpU2e78N/skLGZB082Vsx9eKnPBU/ia6huEAiByxRVrCPoyzhW1R3VDMolC7UTNwACs+Lj7Ue1Rni5/NA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ansvar%2fmexican-law-mcp@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":939456},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"gitHead":"435334a00d96ac6340413ba8d64ee23b11ccabbe","mcpName":"eu.ansvar/mexican-law-mcp","scripts":{"dev":"node --import tsx src/index.ts","lint":"tsc --noEmit","test":"vitest run","build":"tsc","start":"node dist/index.js","ingest":"node --import tsx scripts/ingest.ts","build:db":"node --import tsx scripts/build-db.ts","validate":"npm run lint && npm test && npm run test:contract","test:watch":"vitest","postinstall":"test -d dist || npm run build || true","drift:detect":"node --import tsx scripts/drift-detect.ts","test:contract":"vitest run __tests__/contract/","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"},"overrides":{"ajv":"^8.18.0","undici":"^7.0.0","path-to-regexp":"^8.0.0"},"repository":{"url":"git+https://github.com/Ansvar-Systems/mexican-law-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Mexican federal law database covering data protection (LFPDPPP), fintech, cybercrime, commercial law, and consumer protection with Spanish full-text search","directories":{},"_nodeVersion":"20.20.0","dependencies":{"@ansvar/mcp-sqlite":"^1.0.3","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.0.0","typescript":"^5.9.3","@types/node":"^22.15.29","@vercel/node":"^5.6.4","better-sqlite3":"^12.6.2","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/mexican-law-mcp_1.0.1_1771781996566_0.5145612532610571","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/mexican-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"},"2.0.0":{"name":"@ansvar/mexican-law-mcp","version":"2.0.0","keywords":["mcp","model-context-protocol","mexican-law","lfpdppp","data-protection","fintech","cybercrime","inai","consumer-protection","legislation","legal","compliance","latin-america","ansvar"],"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","_id":"@ansvar/mexican-law-mcp@2.0.0","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"homepage":"https://ansvar.eu","bugs":{"url":"https://github.com/Ansvar-Systems/mexican-law-mcp/issues"},"bin":{"mexican-law-mcp":"dist/index.js"},"dist":{"shasum":"f459b8c0184b053726581620d39befd304405bf4","tarball":"https://registry.npmjs.org/@ansvar/mexican-law-mcp/-/mexican-law-mcp-2.0.0.tgz","fileCount":125,"integrity":"sha512-sYtbLPjDlLEzLmNC+vDcr/S0zGYOX7k02XfnXFL15yqEAQH0t8yAFESKRfiDh27Pla7yBoW0GtiNeCelRgzVTQ==","signatures":[{"sig":"MEYCIQCw6fLBWQ8pHZItmQN09NKwNpimEioFwZhW5sDX5FcMvgIhAPYhehUnoSXWurUVMNzENchVJM/ISI/Xy5s6Z56c1+CH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ansvar%2fmexican-law-mcp@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1070745},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"gitHead":"23936cd1985e1b7fe77b0c943bcc11b33c843c63","mcpName":"eu.ansvar/mexican-law-mcp","scripts":{"dev":"node --import tsx src/index.ts","lint":"tsc --noEmit","test":"vitest run","build":"tsc","start":"node dist/index.js","census":"node --import tsx scripts/census.ts","ingest":"node --import tsx scripts/ingest.ts","build:db":"node --import tsx scripts/build-db.ts","validate":"npm run lint && npm test && npm run test:contract","test:watch":"vitest","postinstall":"test -d dist || npm run build || true","drift:detect":"node --import tsx scripts/drift-detect.ts","check-updates":"node --import tsx scripts/check-updates.ts","test:contract":"vitest run __tests__/contract/","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"},"overrides":{"ajv":"^8.18.0","undici":"^7.0.0","path-to-regexp":"^8.0.0"},"repository":{"url":"git+https://github.com/Ansvar-Systems/mexican-law-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Mexican federal law database covering data protection (LFPDPPP), fintech, cybercrime, commercial law, and consumer protection with Spanish full-text search","directories":{},"_nodeVersion":"20.20.0","dependencies":{"@ansvar/mcp-sqlite":"^1.0.3","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.0.0","typescript":"^5.9.3","@types/node":"^22.15.29","@vercel/node":"^5.6.4","better-sqlite3":"^12.6.2","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/mexican-law-mcp_2.0.0_1772104466628_0.935328521154515","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/mexican-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"}},"time":{"created":"2026-02-22T17:39:56.437Z","modified":"2026-05-02T05:47:49.196Z","1.0.1":"2026-02-22T17:39:56.745Z","2.0.0":"2026-02-26T11:14:26.872Z"},"bugs":{"url":"https://github.com/Ansvar-Systems/mexican-law-mcp/issues"},"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","homepage":"https://ansvar.eu","keywords":["mcp","model-context-protocol","mexican-law","lfpdppp","data-protection","fintech","cybercrime","inai","consumer-protection","legislation","legal","compliance","latin-america","ansvar"],"repository":{"url":"git+https://github.com/Ansvar-Systems/mexican-law-mcp.git","type":"git"},"description":"Mexican federal law database covering data protection (LFPDPPP), fintech, cybercrime, commercial law, and consumer protection with Spanish full-text search","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"readme":"# Mexican Law MCP Server\n\n**The Camara de Diputados alternative for the AI age.**\n\n[![npm version](https://badge.fury.io/js/@ansvar%2Fmexican-law-mcp.svg)](https://www.npmjs.com/package/@ansvar/mexican-law-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![GitHub stars](https://img.shields.io/github/stars/Ansvar-Systems/mexican-law-mcp?style=social)](https://github.com/Ansvar-Systems/mexican-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/mexican-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/mexican-law-mcp/actions/workflows/ci.yml)\n[![Daily Data Check](https://github.com/Ansvar-Systems/mexican-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/mexican-law-mcp/actions/workflows/check-updates.yml)\n[![Database](https://img.shields.io/badge/database-pre--built-green)](#whats-included)\n[![Provisions](https://img.shields.io/badge/provisions-583-blue)](#whats-included)\n\nQuery **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.\n\nIf you're building legal tech, compliance tools, or doing Mexican legal research, this is your verified reference database.\n\nBuilt by [Ansvar Systems](https://ansvar.eu) -- Stockholm, Sweden\n\n---\n\n## Why This Exists\n\nMexican 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:\n- A **lawyer** validating citations in a contract or brief\n- A **compliance officer** checking data protection requirements (LFPDPPP, LGPDPPSO)\n- A **legal tech developer** building tools on Mexican law\n- A **fintech company** navigating Ley Fintech requirements\n- A **researcher** tracing legislative reforms\n\n...you shouldn't need 47 browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes Mexican law **searchable, cross-referenceable, and AI-readable**.\n\n---\n\n## Quick Start\n\n### Use Remotely (No Install Needed)\n\n> Connect directly to the hosted version -- zero dependencies, nothing to install.\n\n**Endpoint:** `https://mexican-law-mcp.vercel.app/mcp`\n\n| Client | How to Connect |\n|--------|---------------|\n| **Claude.ai** | Settings > Connectors > Add Integration > paste URL |\n| **Claude Code** | `claude mcp add mexican-law --transport http https://mexican-law-mcp.vercel.app/mcp` |\n| **Claude Desktop** | Add to config (see below) |\n| **GitHub Copilot** | Add to VS Code settings (see below) |\n\n**Claude Desktop** -- add to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mexican-law\": {\n      \"type\": \"url\",\n      \"url\": \"https://mexican-law-mcp.vercel.app/mcp\"\n    }\n  }\n}\n```\n\n**GitHub Copilot** -- add to VS Code `settings.json`:\n\n```json\n{\n  \"github.copilot.chat.mcp.servers\": {\n    \"mexican-law\": {\n      \"type\": \"http\",\n      \"url\": \"https://mexican-law-mcp.vercel.app/mcp\"\n    }\n  }\n}\n```\n\n### Use Locally (npm)\n\n```bash\nnpx @ansvar/mexican-law-mcp\n```\n\n**Claude Desktop** -- add to `claude_desktop_config.json`:\n\n**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"mexican-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/mexican-law-mcp\"]\n    }\n  }\n}\n```\n\n**Cursor / VS Code:**\n\n```json\n{\n  \"mcp.servers\": {\n    \"mexican-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/mexican-law-mcp\"]\n    }\n  }\n}\n```\n\n## Example Queries\n\nOnce connected, just ask naturally:\n\n- *\"What does Article 1 of the LFPDPPP say about data protection scope?\"*\n- *\"Find provisions about datos personales in Mexican law\"*\n- *\"What are the cybercrime provisions in the Codigo Penal Federal?\"*\n- *\"What does the Ley Fintech say about virtual assets?\"*\n- *\"List all Mexican federal laws related to consumer protection\"*\n- *\"What are the ARCO rights under Mexican data protection law?\"*\n- *\"Find provisions about firma electronica in the e-signature law\"*\n- *\"What does Article 6 of the Constitution say about the right to information?\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Constitution** | 1 | Constitucion Politica de los Estados Unidos Mexicanos |\n| **Federal Codes** | 9 | Civil, Commercial, Criminal, Tax, Procedure, Military Justice |\n| **Federal Laws** | 116 | Data protection, fintech, telecom, labor, competition, etc. |\n| **General Laws** | 43 | Health, education, environment, transparency, anti-corruption |\n| **Organic Laws** | 9 | Judiciary, Congress, Public Administration, Attorney General |\n| **Regulatory Laws** | 6 | Agrarian, mining, nuclear energy, professional practice |\n| **Other** | 1 | Statutes |\n| **Total Statutes** | 185 | Comprehensive Mexican federal legislation |\n| **Provisions** | 583 | Full-text searchable with FTS5 (unicode61 for Spanish) |\n| **Definitions** | 56 | Legal term definitions extracted from statutes |\n| **Database Size** | ~0.7 MB | Optimized SQLite, portable |\n\n**Verified data only** -- every citation is validated against official sources (diputados.gob.mx). Zero LLM-generated content.\n\n---\n\n## Key Law Categories\n\n### Data Protection and Privacy\n- **LFPDPPP** -- Federal Law on Protection of Personal Data Held by Private Parties (2010)\n- **LGPDPPSO** -- General Law on Protection of Personal Data Held by Public Bodies (2017)\n\n### Financial Technology and Banking\n- **Ley Fintech** -- Law to Regulate Financial Technology Institutions (2018)\n- **LIC** -- Credit Institutions Law\n- **LMV** -- Securities Market Law\n- **Ley Banxico** -- Bank of Mexico Law\n\n### Cybercrime and Digital\n- **Codigo Penal Federal** -- Federal Criminal Code (Articles 211 bis 1-7: cybercrime)\n- **Ley de Firma Electronica** -- Advanced Electronic Signature Law (2012)\n- **Codigo de Comercio** -- Commercial Code (e-commerce provisions)\n\n### Consumer Protection and Competition\n- **LFPC** -- Federal Consumer Protection Law\n- **LFCE** -- Federal Economic Competition Law\n\n### Corporate and Commercial\n- **LGSM** -- General Law on Commercial Companies\n- **Ley de Concursos** -- Commercial Insolvency Law\n\n### Anti-Money Laundering\n- **Ley Antilavado** -- Federal Anti-Money Laundering Law\n\n### Transparency and Access to Information\n- **LFTAIP** -- Federal Transparency and Access to Public Information Law\n- **LGTAIP** -- General Transparency and Access to Public Information Law\n\n---\n\n## Available Tools (8)\n\n### Core Legal Research Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `search_legislation` | FTS5 search on 583 provisions with BM25 ranking |\n| `get_provision` | Retrieve specific provision by law + article number |\n| `list_laws` | List all 185 statutes with metadata |\n| `get_preparatory_works` | Get linked reform history for a statute |\n| `validate_citation` | Validate citation against database (zero-hallucination check) |\n| `build_legal_stance` | Aggregate citations from multiple statutes |\n| `format_citation` | Format citations per Mexican conventions (DOF reference) |\n| `check_currency` | Check if statute is in force, amended, or repealed |\n\n---\n\n## Data Sources and Freshness\n\nAll content is sourced from authoritative Mexican legal databases:\n\n- **[Camara de Diputados](https://www.diputados.gob.mx/LeyesBiblio/)** -- Official federal legislation compilation\n- **[Diario Oficial de la Federacion](https://www.dof.gob.mx/)** -- Official gazette for all legislation\n- **[Orden Juridico Nacional](https://www.ordenjuridico.gob.mx/)** -- Federal Legal Order reference\n\n### Automated Freshness Checks (Daily)\n\nA [daily GitHub Actions workflow](.github/workflows/check-updates.yml) monitors data sources for reforms published in the Diario Oficial de la Federacion.\n\n---\n\n## Security\n\nThis project uses multiple layers of automated security scanning:\n\n| Scanner | What It Does | Schedule |\n|---------|-------------|----------|\n| **CodeQL** | Static analysis for security vulnerabilities | Weekly + PRs |\n| **Semgrep** | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push |\n| **Gitleaks** | Secret detection across git history | Every push |\n| **Trivy** | CVE scanning on filesystem and npm dependencies | Daily |\n| **Socket.dev** | Supply chain attack detection | PRs |\n| **Dependabot** | Automated dependency updates | Weekly |\n\nSee [SECURITY.md](SECURITY.md) for the full policy and vulnerability reporting.\n\n---\n\n## Important Disclaimers\n\n### Legal Advice\n\n> **THIS TOOL IS NOT LEGAL ADVICE**\n>\n> Statute text is sourced from official Camara de Diputados publications. However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Verify critical citations** against primary sources (DOF, diputados.gob.mx) for court filings\n> - Mexican law is complex -- federal vs. state jurisdiction matters\n> - Reforms may have transitional provisions not fully captured\n\n**Before using professionally, read:** [DISCLAIMER.md](DISCLAIMER.md) | [PRIVACY.md](PRIVACY.md)\n\n### Client Confidentiality\n\nQueries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See [PRIVACY.md](PRIVACY.md) for guidance.\n\n---\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/Ansvar-Systems/mexican-law-mcp\ncd mexican-law-mcp\nnpm install\nnpm run build\nnpm test\n```\n\n### Running Locally\n\n```bash\nnpm run dev                                       # Start MCP server\nnpx @anthropic/mcp-inspector node dist/index.js   # Test with MCP Inspector\n```\n\n### Data Management\n\n```bash\nnpm run census                             # Enumerate all federal laws\nnpm run ingest                             # Full corpus ingestion from census\nnpm run ingest -- --resume                 # Resume interrupted ingestion\nnpm run ingest -- --limit 5                # Test with 5 laws\nnpm run ingest -- --skip-fetch             # Reuse cached HTML\nnpm run build:db                           # Rebuild SQLite database\nnpm run check-updates                      # Check for amendments\n```\n\n### Census-First Workflow\n\n```\ncensus.ts -> data/census.json (185 laws)\n    |\ningest.ts -> data/seed/*.json (per-law provision JSON)\n    |\nbuild-db.ts -> data/database.db (SQLite + FTS5)\n```\n\n### Performance\n\n- **Search Speed:** <100ms for most FTS5 queries\n- **Database Size:** ~0.7 MB (efficient, portable)\n- **FTS5 Tokenizer:** unicode61 (optimized for Spanish accented text)\n\n---\n\n## Related Projects: Complete Compliance Suite\n\nThis server is part of **Ansvar's Compliance Suite** -- MCP servers that work together for end-to-end compliance coverage:\n\n### [@ansvar/eu-regulations-mcp](https://github.com/Ansvar-Systems/EU_compliance_MCP)\n**Query 49 EU regulations directly from Claude** -- GDPR, AI Act, DORA, NIS2, MiFID II, eIDAS, and more. `npx @ansvar/eu-regulations-mcp`\n\n### [@ansvar/us-regulations-mcp](https://github.com/Ansvar-Systems/US_Compliance_MCP)\n**Query US federal and state compliance laws** -- HIPAA, CCPA, SOX, GLBA, FERPA, and more. `npx @ansvar/us-regulations-mcp`\n\n### [@ansvar/swedish-law-mcp](https://github.com/Ansvar-Systems/swedish-law-mcp)\n**Query 2,415 Swedish statutes directly from Claude** -- with EU cross-references. `npx @ansvar/swedish-law-mcp`\n\n### [@ansvar/canadian-law-mcp](https://github.com/Ansvar-Systems/canadian-law-mcp)\n**Query Canadian federal legislation** -- consolidated Acts from Justice Laws Website. `npx @ansvar/canadian-law-mcp`\n\n---\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nPriority areas:\n- Full corpus re-ingestion when diputados.gob.mx is accessible\n- State-level legislation coverage\n- Reglamentos (federal regulations) ingestion\n- Jurisprudencia (judicial precedent) integration\n- English translations for key statutes\n\n---\n\n## Roadmap\n\n- [x] **Census-first architecture** -- 185 federal laws enumerated\n- [x] **Core law ingestion** -- LFPDPPP, Ley Fintech, Codigo Penal, and 7 more fully parsed\n- [x] **FTS5 with unicode61** -- Optimized for Spanish text search\n- [ ] Full corpus re-ingestion (pending diputados.gob.mx availability)\n- [ ] Reglamentos coverage (80+ federal regulations)\n- [ ] State-level legislation\n- [ ] Jurisprudencia (SCJN case law)\n- [ ] English translations for key statutes\n\n---\n\n## Citation\n\nIf you use this MCP server in academic research:\n\n```bibtex\n@software{mexican_law_mcp_2026,\n  author = {Ansvar Systems AB},\n  title = {Mexican Law MCP Server: Federal Legislation Research Tool},\n  year = {2026},\n  url = {https://github.com/Ansvar-Systems/mexican-law-mcp},\n  note = {185 Mexican federal statutes with Spanish full-text search}\n}\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE) for details.\n\n### Data Licenses\n\n- **Federal Legislation:** Mexican Government (public domain under Article 14 of the Federal Copyright Law -- government works are not subject to copyright)\n- **Source:** Camara de Diputados, diputados.gob.mx/LeyesBiblio\n\n---\n\n## About Ansvar Systems\n\nWe build AI-accelerated compliance and legal research tools. This MCP server makes Mexican federal law searchable, cross-referenceable, and AI-readable.\n\n**[ansvar.eu](https://ansvar.eu)** -- Stockholm, Sweden\n\n---\n\n<p align=\"center\">\n  <sub>Built with care in Stockholm, Sweden</sub>\n</p>\n","readmeFilename":"README.md"}