ph-compliance-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ph-compliance-mcp Search the Labor Code for rules on 13th month pay."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Philippine Legal & Compliance MCP — ph-compliance-mcp
The source-of-truth retrieval layer for Philippine law and compliance, over Model Context Protocol (MCP). Statutes · Jurisprudence · Government Issuances (NGA / LGU / GOCC) — retrieval-grounded, citation-verified, version-aware, provenance-checked. Never a guesser.
ph-compliance-mcp gives any MCP-capable agent (Claude, OpenCode, Cline, and
others) grounded, citable answers about Philippine law and regulatory
compliance — instead of an LLM's parametric (and frequently wrong) recollection
of PH law.
Legal: 1987 Constitution, Civil Code, Revised Penal Code, Labor Code, Family Code, Rules of Court, and the full body of Republic Acts, Presidential Decrees, and Executive Orders.
Compliance & business: corporate/commercial law, transactional and contracts, accounting & auditing, payroll & benefits (SSS, PhilHealth, Pag-IBIG, 13th month pay), and human-resources/workplace compliance (DOLE).
Government issuances: memorandums and circulars of National Government Agencies (NGA), Local Government Unit (LGU) issuances and ordinances, and Government-Owned and Controlled Corporation (GOCC) rules.
Jurisprudence: Supreme Court and appellate decisions, with a citations knowledge graph connecting cases and statutes.
⚠️ Not legal advice. This is an information-retrieval and citation layer, not a lawyer, judge, or source of legal counsel. See DISCLAIMER.md.
Why this MCP stands out
Capability | ph-compliance-mcp | Typical PH-law MCPs |
Corpus provenance | SHA-256 checksums per asset, verified on load; refuses on mismatch | Often static bundled snapshots |
Version-aware law |
| Current-text only |
Citations knowledge graph |
| None |
No-synthesis guarantee | Below confidence threshold → | Varies |
Coverage breadth | Laws + cases + NGA/LGU/GOCC issuances across 15 compliance domains | Statutes only, typically |
Freshness signal |
| None |
See docs/marketplace/mcpmarket.md for the full competitive positioning, and the research-backed source list in docs/sources.md.
Related MCP server: Icelandic Law MCP
Quick start
Requirements
Node.js 24+ (pnpm recommended)
Install (local stdio MCP server)
{
"mcpServers": {
"ph-compliance": {
"command": "npx",
"args": ["-y", "github:andreibrosmaster/ph-compliance-mcp"]
}
}
}Corpus assets (laws/cases/issuances SQLite + .sha256 checksums) download and
verify on first run, cached under ~/.cache/ph-compliance-mcp.
Run from source
pnpm install
pnpm dev # stdio server (tsx)
pnpm inspector # MCP Inspector UIBuild the corpus from seed data
The repository ships a version-controlled seed corpus (data/seed/*.jsonl —
20 statutes, 4 agency issuances, 3 landmark cases across all 15 compliance
domains), authored from primary sources by scripts/generate-seed.mjs:
pnpm seed # regenerate data/seed/*.jsonl (idempotent)
pnpm build:corpus # build dist/corpus from data/seed (defaults)The golden eval gate (pnpm eval:all) is passable against this seed: every
golden QA pair's plan retrieves its answer from the seeded corpus, and
tests/golden/dataset-coverage.test.ts locks that seed↔golden coupling so it
cannot silently drift.
The [citations] pass then populates the knowledge graph
(--no-citations to skip). Live ingestion from official sources (CI-only,
robots-respecting, throttled):
pnpm build:corpus -- --sources official-gazette,lawphil --out dist/corpusEvery instrument is catalogued first (data-pipeline/catalog.ts, 40+
instruments across all 15 domains); adapters only fetch what the catalog
declares — nothing is ingested that isn't catalogued, and nothing is ever
fabricated.
Tools
Tool | Purpose |
| Full-text search over statutes/provisions (FTS5/BM25, confidence-gated) |
| Retrieve one provision with citation + source |
| Full-text search over case decisions |
| Retrieve a case with passages and citation |
| Search government issuances (NGA/LGU/GOCC) |
| Retrieve one issuance |
| Validate/parse a Philippine citation |
| 15-domain taxonomy + corpus freshness |
| Statutes cited by a case (graph) |
| Cases sharing cited statutes (graph) |
| Amendment log of a statute |
| Version history of a provision |
| Law→law dependency edges |
| Citations made by a case |
| IRR references for a statute |
| Domain cross-references + graph edges |
| Deterministic prescriptive-period calculator (Civil Code Arts. 1144–1149) |
| Deterministic filing-deadline calculator (Rules of Court Rule 22 + 37/41/45/65) |
| Deterministic 13th-month-pay calculator (PD 851) |
Resources
ph-compliance://domains— taxonomy + freshnessph-compliance://statute/{statute}— statute metadata + provision list
Coverage: 15 compliance domains
Domain | Key instruments |
Constitutional | 1987 Constitution |
Civil | Civil Code (RA 386) |
Family | Family Code (EO 209) |
Criminal | Revised Penal Code (Act 3815), special penal laws |
Tax | National Internal Revenue Code (RA 8424), BIR issuances |
Labor | Labor Code (PD 442) |
Commercial/Corporate | Revised Corporation Code (RA 11232), SRC |
Business & Transactional | Contracts, sales, agency, Negotiable Instruments (Act 2031), EODB (RA 11032) |
Accounting & Auditing | Accountancy Act (RA 9298), PFRS, COA audit rules |
Payroll & Benefits | 13th month pay (PD 851), SSS (RA 11199), PhilHealth (RA 11223), Pag-IBIG (RA 9679) |
HR & Workplace Compliance | Labor Code standards, OSH (RA 11058), DOLE issuances |
Remedial | Rules of Court |
Administrative | Administrative Code (EO 292), civil-service rules, NGA memorandums |
Local Government | Local Government Code (RA 7160), LGU issuances |
Special/Cross-cutting | Data Privacy Act (RA 10173), EODB, consumer protection (RA 7394) |
AI agent integrations
ph-compliance-mcp is a standard stdio MCP server — connect any
MCP-capable AI coding agent. Client-specific setup (as of August 2026):
Client | Config | Guide |
Claude Code |
| |
OpenAI Codex CLI |
| |
OpenCode |
| |
Cline (VS Code) |
| |
Cursor |
|
The universal config (any client): command node, args
["/abs/path/ph-compliance-mcp/dist/src/server.js"]. See
docs/agents/README.md. Each tool returns BOTH
human-readable text and machine-parseable structuredContent, so agents can
use results in downstream automation.
Use cases
From contract review and employment compliance to tax, payroll, procurement, litigation deadlines, and NGA/LGU/GOCC issuance research — see docs/usecases.md for ready-to-paste prompts across all 15 domains.
Enterprise
Shared/verified corpus deployment, air-gapped operation, hardening, an
operations runbook, and a legal-review workflow: see
docs/enterprise.md. The eval harness
(pnpm eval) is the release gate — see evals/README.md.
Security and contribution policies: SECURITY.md,
CODE_OF_CONDUCT.md.
Docker
A multi-stage Dockerfile ships a slim runtime image (no build toolchain, no
ports — MCP over stdio) with a built-in HEALTHCHECK and pre-wired air-gapped
corpus mount (PH_COMPLIANCE_LOCAL_CORPUS=/corpus):
docker build -t ph-compliance-mcp .
docker compose up --build -d # see compose.yamlOperations & releases
docs/operations.md — post-production runbook: monitoring (
pnpm healthcheck,pnpm check:freshness), backup/restore, upgrades, incident response, disaster recovery, weekly maintenance cadence.docs/release.md — code (
v0.12.0) vs corpus (corpus-YYYY.MM.DD) versioning, release gates (eval is release-blocking), rollback, post-release checklist.docs/governance.md — contribution model: branch protection, CODEOWNERS mandatory reviews, Dependabot, CI/release gates.
Corpus builds are version-stamped:
build-index.tswritesmanifest.json(per-corpus SHA-256, record counts, sources) into the output dir; the weeklyrefresh-corpus.ymlpublishes it alongside the sqlite assets.
Design constraints (non-negotiable)
No synthesis without citation — every tool response carries a structured citation resolved against the corpus; below the confidence threshold the tool returns "insufficient corpus coverage," never a best-effort guess.
Information retrieval, not legal advice.
Primary sources over commentary — codal text and decisions, not summaries.
Version-aware, not just current-aware — amendments/repeals/supersessions tracked.
Provenance on everything ingested — URL, retrieval date, content hash.
Corpus integrity
Every corpus asset ships with a .sha256 checksum (wired in CI from day one).
corpus-loader.ts verifies each asset before caching and refuses to load on
mismatch — a corrupted or tampered corpus fails loudly, never silently.
Repository map
docs/adr/— architecture decision records (ADR-000 scope; ADR-004 rename)docs/sources.md— authoritative PH legal data sources (research-backed)docs/seo.md— how this repo is indexed by search engines and LLMs (GEO)docs/marketplace/mcpmarket.md— competitive positioningdocs/agents/— per-client setup guides (Claude Code, Codex, OpenCode, Cline, Cursor)docs/enterprise.md— enterprise deployment & operationsdocs/operations.md— post-production runbook (monitoring, backup, DR)docs/release.md— release process (code + corpus versioning, gates)docs/usecases.md— use-case catalog with ready-to-paste promptsDockerfile/compose.yaml— containerized stdio server (air-gapped corpus)scripts/healthcheck.mjs,scripts/check-freshness.mjs— ops probessrc/db/schema/— SQLite schemas: laws, cases, issuancessrc/domains/— 15 domain modules with metadata + cross-referencesdata-pipeline/— ingestion: catalog → adapters → normalizers → chunkers → builddata-pipeline/catalog.ts— the instrument catalog (ingestion manifest)src/— server, retrieval, tools, resourcesevals/— golden sets + workingrun-eval.tsharnessllms.txt— AI-discoverable index of this repository
The roadmap lives in the project's second brain:
../second-brain/roadmap.md. Current state:
../second-brain/state.md.
For AI agents and crawlers
See llms.txt for a machine-readable index of this repository,
and docs/seo.md for the GEO/SEO strategy. This README is
written to be parseable by both humans and LLMs: precise, keyword-rich, and
factual — no marketing fluff that dilutes ground truth.
License & disclaimer
Apache-2.0 licensed. ph-compliance-mcp is an information-retrieval tool, not a
source of legal advice — verify anything you rely on against the official
source. See DISCLAIMER.md and LICENSE.
Frequently asked questions
Is this a replacement for a lawyer? No. It is a retrieval layer that cites primary sources. It refuses to guess below a confidence threshold.
Which sources are ingested? Primary sources only — Official Gazette, LawPhil, SC E-Library, and agency repositories (BIR, DOLE, CSC, DBM, COA, SSS, PhilHealth, Pag-IBIG, DTI, and more). See docs/sources.md.
How is accuracy guaranteed? Every response carries a structured citation resolved against the corpus; content hashes and SHA-256 checksums protect corpus integrity; version-aware provisions track amendments.
Can it answer payroll/compliance questions? Yes — payroll, benefits, accounting, HR, and business-transactional domains are first-class citizens, not afterthoughts.
How does it differ from a static PH-law MCP? Live-corpus refresh cadence, provenance verification, version-aware history, a citations knowledge graph, and a no-guess guarantee.
Available Tools
19 toolscite_validateValidate a legal citation against the corpusARead-onlyIdempotent
Resolve a citation against the corpus and return the exact matching text. If the citation cannot be resolved, it returns a clear 'cannot validate' verdict — it never fills in plausible text. Use this before relying on any AI-generated citation.
Inputs: statute, provision, caseCitation. Returns: status, citation
compute_13th_monthCompute 13th-month pay under PD 851ARead-onlyIdempotent
Deterministic 13th-month-pay calculator under PD 851 (as amended by Memorandum Order No. 28 and the Rules Implementing PD 851). Computes total basic salary earned within the calendar year ÷ 12 for rank-and-file employees (pro-rated automatically for partial-year service), and returns coverage/exclusion notes plus the payment deadline (on or before December 24). Verify the rule text and current DOLE advisories with the corpus before relying on it. Not legal advice.
Inputs: totalBasicSalary (required). Returns: amount, status
compute_deadlineCompute a filing deadline under the Rules of CourtARead-onlyIdempotent
Deterministic filing-deadline calculator under the Rules of Court. Applies Rule 22 computation of time (exclude the first day, include the last; last day on a Saturday, Sunday, or legal holiday runs to the next working day) to the common reglementary periods (Rule 37, Rule 41, Rule 45, Rule 65). Pass legal holidays as ISO dates — they are declared per year by proclamation, so never assume the calendar. Verify the rule text with get_provision or cite_validate before relying on it. Not legal advice.
Inputs: filingType (required), noticeDate (required), holidays, extensionDays. Returns: status, lastDay
compute_prescriptionCompute a prescriptive period under the Civil CodeARead-onlyIdempotent
Deterministic prescriptive-period calculator under Civil Code Arts. 1144-1149 (RA 386). Pick the class of action to get the codal period in years, the exact article, and — if a cause-of-action date is given — the computed deadline. The computation is arithmetic over the cited articles; verify the codal text with get_provision or cite_validate before relying on it, and note that interruption (Art. 1155) can extend the deadline in practice. Not legal advice.
Inputs: actionType (required), causeOfActionDate. Returns: years, status, article, category
get_caseGet a caseARead-onlyIdempotent
Return a case by citation (e.g. 'G.R. No. 238875') with metadata and the first passages of the decision.
Inputs: citation (required), limit. Returns: title, status, citation
get_issuanceGet an agency issuanceARead-onlyIdempotent
Return an issuance by agency + reference number (e.g. 'BIR' / 'RMC 85-2023') with metadata and the first passages of the document.
Inputs: agency (required), referenceNo (required), limit. Returns: title, status, referenceNo
get_provisionGet a statute provisionARead-onlyIdempotent
Return the exact text of a provision (e.g. Civil Code Art. 1156) with its current status. Version-aware: reports amended/repealed/superseded status when the corpus tracks it.
Inputs: statute (required), provision (required). Returns: body, status, citation, provisionNo
list_domainsList law domains and corpus freshnessARead-onlyIdempotent
Enumerate the 15-domain compliance taxonomy (ADR-000 core + ADR-004 expansion) with corpus refresh timestamps, so callers can check freshness before trusting retrieval results.
Inputs: no named parameters. Returns: count, status, domains
search_issuanceSearch agency issuancesARead-onlyIdempotent
Lexical (FTS5/BM25) search over the administrative issuance corpus (BIR first, Phase 3). Information retrieval, not legal advice. Below confidence threshold it reports insufficient corpus coverage rather than guessing.
Pagination: use offset to page; check hasMore/nextOffset. Filter by agency or issuanceType.
Inputs: query (required), limit, agency, offset, +1 more. Returns: count, query, total, offset, +4 more
search_jurisprudenceSearch Philippine jurisprudenceARead-onlyIdempotent
Lexical (FTS5/BM25) search over the case corpus (SC, CA, SB, CTA decisions). Information retrieval, not legal advice. Results carry structured citations; below confidence threshold the tool reports insufficient corpus coverage rather than guessing.
Pagination: use offset to page; check hasMore/nextOffset. Use court to narrow results.
Inputs: query (required), court, limit, offset. Returns: count, query, total, offset, +4 more
search_statuteSearch Philippine statutesARead-onlyIdempotent
Lexical (FTS5/BM25) search over the statute corpus (Constitution, codes, RA, PD, EO). Information retrieval, not legal advice. Results carry structured citations; below confidence threshold the tool reports insufficient corpus coverage rather than guessing.
Pagination: use offset to page; check hasMore/nextOffset. Use domain to narrow results.
Inputs: query (required), limit, domain, offset. Returns: count, query, total, offset, +4 more
show_amendmentsAmendment history of a statuteARead-onlyIdempotent
List the amendment log for a statute (amending law, affected provision, effective date). Use with get_provision to confirm the current text of an amended provision.
Inputs: statute (required), limit, actNumber. Returns: count, status, statute, amendments
show_citationsCitations made by a caseARead-onlyIdempotent
List every citation a case makes (statutes and other cases), as recorded in the citation graph. Citations that could not be resolved against the corpus are not listed.
Inputs: caseCitation (required), limit. Returns: count, status, citations, caseCitation
show_cross_referencesCross-references for a statuteBRead-onlyIdempotent
Curated cross-domain references (from the domain registry) for the statute's domain, plus statute→statute citation edges from the corpus graph.
Inputs: statute (required), limit, actNumber. Returns: count, domain, status, statute, +1 more
show_dependenciesStatute dependency graphARead-onlyIdempotent
Show which statutes a statute cites (dependencies) and which statutes cite it back (dependentOn), from corpus-grounded law→law edges.
Inputs: statute (required), limit, actNumber. Returns: count, status, statute, dependentOn, +1 more
show_historyVersion history of a provisionARead-onlyIdempotent
Show every recorded version of a provision, ordered by effective date (valid_from). Confirms whether the current text differs from an earlier version.
Inputs: statute (required), provision (required), actNumber. Returns: count, status, statute, versions, +1 more
show_implementing_rulesImplementing rules references for a statuteARead-onlyIdempotent
Find corpus references to the Implementing Rules and Regulations (IRR) of a statute — citations mentioning IRR that resolve to the statute, with the citing cases.
Inputs: statute (required), limit, actNumber. Returns: count, status, statute, references
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool targets a distinct resource or action: search across three corpora, get by citation, relationship/neighborhood tools (related_laws vs. related_cases vs. show_dependencies vs. show_citations), versioning (show_amendments vs. show_history), and three separate deterministic calculators. Any overlap is narrow and the descriptions clarify the boundaries.
The vast majority follow a verb_noun snake_case pattern (search_, get_, show_, compute_, list_). Minor deviations: 'related_laws' and 'related_cases' use an adjective prefix, and 'cite_validate' inverts the expected verb order (validate_citation). These are still readable and predictable.
At 19 tools, this sits in the 16-25 'heavy but borderline' range. Given the multi-corpus scope (statutes, jurisprudence, issuances) plus citation graph, versioning, and computation tools, each tool has a unique role and the count is defensible, though a slightly tighter set could be imagined.
The surface covers the full lifecycle for a read-only compliance server: search across all corpora, exact retrieval by citation, citation validation, relationship exploration (dependencies, citations, IRRs, cross-references), version/amendment tracking, and deterministic computations for key deadlines. No obvious dead ends or missing operations for the stated domain.
Maintenance
Related MCP Connectors
Semantic retrieval across 295,000+ Indonesian regulations and 5.6M+ legal provisions, updated daily. Give AI direct access to Indonesian regulatory knowledge before reasoning.
Verified, tier-0 regulatory data for AI across 850+ official sources and 50+ jurisdictions.
AI laws from 110+ countries, enforcement actions and a 3,900-term glossary. Free, no API key.
Grounded MENA legal search, reasoning, citation resolution, and citation-graph traversal.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables users to search, retrieve, and validate over 11,000 Philippine statutes and nearly 100,000 provisions through AI-powered legal research tools. It supports full-text search across Republic Acts, the Constitution, and various codes while providing cross-referencing and international law alignment capabilities.1 npm-
- AlicenseAqualityFmaintenanceProvides access to 1,709 Icelandic statutes and 19,026 provisions with full-text search, citation validation, and EU/EEA law integration, enabling legal research and compliance checks through natural language queries.1167 npm1Apache 2.0

brehon-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceProvides AI assistants with real-time, structured access to 32 privacy and AI governance laws across 28 jurisdictions to prevent hallucination in compliance answers.MIT- AlicenseNot gradedqualityBmaintenanceSearch Indonesian regulations, resolve citations, read specific articles, and find Constitutional Court decisions with official-source links. Six research and feedback tools plus a health probe provide structured text, legal-status context, and amendment relationships. Hosted Streamable HTTP; free account with OAuth or a personal token.2AGPL 3.0