{"_id":"@ansvar/moroccan-law-mcp","_rev":"3-75f1439a493fbec235f8ac5d38593279","name":"@ansvar/moroccan-law-mcp","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.1":{"name":"@ansvar/moroccan-law-mcp","version":"1.0.1","keywords":["mcp","model-context-protocol","moroccan-law","data-protection","cybersecurity","legislation","legal","compliance","ansvar"],"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","_id":"@ansvar/moroccan-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/Moroccan-law-mcp/issues"},"bin":{"moroccan-law-mcp":"dist/index.js"},"dist":{"shasum":"ff36b8cedf5c3c8beb2c53f471e5b4a6dd07d91b","tarball":"https://registry.npmjs.org/@ansvar/moroccan-law-mcp/-/moroccan-law-mcp-1.0.1.tgz","fileCount":128,"integrity":"sha512-m6v4G9/JxFsjKi74HCTvZ+Lm+z7YVagcgyr7gyCcukrSL/XX+BgNkyFw/iT9XLOCmzkQyTSpVTt82CwINRmAxg==","signatures":[{"sig":"MEUCIQCDBLhOt7yVgckl/MH4d8o/KwfPlsaUCW1hI5apfynrQwIgFNQdVCnhQgWU9xyfrZlxXcTKRlDlJxVmintuigK1d44=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ansvar%2fmoroccan-law-mcp@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":275096},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"gitHead":"180917277e32c9dd07b0fa08ede6f4fee7cbcd37","mcpName":"eu.ansvar/moroccan-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/Moroccan-law-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"Moroccan law database covering data protection, cybersecurity, e-commerce, and criminal law provisions via Model Context Protocol","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","tesseract.js":"^7.0.0","better-sqlite3":"^12.6.2","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/moroccan-law-mcp_1.0.1_1771781850071_0.5891604651466853","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/moroccan-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"},"1.1.0":{"name":"@ansvar/moroccan-law-mcp","version":"1.1.0","keywords":["mcp","model-context-protocol","moroccan-law","data-protection","cybersecurity","legislation","legal","compliance","ansvar"],"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","_id":"@ansvar/moroccan-law-mcp@1.1.0","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"homepage":"https://ansvar.eu","bugs":{"url":"https://github.com/Ansvar-Systems/Moroccan-law-mcp/issues"},"bin":{"moroccan-law-mcp":"dist/index.js"},"dist":{"shasum":"e78c2bfbffa9db95d07608f236d28352876b9e08","tarball":"https://registry.npmjs.org/@ansvar/moroccan-law-mcp/-/moroccan-law-mcp-1.1.0.tgz","fileCount":141,"integrity":"sha512-AZ+tS+2H5774IqcoweWhjzG3hBR0FTXbiYLCsVv25Z300KLl5G+orZkprRre2gPgcP4Ca2qWtwqnEOgA4rLNdQ==","signatures":[{"sig":"MEQCIQCW8nvOGPHp+ckn0iRGS3HqQUNHpun3lFSB7uh+3iibBQIfXNJloqcmwMtz6XOomgbfIJWgR+JbyRWllVXhdbmLpQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106066902},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"gitHead":"30762c911033d0e8b7d68a323ba9b2a7ad1bd38c","mcpName":"eu.ansvar/moroccan-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","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/Moroccan-law-mcp.git","type":"git"},"_npmVersion":"10.9.4","description":"Moroccan law database covering data protection, cybersecurity, e-commerce, and criminal law provisions via Model Context Protocol","directories":{},"_nodeVersion":"22.22.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","tesseract.js":"^7.0.0","better-sqlite3":"^12.6.2","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/moroccan-law-mcp_1.1.0_1772291101622_0.5629811238163445","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/moroccan-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"}},"time":{"created":"2026-02-22T17:37:29.980Z","modified":"2026-05-02T05:47:50.824Z","1.0.1":"2026-02-22T17:37:30.215Z","1.1.0":"2026-02-28T15:05:02.687Z"},"bugs":{"url":"https://github.com/Ansvar-Systems/Moroccan-law-mcp/issues"},"author":{"name":"Ansvar Systems","email":"hello@ansvar.eu"},"license":"Apache-2.0","homepage":"https://ansvar.eu","keywords":["mcp","model-context-protocol","moroccan-law","data-protection","cybersecurity","legislation","legal","compliance","ansvar"],"repository":{"url":"git+https://github.com/Ansvar-Systems/Moroccan-law-mcp.git","type":"git"},"description":"Moroccan law database covering data protection, cybersecurity, e-commerce, and criminal law provisions via Model Context Protocol","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"readme":"# Moroccan Law MCP Server\n\n**The Adala alternative for the AI age.**\n\n[![npm version](https://badge.fury.io/js/%40ansvar/moroccan-law-mcp.svg)](https://www.npmjs.com/package/@ansvar/moroccan-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/Moroccan-law-mcp?style=social)](https://github.com/Ansvar-Systems/Moroccan-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/Moroccan-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/Moroccan-law-mcp/actions/workflows/ci.yml)\n\nQuery **3,946 Moroccan laws** with **61,351 provisions** -- from Loi 09-08 (data protection) and Loi 05-20 (cybersecurity) to the Code de Commerce and the Constitution -- directly from Claude, Cursor, or any MCP-compatible client.\n\nIf you're building legal tech, compliance tools, or doing Moroccan legal research, this is your verified reference database. Arabic + French bilingual.\n\nBuilt by [Ansvar Systems](https://ansvar.eu) -- Stockholm, Sweden\n\n---\n\n## Why This Exists\n\nMoroccan legal research means navigating the Adala portal, the Bulletin Officiel, DGSSI publications, and OMPIC registers -- across 53 legal domains, in Arabic and French. Whether you're:\n\n- A **lawyer** validating citations in a brief or contract\n- A **compliance officer** checking if a statute is still in force\n- A **legal tech developer** building tools on Moroccan law\n- A **researcher** tracing legislative history across legal domains\n\n...you shouldn't need dozens of browser tabs and manual cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes Moroccan 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://moroccan-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 moroccan-law --transport http https://moroccan-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    \"moroccan-law\": {\n      \"type\": \"url\",\n      \"url\": \"https://moroccan-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    \"moroccan-law\": {\n      \"type\": \"http\",\n      \"url\": \"https://moroccan-law-mcp.vercel.app/mcp\"\n    }\n  }\n}\n```\n\n### Use Locally (npm)\n\n```bash\nnpx @ansvar/moroccan-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    \"moroccan-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/moroccan-law-mcp\"]\n    }\n  }\n}\n```\n\n**Cursor / VS Code:**\n\n```json\n{\n  \"mcp.servers\": {\n    \"moroccan-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/moroccan-law-mcp\"]\n    }\n  }\n}\n```\n\n---\n\n## Example Queries\n\nOnce connected, just ask naturally (French or English):\n\n- *\"Que dit la Loi 09-08 sur la protection des donnees personnelles?\"*\n- *\"What does Article 3 of the Cybersecurity Law (Loi 05-20) say?\"*\n- *\"Search for provisions about commerce electronique\"*\n- *\"Is the Code du Travail still in force?\"*\n- *\"Which Moroccan laws implement EU data protection standards?\"*\n- *\"Validate this legal citation\"*\n- *\"Build a legal stance on cybersecurity obligations in Morocco\"*\n- *\"Quelles sont les sanctions prevues par le Code Penal pour la fraude informatique?\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Laws** | 3,946 laws | Moroccan legislation across 53 legal domains |\n| **Provisions** | 61,351 provisions | Full-text searchable with FTS5 |\n| **Definitions** | 106 definitions | Legal term definitions extracted from statutes |\n| **EU Cross-References** | Yes | EU integration tools for directive mappings |\n| **Database Size** | ~101 MB | Optimized SQLite, portable |\n\n**Verified data only** -- every citation is validated against official sources (Adala/Ministry of Justice, DGSSI, OMPIC). Zero LLM-generated content.\n\n---\n\n## Key Legislation Covered\n\n| Law | Significance |\n|-----|-------------|\n| **Loi 09-08** | Data protection (modeled on EU Directive 95/46/EC); establishes the CNDP |\n| **Loi 05-20** | Cybersecurity framework; critical infrastructure protection |\n| **Constitution 2011** | Supreme law; fundamental rights and freedoms |\n| **Code de Commerce** | Commercial law framework |\n| **Code Penal** | Criminal law including computer crime offences |\n| **Code du Travail** | Labour law and employment regulations |\n| **Moudawana (Code de la Famille)** | Family law |\n| **Loi 31-08** | Consumer protection |\n| **Loi 53-05** | Electronic exchange of legal data |\n\n---\n\n## Available Tools (13)\n\n### Core Legal Research Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `search_legislation` | FTS5 full-text search across all provisions with BM25 ranking |\n| `get_provision` | Retrieve specific provision by statute + article |\n| `check_currency` | Check if statute is in force, amended, or repealed |\n| `validate_citation` | Validate citation against database (zero-hallucination check) |\n| `build_legal_stance` | Aggregate citations from statutes for a legal topic |\n| `format_citation` | Format citations per Moroccan conventions (full/short/pinpoint) |\n| `list_sources` | List all available statutes with metadata |\n| `about` | Server info, capabilities, and coverage summary |\n\n### EU/International Law Integration Tools (5)\n\n| Tool | Description |\n|------|-------------|\n| `get_eu_basis` | Get EU directives/regulations for Moroccan statute |\n| `get_moroccan_implementations` | Find Moroccan laws implementing EU act |\n| `search_eu_implementations` | Search EU documents with Moroccan implementation counts |\n| `get_provision_eu_basis` | Get EU law references for specific provision |\n| `validate_eu_compliance` | Check implementation status of EU directives |\n\n---\n\n## EU Law Integration\n\nMorocco has an advanced status agreement with the EU and has aligned parts of its legal framework with EU standards. The EU integration tools let you:\n\n- Trace which EU directives a Moroccan law implements (e.g., Loi 09-08 implements Directive 95/46/EC)\n- Find all Moroccan laws that implement a specific EU regulation\n- Check implementation completeness for EU directives\n- Get provision-level EU law references\n\n---\n\n## Data Sources & Freshness\n\nAll content is sourced from authoritative Moroccan legal databases:\n\n- **[Adala (Ministry of Justice)](https://adala.justice.gov.ma)** -- Official Moroccan legal database, 53 legal domains\n- **[DGSSI](https://www.dgssi.gov.ma)** -- Cybersecurity legislation and regulatory texts\n- **[OMPIC](https://www.ompic.ma)** -- Intellectual property and commercial regulations\n\nA daily automated check workflow (`check-updates.yml`) monitors source portals for new legislation and amendments.\n\n**Verified data only** -- every citation is validated against official sources. Zero LLM-generated content.\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| **Drift Detection** | Monitors source data for upstream changes | Scheduled |\n\nSee [SECURITY.md](SECURITY.md) for the full policy and vulnerability reporting.\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. Full regulatory text with article-level search. `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/security-controls-mcp](https://github.com/Ansvar-Systems/security-controls-mcp)\n**Query 261 security frameworks** -- ISO 27001, NIST CSF, SOC 2, CIS Controls, SCF, and more. `npx @ansvar/security-controls-mcp`\n\n### [@ansvar/automotive-cybersecurity-mcp](https://github.com/Ansvar-Systems/Automotive-MCP)\n**Query UNECE R155/R156 and ISO 21434** -- Automotive cybersecurity compliance. `npx @ansvar/automotive-cybersecurity-mcp`\n\n**75+ national law MCPs** covering Australia, Brazil, Canada, China, Denmark, Finland, France, Germany, Ghana, Iceland, India, Ireland, Israel, Italy, Japan, Kenya, Netherlands, Nigeria, Norway, Singapore, Slovenia, South Korea, Sweden, Switzerland, Thailand, UAE, UK, and more.\n\n---\n\n## Contributing\n\nContributions welcome. Priority areas:\n\n- Additional statutory instruments and ministerial decrees\n- Court case law expansion\n- EU cross-reference improvements\n- Historical statute versions and amendment tracking\n- Arabic/French translation quality improvements\n\n---\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/Ansvar-Systems/Moroccan-law-mcp\ncd Moroccan-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---\n\n## Citation\n\nIf you use this MCP server in academic research:\n\n```bibtex\n@software{moroccan_law_mcp_2025,\n  author = {Ansvar Systems AB},\n  title = {Moroccan Law MCP Server: AI-Powered Legal Research Tool},\n  year = {2025},\n  url = {https://github.com/Ansvar-Systems/Moroccan-law-mcp},\n  note = {Moroccan legal database with full-text search and EU cross-references}\n}\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE) for details.\n\n### Data Licenses\n\n- **Statutes & Legislation:** Moroccan Government (public domain)\n- **EU Metadata:** EUR-Lex (EU public domain)\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 Moroccan government publications. However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Court case coverage is limited** -- do not rely solely on this for case law research\n> - **Verify critical citations** against primary sources for court filings\n> - **EU cross-references** are extracted from statute text, not EUR-Lex full text\n\n**Before using professionally, read:** [DISCLAIMER.md](DISCLAIMER.md) | [SECURITY.md](SECURITY.md)\n\n### Client Confidentiality\n\nQueries go through the Claude API. For privileged or confidential matters, use on-premise deployment.\n\n---\n\n## About Ansvar Systems\n\nWe build AI-accelerated compliance and legal research tools for the global market. This MCP server started as our internal reference tool -- turns out everyone building compliance tools has the same research frustrations.\n\nSo we're open-sourcing it.\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"}