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/philippine-law-mcp

v2.0.0

Published

Philippine law database covering 11,600+ Republic Acts (1946-2024), the 1987 Constitution, and the Revised Penal Code with full-text search

Readme

Philippine Law MCP Server

The LawPhil alternative for the AI age.

npm version MCP Registry License GitHub stars CI Daily Data Check

Query 11,600+ Philippine laws -- from the Data Privacy Act and Cybercrime Prevention Act to the Revised Corporation Code, Consumer Act, and the 1987 Constitution -- directly from Claude, Cursor, or any MCP-compatible client.

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

Built by Ansvar Systems -- Stockholm, Sweden


Why This Exists

Philippine legal research is scattered across LawPhil, the Official Gazette, and various government agency sites. Whether you're:

  • A lawyer validating citations in a brief or contract
  • A compliance officer checking data privacy requirements under RA 10173
  • A legal tech developer building tools on Philippine law
  • A researcher analyzing regulatory trends across 78 years of Republic Acts

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

This MCP server makes Philippine 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://philippine-law-mcp.vercel.app/mcp

| Client | How to Connect | |--------|---------------| | Claude.ai | Settings > Connectors > Add Integration > paste URL | | Claude Code | claude mcp add philippine-law --transport http https://philippine-law-mcp.vercel.app/mcp | | Claude Desktop | Add to config (see below) | | GitHub Copilot | Add to VS Code settings (see below) |

Claude Desktop -- add to claude_desktop_config.json:

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

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

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

Use Locally (npm)

npx @ansvar/philippine-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": {
    "philippine-law": {
      "command": "npx",
      "args": ["-y", "@ansvar/philippine-law-mcp"]
    }
  }
}

Cursor / VS Code:

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

Example Queries

Once connected, just ask naturally:

  • "What does Section 3 of the Data Privacy Act say about personal information?"
  • "Find all Republic Acts about cybercrime and penalties"
  • "Is the Consumer Act (RA 7394) still in force?"
  • "What are the privacy provisions in the 1987 Constitution?"
  • "Search for provisions about electronic commerce and digital signatures"
  • "What penalties does RA 10175 prescribe for identity theft?"
  • "Find laws about SIM registration requirements"
  • "Compare data protection provisions across Philippine privacy laws"

What's Included

| Category | Count | Details | |----------|-------|---------| | Laws | 11,600+ statutes | Republic Acts (1946-2024), Constitution, Revised Penal Code | | Provisions | 80,000+ sections | Full-text searchable with FTS5 | | EU Cross-References | Auto-extracted | References to EU directives/regulations found in statute text | | Database Size | ~80 MB | Optimized SQLite, portable | | Daily Updates | Automated | Freshness checks against LawPhil |

Verified data only -- every provision is sourced from LawPhil (Arellano Law Foundation). Zero LLM-generated content.


Available Tools (15)

Core Legal Research Tools (8)

| Tool | Description | |------|-------------| | search_legislation | FTS5 search across all provisions with BM25 ranking | | get_provision | Retrieve specific provision by document ID + section | | validate_citation | Validate citation against database (zero-hallucination check) | | build_legal_stance | Aggregate citations from multiple statutes for a legal question | | format_citation | Format citations per Philippine conventions (full/short/pinpoint) | | check_currency | Check if statute is in force, amended, or repealed | | list_sources | Data provenance, coverage scope, and limitations | | about | Server metadata, dataset statistics, and freshness |

EU Law Cross-Reference Tools (5)

| Tool | Description | |------|-------------| | get_eu_basis | Get EU directives/regulations referenced by a Philippine statute | | get_philippine_implementations | Find Philippine laws referencing a specific EU act | | search_eu_implementations | Search EU documents with Philippine reference counts | | get_provision_eu_basis | Get EU law references for a specific provision | | validate_eu_compliance | Check alignment status with EU frameworks |


Data Sources & Freshness

All content is sourced from authoritative Philippine legal databases:

  • LawPhil (lawphil.net) -- The most comprehensive free Philippine law database, maintained by the Arellano Law Foundation
  • Official Gazette -- Official publication of the Republic of the Philippines

Automated Freshness Checks (Weekly)

A weekly GitHub Actions workflow monitors all data sources for new legislation and amendments.

Full provenance metadata: sources.yml


Philippine Legal System Context

  • Mixed legal system: Civil law (Spanish heritage) + common law (American heritage) + customary/Islamic law (Bangsamoro)
  • Supreme law: 1987 Constitution -- Article III Section 3 protects privacy of communication
  • Data Protection Authority: National Privacy Commission (NPC) -- one of the most active DPAs in Asia
  • Primary language: English (one of two official languages, alongside Filipino); all legislation in English
  • Numbering: Republic Acts (RA) for legislation passed by Congress (RA 1 in 1946 through RA 12000+ in 2024)
  • Other statute types: Presidential Decrees (PD), Executive Orders (EO), Batas Pambansa (BP), Commonwealth Acts (CA)
  • ASEAN member with 110M+ people and rapidly growing digital economy
  • Seeking EU GDPR adequacy for the Data Privacy Act (RA 10173)

Security

This project uses multiple layers of automated security scanning:

| Scanner | What It Does | Schedule | |---------|-------------|----------| | CodeQL | Static analysis for security vulnerabilities | Weekly + PRs | | Semgrep | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push | | Gitleaks | Secret detection across git history | Every push | | Trivy | CVE scanning on filesystem and npm dependencies | Daily | | Socket.dev | Supply chain attack detection | PRs | | OSSF Scorecard | OpenSSF best practices scoring | Weekly | | Dependabot | Automated dependency updates | Weekly |

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


Important Disclaimers

Legal Advice

THIS TOOL IS NOT LEGAL ADVICE

Statute text is sourced from LawPhil (Arellano Law Foundation). However:

  • This is a research tool, not a substitute for professional legal counsel
  • Verify critical citations against primary sources for court filings
  • Implementing Rules and Regulations (IRR) may not be included for all laws
  • EU cross-references are extracted from statute text, not EUR-Lex full text

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


Development

Setup

git clone https://github.com/Ansvar-Systems/philippine-law-mcp
cd philippine-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 Philippine laws from LawPhil
npm run ingest                    # Ingest full corpus (census-driven)
npm run ingest -- --limit 5       # Test with 5 acts
npm run ingest -- --resume        # Resume from where you left off
npm run ingest -- --skip-fetch    # Reuse cached HTML
npm run build:db                  # Rebuild SQLite database from seed files
npm run check-updates             # Check for new legislation

Contract Tests

12 golden contract tests covering:

  • 4 article retrieval tests (DPA s3, Cybercrime Act s3, Corporation Code s1, E-Commerce Act s1)
  • 3 search tests (personal information, cybercrime, electronic commerce)
  • 2 citation roundtrip tests (official lawphil.net URL patterns)
  • 1 cross-reference test (DPA to GDPR -- Philippines seeking EU adequacy)
  • 2 negative tests (non-existent RA, malformed section)

Run with: npm run test:contract


Related Projects: Complete Compliance Suite

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 -- DSL, BrB, ABL, MB, and more. npx @ansvar/swedish-law-mcp

@ansvar/sanctions-mcp

Offline-capable sanctions screening -- OFAC, EU, UN sanctions lists. pip install ansvar-sanctions-mcp


Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Priority areas:

  • Presidential Decrees (PD) and Executive Orders (EO) coverage
  • Implementing Rules and Regulations (IRR) for major laws
  • Case law integration (Supreme Court decisions)
  • Historical statute amendments tracking

Citation

If you use this MCP server in academic research:

@software{philippine_law_mcp_2026,
  author = {Ansvar Systems AB},
  title = {Philippine Law MCP Server: Production-Grade Legal Research Tool},
  year = {2026},
  url = {https://github.com/Ansvar-Systems/philippine-law-mcp},
  note = {Comprehensive Philippine legal database with 11,600+ Republic Acts and full-text search}
}

License

Apache License 2.0. See LICENSE for details.

Data Licenses

  • Legislation: Open Access (LawPhil / Arellano Law Foundation)
  • Government publications: Government Open Data (Official Gazette)
  • EU Metadata: EUR-Lex (EU public domain)

About Ansvar Systems

We build AI-accelerated compliance and legal research tools. This MCP server makes Philippine law searchable and AI-readable -- because navigating 11,600+ Republic Acts shouldn't require opening LawPhil in 47 tabs.

ansvar.eu -- Stockholm, Sweden