{"_id":"@ansvar/southafrica-law-mcp","_rev":"2-6dae40ef8a6c9e92c04fcda904e2b497","name":"@ansvar/southafrica-law-mcp","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.1":{"name":"@ansvar/southafrica-law-mcp","version":"1.1.1","keywords":["mcp","south-africa","law","POPIA","cybercrimes","data-protection","ECTA","consumer-protection","legal","compliance","Information Regulator"],"author":{"name":"Ansvar Systems","email":"engineering@ansvar.eu"},"license":"Apache-2.0","_id":"@ansvar/southafrica-law-mcp@1.1.1","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"homepage":"https://ansvar.eu","bugs":{"url":"https://github.com/Ansvar-Systems/southafrica-law-mcp/issues"},"bin":{"southafrica-law-mcp":"dist/index.js"},"dist":{"shasum":"3073d433b6f368d48439a7e87a67a9d691bbd075","tarball":"https://registry.npmjs.org/@ansvar/southafrica-law-mcp/-/southafrica-law-mcp-1.1.1.tgz","fileCount":115,"integrity":"sha512-jD9hSgnmInHZTOunAPpSpUGQ8NMmoAI24IQuGGo36cwuIOOaj3i7Y3wUExfbvCSxGgI9PcoMc5CCNmeJACcoLA==","signatures":[{"sig":"MEQCIFxr/NWuXgHCIKt/dNINAYP6kXtQe44yMPCg0Po6GPm6AiAItiWuD7z8YN5KswHjMHVQKdtyHWGE/WjWZ5HO7qV4kQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ansvar%2fsouthafrica-law-mcp@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2461505},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"gitHead":"85d327108446064df878982335913a120f538513","mcpName":"eu.ansvar/southafrica-law-mcp","scripts":{"dev":"tsx src/index.ts","lint":"tsc --noEmit","test":"vitest run","build":"tsc","start":"node dist/index.js","ingest":"tsx scripts/ingest.ts","build:db":"tsx scripts/build-db.ts","validate":"vitest run && vitest run __tests__/contract/","test:watch":"vitest","postinstall":"node -e \"\" 2>/dev/null || true","drift:detect":"tsx scripts/drift-detect.ts","check-updates":"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"},"repository":{"url":"git+https://github.com/Ansvar-Systems/southafrica-law-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"South African law database covering POPIA, cybercrimes, electronic transactions, companies, and consumer protection law with full-text search via MCP","directories":{},"_nodeVersion":"20.20.0","dependencies":{"@ansvar/mcp-sqlite":"^1.0.3","@modelcontextprotocol/sdk":"^1.25.3"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^4.0.18","cheerio":"^1.0.0","typescript":"^5.9.3","@types/node":"^22.15.29","@vercel/node":"^5.6.4","better-sqlite3":"^12.6.2","@vitest/coverage-v8":"^4.0.18","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/southafrica-law-mcp_1.1.1_1771778407834_0.3254361918760744","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/southafrica-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"}},"time":{"created":"2026-02-22T16:40:07.759Z","modified":"2026-05-02T05:49:02.416Z","1.1.1":"2026-02-22T16:40:08.010Z"},"bugs":{"url":"https://github.com/Ansvar-Systems/southafrica-law-mcp/issues"},"author":{"name":"Ansvar Systems","email":"engineering@ansvar.eu"},"license":"Apache-2.0","homepage":"https://ansvar.eu","keywords":["mcp","south-africa","law","POPIA","cybercrimes","data-protection","ECTA","consumer-protection","legal","compliance","Information Regulator"],"repository":{"url":"git+https://github.com/Ansvar-Systems/southafrica-law-mcp.git","type":"git"},"description":"South African law database covering POPIA, cybercrimes, electronic transactions, companies, and consumer protection law with full-text search via MCP","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"readme":"# South Africa Law MCP\n\n[![CI](https://github.com/Ansvar-Systems/southafrica-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/southafrica-law-mcp/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/@ansvar/southafrica-law-mcp)](https://www.npmjs.com/package/@ansvar/southafrica-law-mcp)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)\n[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/Ansvar-Systems/southafrica-law-mcp)](https://securityscorecards.dev/viewer/?uri=github.com/Ansvar-Systems/southafrica-law-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-eu.ansvar%2Fsouthafrica--law--mcp-green)](https://registry.modelcontextprotocol.io/)\n\nA Model Context Protocol (MCP) server providing full-text search and structured access to South African legislation and case law, including POPIA, the Cybercrimes Act, ECTA, Companies Act, Consumer Protection Act, and more.\n\n> **Note:** South Africa has one of Africa's most mature legal frameworks for data protection and cybersecurity. The Protection of Personal Information Act (POPIA) is considered one of the continent's most comprehensive data protection laws, closely modeled on the EU GDPR. The Information Regulator is the independent data protection authority responsible for enforcement. The Cybercrimes Act (2020) provides a modern, comprehensive framework for addressing cybercrime, aligned with the Budapest Convention.\n\n## Deployment Tier\n\n**MEDIUM** -- dual tier (free + professional), bundled free database.\n\nSouth Africa has an extensive legal corpus including significant case law from the Constitutional Court, Supreme Court of Appeal, and High Courts. The free tier covers core national legislation, while the professional tier adds full case law coverage.\n\n| Tier | DB Size | Includes | Transport |\n|------|---------|----------|-----------|\n| **Free (bundled)** | ~100-200 MB | All national Acts, regulations, key Constitutional Court decisions | stdio (npm) |\n| **Professional (full)** | ~500 MB - 1 GB | All legislation + full case law from all courts | stdio (npm) |\n\n## Data Sources\n\n| Source | Authority | Method | Update Frequency | License | Coverage |\n|--------|-----------|--------|-----------------|---------|----------|\n| [SAFLII](https://www.saflii.org) | SAFLII / UCT / Wits | HTML Scrape | Weekly | Free Access | National Acts, regulations, case law from all courts |\n| [South African Government](https://www.gov.za/documents) | Government of South Africa | HTML Scrape | On change | Government Open Data | Government Gazette, Acts, regulations, policy documents |\n| [Dept. of Justice](https://www.justice.gov.za) | Dept. of Justice and Constitutional Development | HTML Scrape | Monthly | Government Public Domain | Constitution, justice-related legislation, POPIA/PAIA regulations |\n\n> Full provenance metadata: [`sources.yml`](./sources.yml)\n\n## Key Legislation Covered\n\n| Act | Identifier | Domain |\n|-----|-----------|--------|\n| **Protection of Personal Information Act (POPIA)** | Act 4 of 2013 | Data protection, privacy, Information Regulator |\n| **Cybercrimes Act** | Act 19 of 2020 | Cybercrime offences, cyber response, mutual assistance |\n| **Electronic Communications and Transactions Act (ECTA)** | Act 25 of 2002 | E-commerce, electronic signatures, cyber inspectors |\n| **Companies Act** | Act 71 of 2008 | Corporate governance, company formation |\n| **Consumer Protection Act** | Act 68 of 2008 | Consumer rights, product liability, data in marketing |\n| **Promotion of Access to Information Act (PAIA)** | Act 2 of 2000 | Right of access to information, public and private bodies |\n| **Regulation of Interception of Communications Act (RICA)** | Act 70 of 2002 | Lawful interception, SIM registration, communications surveillance |\n\n## Quick Start\n\n### Install from npm\n\n```bash\nnpm install -g @ansvar/southafrica-law-mcp\n```\n\n### Run via npx (no install)\n\n```bash\nnpx @ansvar/southafrica-law-mcp\n```\n\n### Configure in Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"southafrica-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/southafrica-law-mcp\"]\n    }\n  }\n}\n```\n\n### Build from Source\n\n```bash\ngit clone https://github.com/Ansvar-Systems/southafrica-law-mcp.git\ncd southafrica-law-mcp\nnpm install\nnpm run build\nnpm run build:db      # Build the full database\nnpm run build:db:free # Build the free-tier database\nnpm start             # Start the server\n```\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `get_provision` | Retrieve a specific section/article from a South African Act by law identifier and article number |\n| `search_legislation` | Full-text search across all South African legislation |\n| `search_case_law` | Full-text search across Constitutional Court, Supreme Court of Appeal, and High Court decisions |\n| `list_acts` | List all available Acts in the database |\n| `get_act_structure` | Get the table of contents / structure of a specific Act |\n| `get_provision_eu_basis` | Cross-reference a South African provision with related EU/international instruments (GDPR, Budapest Convention, NIS2) |\n\n## Contract Tests\n\nThis MCP includes 12 golden contract tests covering:\n\n- **Article retrieval** (3 tests): POPIA Section 2, Cybercrimes Act Section 2, Companies Act Section 1\n- **Search** (3 tests): personal information, cybercrime, electronic communication\n- **Citation roundtrip** (2 tests): POPIA citation URL, Cybercrimes Act citation\n- **Cross-reference** (2 tests): GDPR relationship, Budapest Convention relationship\n- **Negative cases** (2 tests): non-existent Act, malformed section number\n\nRun contract tests:\n\n```bash\nnpm run test:contract\n```\n\n## Drift Detection\n\nGolden hashes track 7 stable upstream provisions to detect silent content changes:\n\n- Constitution of South Africa (1996), Section 1 (Republic)\n- Constitution Section 14 (Right to privacy)\n- POPIA Section 1 (definitions)\n- POPIA Section 2 (purpose)\n- Cybercrimes Act Section 1 (definitions)\n- ECTA Section 1 (definitions)\n- Companies Act Section 1 (interpretation)\n\nRun drift detection:\n\n```bash\nnpm run drift:detect\n```\n\n## Development\n\n```bash\nnpm install          # Install dependencies\nnpm run build        # Compile TypeScript\nnpm test             # Run all tests\nnpm run test:contract  # Run contract tests only\nnpm run lint         # Lint source code\nnpm run drift:detect # Check for upstream changes\n```\n\n## Security\n\nSee [SECURITY.md](.github/SECURITY.md) for vulnerability disclosure policy.\n\nReport data errors: [Open an issue](https://github.com/Ansvar-Systems/southafrica-law-mcp/issues/new?template=data-error.md)\n\n## License\n\nApache-2.0 -- see [LICENSE](LICENSE).\n\n---\n\nBuilt by [Ansvar Systems](https://ansvar.eu) -- Cybersecurity compliance through AI-powered legal intelligence.\n","readmeFilename":"README.md"}