{
  "markdown": "# Estonian Law MCP Server\n\n<!-- ANSVAR-CTA-BEGIN -->\n> **The Estonian law corpus is now served through the Ansvar Gateway.** Connect your AI assistant (Claude, Copilot, Cursor, custom MCP client) to `https://gateway.ansvar.eu/mcp` — one OAuth connection, free tier available, covering this corpus plus EU regulations, national law across dozens of 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 Riigi Teataja 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/Estonian-law-mcp?style=social)](https://github.com/Ansvar-Systems/Estonian-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/Estonian-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/Estonian-law-mcp/actions/workflows/ci.yml)\n[![Daily Data Check](https://github.com/Ansvar-Systems/Estonian-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/Estonian-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-63%2C652-blue)](docs/EU_INTEGRATION_GUIDE.md)\n\nQuery **1,602 Estonian statutes** — from the Isikuandmete kaitse seadus (IKS) and the Karistusseadustik to the Tsiviilseadustiku üldosa seadus, Küberturvalisuse seadus, and more — directly from Claude, Cursor, or any MCP-compatible client.\n\nIf you're building legal tech, compliance tools, or doing Estonian 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\nEstonian legal research is concentrated in the Riigi Teataja — Estonia's model e-governance platform — but navigating 1,602 seadused across Estonian and cross-referencing with EUR-Lex remains manual work. Whether you're:\n- A **lawyer** validating citations in a brief or leping\n- A **compliance officer** checking obligations under IKS or the Küberturvalisuse seadus\n- A **legal tech developer** building tools on Estonian law\n- A **researcher** tracing legislative history from eelnõu to seadus\n\n...you shouldn't need a dozen browser tabs and manual cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes Estonian law **searchable, cross-referenceable, and AI-readable**.\n\n---\n\n## Example Queries\n\nOnce connected, just ask naturally (päringud toimivad eesti keeles või inglise keeles):\n\n- *\"Mida ütleb isikuandmete kaitse seaduse (IKS) § 6 isikuandmete töötlemise põhimõtete kohta?\"*\n- *\"Otsida 'isikuandmete kaitse' Eesti õigusaktidest\"*\n- *\"Kas isikuandmete kaitse seadus (RT I, 04.01.2019, 11) on endiselt jõus?\"*\n- *\"Millised on Karistusseadustiku sätted arvutikuritegude kohta?\"*\n- *\"Millised Eesti seadused rakendavad NIS2 direktiivi?\"*\n- *\"Otsida e-allkirja sätteid elektroonilise identimise ja e-tehingute usaldusteenuste seadusest\"*\n- *\"Find provisions about data breach notification in Estonian law\"*\n- *\"Validate the citation 'IKS § 6'\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Statutes** | 1,602 seadust | Comprehensive Estonian legislation from Riigi Teataja |\n| **Provisions** | 63,624 paragrahvi | Full-text searchable with FTS5 |\n| **Premium: Case law** | 0 (free tier) | Riigikohus and circuit court decisions planned |\n| **Premium: Preparatory works** | 163,383 documents | Seaduseelnõud and seletuskirjad |\n| **Premium: Agency guidance** | 0 (free tier) | Andmekaitse Inspektsioon guidance planned |\n| **Database Size** | ~116 MB | Optimized SQLite, portable |\n| **Daily Updates** | Automated | Freshness checks against Riigi Teataja |\n\n**Verified data only** — every citation is validated against official sources (riigiteataja.ee). Zero LLM-generated content.\n\n---\n\n## Why This Works\n\n**Verbatim Source Text (No LLM Processing):**\n- All statute text is ingested from Riigi Teataja (riigiteataja.ee) official sources\n- Provisions are returned **unchanged** from SQLite FTS5 database rows\n- Zero LLM summarization or paraphrasing — the database contains regulation 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 seadus abbreviation + paragraph number\n- Cross-references help navigate without loading everything at once\n\n**Technical Architecture:**\n```\nRiigi Teataja 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 Riigi Teataja by seaduse nimetus | Search by plain Estonian: *\"isikuandmete töötlemine nõusolek\"* |\n| Navigate multi-chapter seadused manually | Get the exact provision with context |\n| Manual cross-referencing between seadused | `build_legal_stance` aggregates across sources |\n| \"Kas see seadus on jõus?\" → check manually | `check_currency` tool → answer in seconds |\n| Find EU basis → dig through EUR-Lex | `get_eu_basis` → linked EU directives instantly |\n| No API, no integration | MCP protocol → AI-native |\n\n**Traditional:** Search Riigi Teataja → Download PDF → Ctrl+F → Cross-reference with EUR-Lex → Check AKI guidance → Repeat\n\n**This MCP:** *\"Mis on IKS § 6 Euroopa õiguslik alus isikuandmete töötlemise põhimõtete kohta?\"* → Done.\n\n---\n\n## Available Tools (13)\n\n### Core Legal Research Tools (8)\n\n| Tool | Description |\n|------|-------------|\n| `search_legislation` | FTS5 full-text search across 63,624 paragrahvi with BM25 ranking. Supports quoted phrases, boolean operators, prefix wildcards |\n| `get_provision` | Retrieve specific provision by seadus abbreviation + paragraph (e.g., \"IKS\" + \"§ 6\") |\n| `check_currency` | Check if a statute is in force (jõus/kehtetud), amended, or repealed |\n| `validate_citation` | Validate citation against database — zero-hallucination check. Supports \"IKS § 6\", \"KarS § 206\" |\n| `build_legal_stance` | Aggregate citations from multiple seadused for a legal topic |\n| `format_citation` | Format citations per Estonian conventions (full/short/pinpoint) |\n| `list_sources` | List all available statutes 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 underlying an Estonian statute |\n| `get_estonian_implementations` | Find Estonian laws implementing a specific EU act |\n| `search_eu_implementations` | Search EU documents with Estonian implementation counts |\n| `get_provision_eu_basis` | Get EU law references for a specific provision |\n| `validate_eu_compliance` | Check implementation status of Estonian statutes against EU directives |\n\n---\n\n## EU Law Integration\n\nEstonia is an **EU member state** (since 2004) and a digital governance pioneer. Estonian e-governance and digital identity legislation directly shaped EU instruments like eIDAS, making Estonia unique as both an implementer and an originator of EU digital law.\n\n| Metric | Value |\n|--------|-------|\n| **EU Member State** | Yes — since 1 May 2004 |\n| **Eurozone** | Yes — since 1 January 2011 |\n| **EU References** | Cross-references linking Estonian statutes to EU law |\n| **Directives transposed** | GDPR, NIS2, DORA, eIDAS, AI Act, PSD2, AML directives, and more |\n| **EUR-Lex Integration** | Automated metadata fetching |\n| **e-Governance** | Estonian digital ID legislation helped define eIDAS standards |\n\n### Key Estonian EU Implementations\n\n- **Isikuandmete kaitse seadus (IKS)** — GDPR national implementation (isikuandmete kaitse)\n- **Küberturvalisuse seadus** — Cybersecurity Act (NIS Directive transposition)\n- **E-identimise ja e-tehingute usaldusteenuste seadus** — eIDAS transposition\n- **Makseasutuste ja e-raha asutuste seadus** — PSD2 transposition\n\nSee [EU_INTEGRATION_GUIDE.md](docs/EU_INTEGRATION_GUIDE.md) for detailed documentation.\n\n---\n\n## Data Sources & Freshness\n\nAll content is sourced from authoritative Estonian legal databases:\n\n- **[Riigi Teataja](https://www.riigiteataja.ee/)** — Official State Gazette of Estonia (Eesti ametlik väljaanne)\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** | Riigi Teataja (Estonian State Gazette) |\n| **Retrieval method** | Riigi Teataja official open data API |\n| **Language** | Estonian |\n| **License** | Public domain (avalik teave) |\n| **Coverage** | 1,602 statutes, 63,624 provisions |\n| **Last ingested** | 2026-02-28 |\n\n### Automated Freshness Checks (Daily)\n\nA [daily GitHub Actions workflow](.github/workflows/check-updates.yml) monitors Riigi Teataja for changes:\n\n| Check | Method |\n|-------|--------|\n| **Statute amendments** | Riigi Teataja date comparison across 1,602 statutes |\n| **New statutes** | Riigi Teataja new publication monitoring |\n| **Repealed statutes** | Kehtetud/jõus status change detection |\n| **EU reference staleness** | Git commit timestamps — flagged if >90 days old |\n\n**Verified data only** — every citation is validated against official sources. Zero LLM-generated content.\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 Riigi Teataja publications. However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Court case coverage is not included** in the free tier — do not rely solely on this for kohtupraktika research\n> - **Verify critical citations** against primary sources (Riigi Teataja) for court filings\n> - **EU cross-references** are extracted from statute text and EUR-Lex metadata, not a complete implementation mapping\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 guidance consistent with **Eesti Advokatuur** (Estonian Bar Association) professional conduct standards.\n\n---\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/Ansvar-Systems/Estonian-law-mcp\ncd Estonian-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 seadused from Riigi Teataja\nnpm run build:db         # Rebuild SQLite database\nnpm run drift:detect     # Run drift detection against anchors\nnpm run check-updates    # Check for amendments\n```\n\n### Performance\n\n- **Search Speed:** <100ms for most FTS5 queries\n- **Database Size:** ~116 MB (efficient, portable)\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 (Riigikohus, ringkonnakohtud)\n- EU cross-reference expansion\n- Historical statute versions and amendment tracking\n- Andmekaitse Inspektsioon guidance documents\n- RIA (Riigi Infosüsteemi Amet) cybersecurity guidance\n\n---\n\n## Roadmap\n\n- [x] Core statute database with FTS5 search (1,602 statutes, 63,624 provisions)\n- [x] EU law integration with bi-directional lookup\n- [x] Premium preparatory works dataset (163,383 documents)\n- [x] Vercel Streamable HTTP deployment\n\n- [ ] Kohtupraktika (court case law) expansion — Riigikohus and ringkonnakohtud\n- [ ] Historical statute versions (amendment tracking)\n- [ ] Andmekaitse Inspektsioon guidance documents\n- [ ] RIA cybersecurity guidance and notices\n\n---\n\n## Citation\n\nIf you use this MCP server in academic research:\n\n```bibtex\n@software{estonian_law_mcp_2026,\n  author = {Ansvar Systems AB},\n  title = {Estonian Law MCP Server: AI-Powered Legal Research Tool},\n  year = {2026},\n  url = {https://github.com/Ansvar-Systems/Estonian-law-mcp},\n  note = {1,602 Estonian statutes with 63,624 provisions and EU law cross-references}\n}\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE) for details.\n\n### Data Licenses\n\n- **Statutes & Legislation:** Riigi Teataja (public domain — avalik teave)\n- **EU Metadata:** EUR-Lex (EU public domain)\n\n---\n\n## About Ansvar Systems\n\nWe build AI-accelerated compliance and legal research tools for the European market. Estonia's leadership in digital governance — from e-residency to blockchain-secured public records — makes it a natural fit for our AI-native legal research tools.\n\nSo we're open-sourcing it. Navigating 1,602 seadused and 63,624 provisions 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": 15553,
  "sha": "d7538c2ad29be5cf0a048162445811674ede94a0b9591de640b9dbdc4f25e8e1",
  "repo_slug": "ansvar-systems/estonian-law-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_eu_ansvar_estonian_law_mcp_42ed527e/readme"
}