npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ansvar/southafrica-law-mcp

v1.1.1

Published

South African law database covering POPIA, cybercrimes, electronic transactions, companies, and consumer protection law with full-text search via MCP

Readme

South Africa Law MCP

CI npm License OpenSSF Scorecard MCP Registry

A 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.

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.

Deployment Tier

MEDIUM -- dual tier (free + professional), bundled free database.

South 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.

| Tier | DB Size | Includes | Transport | |------|---------|----------|-----------| | Free (bundled) | ~100-200 MB | All national Acts, regulations, key Constitutional Court decisions | stdio (npm) | | Professional (full) | ~500 MB - 1 GB | All legislation + full case law from all courts | stdio (npm) |

Data Sources

| Source | Authority | Method | Update Frequency | License | Coverage | |--------|-----------|--------|-----------------|---------|----------| | SAFLII | SAFLII / UCT / Wits | HTML Scrape | Weekly | Free Access | National Acts, regulations, case law from all courts | | South African Government | Government of South Africa | HTML Scrape | On change | Government Open Data | Government Gazette, Acts, regulations, policy documents | | Dept. of Justice | Dept. of Justice and Constitutional Development | HTML Scrape | Monthly | Government Public Domain | Constitution, justice-related legislation, POPIA/PAIA regulations |

Full provenance metadata: sources.yml

Key Legislation Covered

| Act | Identifier | Domain | |-----|-----------|--------| | Protection of Personal Information Act (POPIA) | Act 4 of 2013 | Data protection, privacy, Information Regulator | | Cybercrimes Act | Act 19 of 2020 | Cybercrime offences, cyber response, mutual assistance | | Electronic Communications and Transactions Act (ECTA) | Act 25 of 2002 | E-commerce, electronic signatures, cyber inspectors | | Companies Act | Act 71 of 2008 | Corporate governance, company formation | | Consumer Protection Act | Act 68 of 2008 | Consumer rights, product liability, data in marketing | | Promotion of Access to Information Act (PAIA) | Act 2 of 2000 | Right of access to information, public and private bodies | | Regulation of Interception of Communications Act (RICA) | Act 70 of 2002 | Lawful interception, SIM registration, communications surveillance |

Quick Start

Install from npm

npm install -g @ansvar/southafrica-law-mcp

Run via npx (no install)

npx @ansvar/southafrica-law-mcp

Configure in Claude Desktop

Add to your claude_desktop_config.json:

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

Build from Source

git clone https://github.com/Ansvar-Systems/southafrica-law-mcp.git
cd southafrica-law-mcp
npm install
npm run build
npm run build:db      # Build the full database
npm run build:db:free # Build the free-tier database
npm start             # Start the server

Tools

| Tool | Description | |------|-------------| | get_provision | Retrieve a specific section/article from a South African Act by law identifier and article number | | search_legislation | Full-text search across all South African legislation | | search_case_law | Full-text search across Constitutional Court, Supreme Court of Appeal, and High Court decisions | | list_acts | List all available Acts in the database | | get_act_structure | Get the table of contents / structure of a specific Act | | get_provision_eu_basis | Cross-reference a South African provision with related EU/international instruments (GDPR, Budapest Convention, NIS2) |

Contract Tests

This MCP includes 12 golden contract tests covering:

  • Article retrieval (3 tests): POPIA Section 2, Cybercrimes Act Section 2, Companies Act Section 1
  • Search (3 tests): personal information, cybercrime, electronic communication
  • Citation roundtrip (2 tests): POPIA citation URL, Cybercrimes Act citation
  • Cross-reference (2 tests): GDPR relationship, Budapest Convention relationship
  • Negative cases (2 tests): non-existent Act, malformed section number

Run contract tests:

npm run test:contract

Drift Detection

Golden hashes track 7 stable upstream provisions to detect silent content changes:

  • Constitution of South Africa (1996), Section 1 (Republic)
  • Constitution Section 14 (Right to privacy)
  • POPIA Section 1 (definitions)
  • POPIA Section 2 (purpose)
  • Cybercrimes Act Section 1 (definitions)
  • ECTA Section 1 (definitions)
  • Companies Act Section 1 (interpretation)

Run drift detection:

npm run drift:detect

Development

npm install          # Install dependencies
npm run build        # Compile TypeScript
npm test             # Run all tests
npm run test:contract  # Run contract tests only
npm run lint         # Lint source code
npm run drift:detect # Check for upstream changes

Security

See SECURITY.md for vulnerability disclosure policy.

Report data errors: Open an issue

License

Apache-2.0 -- see LICENSE.


Built by Ansvar Systems -- Cybersecurity compliance through AI-powered legal intelligence.