{
  "markdown": "# Danish Law MCP Server\n\n<!-- ANSVAR-CTA-BEGIN -->\n> **The Danish law corpus is now served through the Ansvar Gateway.** Connect your AI assistant (Claude, Copilot, Cursor, or any MCP client) to `https://gateway.ansvar.eu/mcp` — one OAuth connection, free tier available, covering this corpus plus EU regulations, national law across 28 audited jurisdictions (Europe + the US), and CVE/security intelligence, every result with a verbatim source citation. Start at https://ansvar.eu/docs/quickstart\n\n### Connect\n\n**Claude Code** (one line):\n\n```bash\nclaude mcp add ansvar --transport http https://gateway.ansvar.eu/mcp\n```\n\n**Claude Desktop / Cursor** — add to `claude_desktop_config.json` (or `mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"ansvar\": {\n      \"type\": \"url\",\n      \"url\": \"https://gateway.ansvar.eu/mcp\"\n    }\n  }\n}\n```\n\n**Claude.ai** — Settings → Connectors → Add custom connector → paste `https://gateway.ansvar.eu/mcp`\n\nFirst request opens an OAuth signup flow (setup details: [ansvar.eu/docs/quickstart](https://ansvar.eu/docs/quickstart)). After signup, your client is bound to your account; tier (free / premium / team / company) determines fan-out, quota, and which downstream MCPs are reachable.\n\n---\n\n## Self-host this MCP\n\nYou can also clone this repo and build the corpus yourself. The schema,\nfetcher, and tool implementations all live here. What is not in the repo is\nthe pre-built database — TDM and standards-licensing constraints on the\nupstream sources mean we host the corpus on Ansvar infrastructure rather\nthan redistribute it as a public artifact.\n\nBuild your own: run this repo's ingestion script (entry-point varies per\nrepo — typically `scripts/ingest.sh`, `npm run ingest`, or `make ingest`;\ncheck the repo root).\n<!-- ANSVAR-CTA-END -->\n\n\n**The Retsinformation alternative for the AI age.**\n\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![GitHub stars](https://img.shields.io/github/stars/Ansvar-Systems/Denmark-law-mcp?style=social)](https://github.com/Ansvar-Systems/Denmark-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/Denmark-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/Denmark-law-mcp/actions/workflows/ci.yml)\n[![Daily Data Check](https://github.com/Ansvar-Systems/Denmark-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/Denmark-law-mcp/actions/workflows/check-updates.yml)\n[![Database](https://img.shields.io/badge/database-pre--built-green)](docs/EU_INTEGRATION_GUIDE.md)\n[![Provisions](https://img.shields.io/badge/provisions-620%2C940-blue)](docs/EU_INTEGRATION_GUIDE.md)\n\nQuery **62,764 Danish laws** -- from Databeskyttelsesloven and Straffeloven to Selskabsloven, Forvaltningsloven, and more -- directly from Claude, Cursor, or any MCP-compatible client.\n\nIf you're building legal tech, compliance tools, or doing Danish legal research, this is your verified reference database.\n\nBuilt by [Ansvar Systems](https://ansvar.eu) -- Stockholm, Sweden\n\n---\n\n## Why This Exists\n\nDanish legal research means navigating retsinformation.dk, cross-referencing between lovbekendtgørelser (consolidated laws), forslag (bills), betænkninger (committee reports), and EUR-Lex. Whether you're:\n\n- A **lawyer** validating citations in a brief or contract\n- A **compliance officer** checking Databeskyttelsesloven obligations or GDPR alignment\n- A **legal tech developer** building tools on Danish law\n- A **researcher** tracing legislative history from lovforslag to enacted statute\n\n...you shouldn't need dozens of browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes Danish law **searchable, cross-referenceable, and AI-readable**.\n\n---\n\n## Example Queries\n\nOnce connected, just ask naturally -- in Danish or English:\n\n- *\"Hvad siger Databeskyttelsesloven § 5 om behandling af personoplysninger?\"*\n- *\"Er Straffelovens § 263 om hacking stadig i kraft?\"*\n- *\"Find bestemmelser om offentlighedsprincippet\"*\n- *\"Hvad siger konkurrenceretten om misbrug af dominerende stilling?\"*\n- *\"Valider citatet 'Straffelovens § 263'\"*\n- *\"Opbyg en juridisk argumentation om GDPR-forpligtelser for virksomheder\"*\n- *\"Which Danish laws implement the GDPR?\"*\n- *\"What does Forvaltningsloven say about administrative procedures?\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Laws** | 62,764 laws | Complete corpus from retsinformation.dk |\n| **Provisions** | 620,940 sections | Full-text searchable with FTS5 |\n| **Premium: Case Law** | 3,918 rulings | Højesteret, Landsretter decisions |\n| **Premium: Preparatory Works** | 4,412 documents | Lovforslag, betænkninger |\n| **Database Size** | 1.6 GB | Optimized SQLite, hosted on Fly.io |\n| **Daily Updates** | Automated | Freshness checks against retsinformation.dk |\n\n**Verified data only** -- every citation is validated against official sources (retsinformation.dk). Zero LLM-generated content.\n\n---\n\n## See It In Action\n\n### Why This Works\n\n**Verbatim Source Text (No LLM Processing):**\n- All statute text is ingested from retsinformation.dk (Danish Ministry of Justice)\n- Provisions are returned **unchanged** from SQLite FTS5 database rows\n- Zero LLM summarization or paraphrasing -- the database contains statute text, not AI interpretations\n\n**Smart Context Management:**\n- Search returns ranked provisions with BM25 scoring (safe for context)\n- Provision retrieval gives exact text by law identifier + paragraph/section\n- Cross-references help navigate without loading everything at once\n\n**Technical Architecture:**\n```\nretsinformation.dk API --> Parse --> SQLite --> FTS5 snippet() --> MCP response\n                            ^                        ^\n                     Provision parser         Verbatim database query\n```\n\n### Traditional Research vs. This MCP\n\n| Traditional Approach | This MCP Server |\n|---------------------|-----------------|\n| Search retsinformation.dk by document number | Search by plain Danish: *\"personoplysninger samtykke\"* |\n| Navigate multi-paragraph statutes manually | Get the exact provision with context |\n| Manual cross-referencing between laws | `build_legal_stance` aggregates across sources |\n| \"Er denne lov stadig i kraft?\" → check manually | `check_currency` tool → answer in seconds |\n| Find EU basis → dig through EUR-Lex | `get_eu_basis` → linked EU directives instantly |\n| Check multiple sites for amendments | Daily automated freshness checks |\n| No API, no integration | MCP protocol → AI-native |\n\n**Traditional:** Search retsinformation.dk → Download PDF → Ctrl+F → Cross-reference with betænkning → Check EUR-Lex for EU basis → Repeat\n\n**This MCP:** *\"Hvad er EU-retsgrundlaget for Databeskyttelsesloven § 5 om samtykke?\"* → Done.\n\n---\n\n## Available Tools (13)\n\n### Core Legal Research Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `search_legislation` | FTS5 search on 620,940 provisions with BM25 ranking. Supports quoted phrases, boolean operators, prefix wildcards |\n| `get_provision` | Retrieve specific provision by law identifier + paragraph/section (e.g., \"Straffeloven\" + \"263\") |\n| `check_currency` | Check if a law is in force, amended, or repealed |\n| `validate_citation` | Validate citation against database -- zero-hallucination check. Supports \"Straffelovens § 263\", \"Databeskyttelsesloven § 5\" |\n| `build_legal_stance` | Aggregate citations from multiple laws for a legal topic |\n| `format_citation` | Format citations per Danish conventions (full/short/pinpoint) |\n| `list_sources` | List all available laws with metadata, coverage scope, and data provenance |\n| `about` | Server info, capabilities, dataset statistics, and coverage summary |\n\n### EU Law Integration Tools (5)\n\n| Tool | Description |\n|------|-------------|\n| `get_eu_basis` | Get EU directives/regulations that a Danish statute transposes (e.g., Databeskyttelsesloven → GDPR) |\n| `get_danish_implementations` | Find Danish laws implementing a specific EU act |\n| `search_eu_implementations` | Search EU documents with Danish implementation counts |\n| `get_provision_eu_basis` | Get EU law references for a specific provision |\n| `validate_eu_compliance` | Check transposition status of Danish statutes against EU directives |\n\n---\n\n## EU Law Integration\n\nDenmark is a full EU member state. Danish law directly transposes EU directives into national legislation:\n\n| Danish Law | EU Basis |\n|-----------|----------|\n| **Databeskyttelsesloven** | GDPR (Regulation 2016/679) |\n| **Implementeret e-Privacy** | ePrivacy Directive (2002/58/EC) |\n| **Konkurrenceretten** | EU Treaty Articles 101-102 (TFEU) |\n\nThe EU integration tools support bi-directional lookup: find which EU act a Danish statute transposes, or find all Danish laws implementing a given EU regulation.\n\n> **Denmark and EU opt-outs:** Denmark maintains opt-outs from certain EU policy areas (including Justice and Home Affairs, under Protocol 22 to the Maastricht Treaty). However, data protection law (GDPR), commercial law, and competition law are all fully aligned with EU frameworks. The EU tools in this MCP reflect full transposition coverage for these areas.\n\nSee [EU_INTEGRATION_GUIDE.md](docs/EU_INTEGRATION_GUIDE.md) for detailed documentation and [EU_USAGE_EXAMPLES.md](docs/EU_USAGE_EXAMPLES.md) for practical examples.\n\n---\n\n## Data Sources & Freshness\n\nAll content is sourced from authoritative Danish legal databases:\n\n- **[Retsinformation](https://retsinformation.dk/)** -- The official Danish law portal, operated by the Danish Ministry of Justice. Provides the complete corpus of consolidated Danish laws (lovbekendtgørelser), acts (love), and statutory orders (bekendtgørelser).\n- **[EUR-Lex](https://eur-lex.europa.eu/)** -- Official EU law database (metadata only)\n\n### Data Provenance\n\n| Field | Value |\n|-------|-------|\n| **Authority** | Danish Ministry of Justice / Retsinformation |\n| **Retrieval method** | Bulk download from retsinformation.dk API |\n| **Language** | Danish (primary) |\n| **License** | `DK-Statutory-PD` — Danish statutory public domain (Ophavsretsloven §9) |\n| **Coverage** | All 62,764 consolidated Danish laws |\n| **Last ingested** | 2026-02-22 |\n\n### Automated Freshness Checks (Daily)\n\nA [daily GitHub Actions workflow](.github/workflows/check-updates.yml) monitors retsinformation.dk for changes:\n\n| Source | Check | Method |\n|--------|-------|--------|\n| **Law amendments** | retsinformation.dk API date comparison | All 62,764 laws checked |\n| **New laws** | retsinformation.dk publications (90-day window) | Diffed against database |\n| **Case law** | Court portal entry count | Compared to database |\n| **Preparatory works** | Lovforslag API (30-day window) | New proposals detected |\n| **EU reference staleness** | Git commit timestamps | Flagged if >90 days old |\n\nThe workflow supports `auto_update: true` dispatch for automated sync, rebuild, version bump, and npm publishing.\n\n---\n\n## Premium Tier\n\nThe premium tier adds version history, amendment tracking, and extended case law coverage:\n\n| Feature | Free | Premium |\n|---------|------|---------|\n| Full statute corpus (62,764 laws) | Yes | Yes |\n| Full-text search (620,940 provisions) | Yes | Yes |\n| EU law cross-references | Yes | Yes |\n| Citation validation | Yes | Yes |\n| Case law (3,918 rulings) | No | Yes |\n| Preparatory works (4,412 documents) | No | Yes |\n| Amendment history (`get_*_history`) | No | Yes |\n| Version diff (`diff_*`) | No | Yes |\n| Recent changes (`get_recent_changes`) | No | Yes |\n\nPremium is enabled via the `PREMIUM_ENABLED` environment variable. Contact [hello@ansvar.ai](mailto:hello@ansvar.ai) for access.\n\n---\n\n## Security\n\nThis project uses multiple layers of automated security scanning:\n\n| Scanner | What It Does | Schedule |\n|---------|-------------|----------|\n| **CodeQL** | Static analysis for security vulnerabilities | Weekly + PRs |\n| **Semgrep** | SAST scanning (OWASP top 10, secrets, TypeScript) | Every push |\n| **Gitleaks** | Secret detection across git history | Every push |\n| **Trivy** | CVE scanning on filesystem and npm dependencies | Daily |\n| **Docker Security** | Container image scanning + SBOM generation | Daily |\n| **Socket.dev** | Supply chain attack detection | PRs |\n| **OSSF Scorecard** | OpenSSF best practices scoring | Weekly |\n| **Dependabot** | Automated dependency updates | Weekly |\n\nSee [SECURITY.md](SECURITY.md) for the full policy and vulnerability reporting.\n\n---\n\n## Important Disclaimers\n\n### Legal Advice\n\n> **THIS TOOL IS NOT LEGAL ADVICE**\n>\n> Statute text is sourced from official retsinformation.dk publications (Danish Ministry of Justice). However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Court case coverage in the free tier is limited** -- do not rely solely on this for case law research\n> - **Verify critical citations** against primary sources for court filings\n> - **EU cross-references** are extracted from Danish statute text and EUR-Lex metadata, not substitute for full EUR-Lex legal text\n> - **Municipal and regional regulations are not included** -- this covers national Danish law only\n\n**Before using professionally, read:** [DISCLAIMER.md](DISCLAIMER.md) | [PRIVACY.md](PRIVACY.md)\n\n### Client Confidentiality\n\nQueries go through the Claude API. For privileged or confidential matters, use on-premise deployment. See [PRIVACY.md](PRIVACY.md) for Advokatsamfundet (Danish Bar Association) compliance guidance.\n\n---\n\n## Documentation\n\n- **[EU Integration Guide](docs/EU_INTEGRATION_GUIDE.md)** -- Detailed EU cross-reference documentation\n- **[EU Usage Examples](docs/EU_USAGE_EXAMPLES.md)** -- Practical EU lookup examples\n- **[Security Policy](SECURITY.md)** -- Vulnerability reporting and scanning details\n- **[Disclaimer](DISCLAIMER.md)** -- Legal disclaimers and professional use notices\n- **[Privacy](PRIVACY.md)** -- Client confidentiality and data handling\n\n---\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/Ansvar-Systems/Denmark-law-mcp\ncd Denmark-law-mcp\nnpm install\nnpm run build\nnpm test\n```\n\n### Running Locally\n\n```bash\nnpm run dev                                       # Start MCP server\nnpx @anthropic/mcp-inspector node dist/index.js   # Test with MCP Inspector\n```\n\n### Data Management\n\n```bash\nnpm run ingest                             # Ingest laws from retsinformation.dk\nnpm run ingest:auto-all -- --scope all-laws --dry-run  # Coverage audit\nnpm run ingest:auto-all -- --scope all-laws             # Ingest full corpus\nnpm run ingest:cases:full-archive          # Ingest case law (full archive)\nnpm run sync:cases                         # Ingest case law (incremental)\nnpm run sync:prep-works                    # Sync preparatory works\nnpm run extract:definitions                # Extract legal definitions\nnpm run build:db                           # Rebuild SQLite database\nnpm run check-updates                      # Check for amendments\nnpm run drift:detect                       # Run drift detection\n```\n\n### Performance\n\n- **Search Speed:** <100ms for most FTS5 queries\n- **Database Size:** 1.6 GB (Fly.io deployment due to size)\n- **Reliability:** 100% ingestion success rate\n\n---\n\n## More Ansvar MCPs\n\nFull fleet coverage at [ansvar.eu/coverage](https://ansvar.eu/coverage).\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nPriority areas:\n- Court case law expansion (Højesteret and Landsretter full archives)\n- EU Regulations MCP integration (full EU law text, CJEU case law)\n- Historical statute versions and amendment tracking\n- Lower court decisions (Byretter archives)\n- English translations for key statutes\n\n---\n\n## Roadmap\n\n- [x] **Full corpus ingestion** -- 62,764 Danish laws from retsinformation.dk\n- [x] **EU law integration** -- Danish statute transposition cross-references\n- [x] **Premium tier** -- case law (3,918 rulings) and preparatory works (4,412 documents)\n- [x] **Fly.io deployment** -- 1.6 GB database hosted on Fly.io\n- [ ] Court case law expansion (Byretter full archives)\n- [ ] Historical statute versions (amendment tracking)\n- [ ] English translations for key statutes\n- [ ] Web API for programmatic access\n\n---\n\n## Citation\n\nIf you use this MCP server in academic research:\n\n```bibtex\n@software{danish_law_mcp_2026,\n  author = {Ansvar Systems AB},\n  title = {Danish Law MCP Server: Production-Grade Legal Research Tool},\n  year = {2026},\n  url = {https://github.com/Ansvar-Systems/Denmark-law-mcp},\n  note = {Comprehensive Danish legal database with 62,764 laws and 620,940 provisions from retsinformation.dk}\n}\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE) for details.\n\n### Data Licenses\n\n- **Laws & Statutory Orders:** `DK-Statutory-PD` — Danish statutory public domain. Ophavsretsloven §9 excludes laws, administrative orders, regulations, court decisions, and similar acts issued by a public authority from copyright protection. Verified verbatim 2026-05-17 — see [`docs/audits/2026-05-17-eu-copyright-statutory-works-batch-1a-AT-BE-DK-FI-FR.md`](https://github.com/Ansvar-Systems/Ansvar-Architecture-Documentation/blob/main/docs/audits/2026-05-17-eu-copyright-statutory-works-batch-1a-AT-BE-DK-FI-FR.md). Catalog entry: `DK-Statutory-PD` in `infrastructure/attribution-licenses.json`.\n- **Case Law:** Højesteret and Landsretter — same statutory basis (Ophavsretsloven §9 court-decision clause)\n- **EU Metadata:** EUR-Lex (EU public domain, Decision 2011/833/EU)\n\n---\n\n## About Ansvar Systems\n\nWe build AI-accelerated compliance and legal research tools for the European market. This MCP server started as our internal reference tool for Danish law -- turns out everyone building for the Danish and Nordic markets has the same research frustrations.\n\nSo we're open-sourcing it. Navigating 62,764 laws on retsinformation.dk shouldn't require a law degree.\n\n**[ansvar.eu](https://ansvar.eu)** -- Stockholm, Sweden\n\n---\n\n<p align=\"center\">\n  <sub>Built with care in Stockholm, Sweden</sub>\n</p>\n",
  "bytes": 18179,
  "sha": "d1af939bcf2c226b12a48d04c3d7c6bf5f3d5604120450c295d7b20d18f6e442",
  "repo_slug": "ansvar-systems/denmark-law-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_eu_ansvar_danish_law_mcp_8d1d49e4/readme"
}