
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
@ansvar/portuguese-law-mcp
Advanced tools
Portuguese law database with 1,130 statutes and 56,955 provisions covering full Portuguese consolidated legislation (Leis, Decretos-Lei, Codigos, Portarias) with full-text search
The Diario da Republica alternative for the AI age.
Query 1,130 Portuguese statutes -- from the Constituicao and Codigo Penal to Lei 58/2019 (GDPR), Lei 46/2018 (NIS), and Lei 109/2009 (Cybercrime) -- directly from Claude, Cursor, or any MCP-compatible client.
If you're building legal tech, compliance tools, or doing Portuguese legal research, this is your verified reference database.
Built by Ansvar Systems
Portuguese legal research requires navigating DRE (Diario da Republica Eletronico), PGDL databases, and EUR-Lex cross-references. Whether you're:
...you shouldn't need multiple browser tabs and manual cross-referencing. Ask Claude. Get the exact provision. With context.
This MCP server makes Portuguese law searchable, cross-referenceable, and AI-readable.
Connect directly to the hosted version -- zero dependencies, nothing to install.
Endpoint: https://portuguese-law-mcp.vercel.app/mcp
| Client | How to Connect |
|---|---|
| Claude.ai | Settings > Connectors > Add Integration > paste URL |
| Claude Code | claude mcp add portuguese-law --transport http https://portuguese-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": {
"portuguese-law": {
"type": "url",
"url": "https://portuguese-law-mcp.vercel.app/mcp"
}
}
}
GitHub Copilot -- add to VS Code settings.json:
{
"github.copilot.chat.mcp.servers": {
"portuguese-law": {
"type": "http",
"url": "https://portuguese-law-mcp.vercel.app/mcp"
}
}
}
npx @ansvar/portuguese-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": {
"portuguese-law": {
"command": "npx",
"args": ["-y", "@ansvar/portuguese-law-mcp"]
}
}
}
Cursor / VS Code:
{
"mcp.servers": {
"portuguese-law": {
"command": "npx",
"args": ["-y", "@ansvar/portuguese-law-mcp"]
}
}
}
Once connected, just ask naturally:
| Category | Count | Details |
|---|---|---|
| Statutes | 1,130 laws | Full Portuguese consolidated legislation |
| Provisions | 56,955 articles | Full-text searchable with FTS5 |
| Legal Definitions | 84 definitions | Extracted from definition articles |
| EU Cross-References | Auto-extracted | Links to EU directives and regulations |
| Database Size | ~76 MB | Optimized SQLite, portable |
| Daily Updates | Automated | Freshness checks against PGDL |
| Type | Count |
|---|---|
| Decreto-Lei (Government Decree-Law) | 493 |
| Lei (Act of Parliament) | 395 |
| Portaria (Ministerial Order) | 138 |
| Resolucao (Resolution) | 46 |
| Decreto (Decree) | 35 |
| Regulamento (Regulation) | 22 |
| Despacho (Dispatch) | 11 |
| Act | Portuguese Name | Significance |
|---|---|---|
| Lei 58/2019 | Lei de execucao do RGPD | Portuguese GDPR implementation; age of digital consent at 13 |
| Lei 46/2018 | Regime juridico da seguranca do ciberespaco | NIS Directive transposition; CNCS as competent authority |
| Lei 109/2009 | Lei do Cibercrime | Budapest Convention transposition; cybercrime offences |
| Constituicao | Constituicao da Republica Portuguesa | Art. 35 -- explicit digital rights and data protection |
| Codigo Penal | Codigo Penal | Privacy violations (Art. 193-194), computer fraud (Art. 221) |
| CSC | Codigo das Sociedades Comerciais | Commercial company law, corporate governance |
| DL 7/2004 | Lei do Comercio Eletronico | E-Commerce Directive transposition |
| Lei 16/2022 | Lei das Comunicacoes Eletronicas | EECC transposition |
Verified data only -- every article is ingested from PGDL (Procuradoria-Geral Distrital de Lisboa), the official consolidated legislation database. Zero LLM-generated content.
| Tool | Description |
|---|---|
search_legislation | FTS5 search on 56,955 provisions with BM25 ranking |
get_provision | Retrieve specific article by law identifier + article number |
list_sources | List all 1,130 laws in the database with metadata |
validate_citation | Validate citation against database (zero-hallucination check) |
build_legal_stance | Aggregate citations from multiple statutes |
format_citation | Format citations per Portuguese conventions (Diario da Republica) |
check_currency | Check if statute is in force, amended, or repealed |
about | Server metadata and corpus statistics |
| Tool | Description |
|---|---|
get_eu_basis | Get EU directives/regulations for Portuguese statute |
get_portuguese_implementations | Find Portuguese laws implementing EU act |
search_eu_implementations | Search EU documents with Portuguese implementation counts |
get_provision_eu_basis | Get EU law references for specific provision |
validate_eu_compliance | Check implementation status |
All content is sourced from authoritative Portuguese legal databases:
Full provenance metadata:
sources.yml
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 |
See SECURITY.md for the full policy and vulnerability reporting.
THIS TOOL IS NOT LEGAL ADVICE
Statute text is sourced from official PGDL/DRE publications. However:
- This is a research tool, not a substitute for professional legal counsel
- Verify critical citations against primary sources (dre.pt) for court filings
- EU cross-references are auto-extracted from statute text, not EUR-Lex full text
Before using professionally, read: DISCLAIMER.md | PRIVACY.md
git clone https://github.com/Ansvar-Systems/portuguese-law-mcp
cd portuguese-law-mcp
npm install
npm run build
npm test
npm run census # Enumerate all laws from PGDL
npm run ingest # Full ingestion from census
npm run ingest -- --resume # Resume interrupted ingestion
npm run ingest -- --limit 5 # Test with 5 laws
npm run build:db # Rebuild SQLite database
npm run check-updates # Check for amendments
npm run drift:detect # Detect data drift
npm run dev # Start MCP server
npx @anthropic/mcp-inspector node dist/index.js # Test with MCP Inspector
This MCP includes 12 golden contract tests covering:
Run with: npm run test:contract
Apache-2.0 -- see LICENSE
We build AI-accelerated compliance and legal research tools. This MCP server makes Portuguese law searchable, cross-referenceable, and AI-readable -- so navigating 1,130 statutes doesn't require manual DRE browsing.
Built with care by Ansvar Systems
FAQs
Portuguese law database with 1,130 statutes and 56,955 provisions covering full Portuguese consolidated legislation (Leis, Decretos-Lei, Codigos, Portarias) with full-text search
We found that @ansvar/portuguese-law-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.