{"_id":"@ansvar/finnish-law-mcp","_rev":"2-7238fea93f1db042c6b617be526e01f2","name":"@ansvar/finnish-law-mcp","dist-tags":{"latest":"1.2.3"},"versions":{"1.2.3":{"name":"@ansvar/finnish-law-mcp","version":"1.2.3","keywords":["mcp","model-context-protocol","ai","claude","finnish-law","finland","legal","compliance","finlex","suomi","ansvar"],"author":{"name":"Ansvar Systems AB","email":"hello@ansvar.ai"},"license":"Apache-2.0","_id":"@ansvar/finnish-law-mcp@1.2.3","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"homepage":"https://github.com/Ansvar-Systems/finnish-law-mcp#readme","bugs":{"url":"https://github.com/Ansvar-Systems/finnish-law-mcp/issues"},"bin":{"finnish-law-mcp":"dist/index.js"},"dist":{"shasum":"b47602e66ff651d1b2eaff260ee1e64b2e89e7bc","tarball":"https://registry.npmjs.org/@ansvar/finnish-law-mcp/-/finnish-law-mcp-1.2.3.tgz","fileCount":155,"integrity":"sha512-Ej+56hTpk9frgIYQuh62sWBHIRTt4pXC9SGpv39mxRhMFYqVzKAUUksuopK21dmkmEQ7MKVjjccUHNWS+EN+WQ==","signatures":[{"sig":"MEYCIQDjL2nvHaNA+0i+WEwn30pM0a1ANJuCq5wJYBLrLzj+BwIhAOK9Ky+SpTkc+V2INwANS+g3rKipTe3owSjcMxdv7k+B","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":368880},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"gitHead":"d20427815debd5c640773e62174e234d9203b7db","mcpName":"eu.ansvar/finnish-law-mcp","scripts":{"dev":"node --import tsx src/index.ts","lint":"eslint src tests","test":"vitest run","build":"tsc","start":"node dist/index.js","ingest":"node --import tsx scripts/ingest-finlex.ts","build:db":"node --import tsx scripts/build-db.ts","validate":"npm run lint && npm test && npm run test:contract","sync:cases":"node --import tsx scripts/sync-lagennu-cases.ts","test:watch":"vitest","audit:seeds":"node --import tsx scripts/audit-seeds.ts","ingest:bulk":"node --import tsx scripts/ingest-finlex-bulk.ts","postinstall":"test -d dist || npm run build || true","drift:detect":"node --import tsx scripts/drift-detect.ts","fetch:eurlex":"node --import tsx scripts/fetch-eurlex-metadata.ts","ingest:cases":"node --import tsx scripts/ingest-lagennu-cases.ts","build:db:paid":"node --import tsx scripts/build-db-paid.ts","check-updates":"node --import tsx scripts/check-updates.ts","test:contract":"vitest run __tests__/contract/","test:coverage":"vitest run --coverage","ingest:current":"node --import tsx scripts/ingest-finlex-current.ts","prepublishOnly":"npm run build","sync:cases:full":"node --import tsx scripts/sync-lagennu-cases.ts --full","sync:prep-works":"node --import tsx scripts/ingest-preparatory-works.ts","verify:eu-coverage":"node --import tsx scripts/verify-eu-coverage.ts","extract:definitions":"node --import tsx scripts/extract-definitions.ts","migrate:eu-references":"node --import tsx scripts/migrate-eu-references.ts","import:eurlex-documents":"node --import tsx scripts/import-eurlex-documents.ts","ingest:cases:full-archive":"node --import tsx scripts/ingest-lagennu-full-archive.ts"},"_npmUser":{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"},"repository":{"url":"git+https://github.com/Ansvar-Systems/finnish-law-mcp.git","type":"git"},"_npmVersion":"11.6.2","description":"Production-grade Finnish legal research MCP server with Finlex statute coverage and EU law cross-references","directories":{},"_nodeVersion":"25.2.1","dependencies":{"@ansvar/mcp-sqlite":"^1.0.3","@modelcontextprotocol/sdk":"^1.25.3"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","jsdom":"^27.4.0","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^22.15.29","@types/jsdom":"^21.1.7","@vercel/node":"^5.6.3","fast-xml-parser":"^5.3.5","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/finnish-law-mcp_1.2.3_1771572412975_0.40099917957032805","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Ansvar MCP servers are now distributed as source from github.com/Ansvar-Systems/finnish-law-mcp under Apache 2.0. Self-hosting instructions: see the repo README. Hosted gateway: ansvar.eu"}},"time":{"created":"2026-02-20T07:26:52.862Z","modified":"2026-05-02T05:46:56.795Z","1.2.3":"2026-02-20T07:26:53.122Z"},"bugs":{"url":"https://github.com/Ansvar-Systems/finnish-law-mcp/issues"},"author":{"name":"Ansvar Systems AB","email":"hello@ansvar.ai"},"license":"Apache-2.0","homepage":"https://github.com/Ansvar-Systems/finnish-law-mcp#readme","keywords":["mcp","model-context-protocol","ai","claude","finnish-law","finland","legal","compliance","finlex","suomi","ansvar"],"repository":{"url":"git+https://github.com/Ansvar-Systems/finnish-law-mcp.git","type":"git"},"description":"Production-grade Finnish legal research MCP server with Finlex statute coverage and EU law cross-references","maintainers":[{"name":"ansvar","email":"jeffrey.von.rotz@ansvar.eu"}],"readme":"# Swedish Law MCP Server\n\n**The Riksdagen alternative for the AI age.**\n\n[![npm version](https://badge.fury.io/js/@ansvar%2Fswedish-law-mcp.svg)](https://www.npmjs.com/package/@ansvar/swedish-law-mcp)\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/swedish-law-mcp?style=social)](https://github.com/Ansvar-Systems/swedish-law-mcp)\n[![CI](https://github.com/Ansvar-Systems/swedish-law-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ansvar-Systems/swedish-law-mcp/actions/workflows/ci.yml)\n[![Daily Data Check](https://github.com/Ansvar-Systems/swedish-law-mcp/actions/workflows/check-updates.yml/badge.svg)](https://github.com/Ansvar-Systems/swedish-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-31%2C198-blue)](docs/EU_INTEGRATION_GUIDE.md)\n\nQuery **717 Swedish statutes** -- from Dataskyddslagen and Brottsbalken to Aktiebolagslagen, Miljöbalken, and more -- directly from Claude, Cursor, or any MCP-compatible client.\n\nIf you're building legal tech, compliance tools, or doing Swedish 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\nSwedish legal research is scattered across Riksdagen, SFS publications, lagen.nu, and EUR-Lex. Whether you're:\n- A **lawyer** validating citations in a brief or contract\n- A **compliance officer** checking if a statute is still in force\n- A **legal tech developer** building tools on Swedish law\n- A **researcher** tracing legislative history from proposition to statute\n\n...you shouldn't need 47 browser tabs and manual PDF cross-referencing. Ask Claude. Get the exact provision. With context.\n\nThis MCP server makes Swedish law **searchable, cross-referenceable, and AI-readable**.\n\n---\n\n## Quick Start\n\n### Use Remotely (No Install Needed)\n\n> Connect directly to the hosted version — zero dependencies, nothing to install.\n\n**Endpoint:** `https://swedish-law-mcp.vercel.app/mcp`\n\n| Client | How to Connect |\n|--------|---------------|\n| **Claude.ai** | Settings > Connectors > Add Integration > paste URL |\n| **Claude Code** | `claude mcp add swedish-law --transport http https://swedish-law-mcp.vercel.app/mcp` |\n| **Claude Desktop** | Add to config (see below) |\n| **GitHub Copilot** | Add to VS Code settings (see below) |\n\n**Claude Desktop** — add to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"swedish-law\": {\n      \"type\": \"url\",\n      \"url\": \"https://swedish-law-mcp.vercel.app/mcp\"\n    }\n  }\n}\n```\n\n**GitHub Copilot** — add to VS Code `settings.json`:\n\n```json\n{\n  \"github.copilot.chat.mcp.servers\": {\n    \"swedish-law\": {\n      \"type\": \"http\",\n      \"url\": \"https://swedish-law-mcp.vercel.app/mcp\"\n    }\n  }\n}\n```\n\n### Use Locally (npm)\n\n```bash\nnpx @ansvar/swedish-law-mcp\n```\n\n**Claude Desktop** — add to `claude_desktop_config.json`:\n\n**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"swedish-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/swedish-law-mcp\"]\n    }\n  }\n}\n```\n\n**Cursor / VS Code:**\n\n```json\n{\n  \"mcp.servers\": {\n    \"swedish-law\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ansvar/swedish-law-mcp\"]\n    }\n  }\n}\n```\n\n## Example Queries\n\nOnce connected, just ask naturally:\n\n- *\"What does Dataskyddslagen 3 kap. 5 § say about consent?\"*\n- *\"Is PUL (1998:204) still in force?\"*\n- *\"Find provisions about personuppgifter in Swedish law\"*\n- *\"What EU directives does DSL implement?\"*\n- *\"Which Swedish laws implement the GDPR?\"*\n- *\"Get the preparatory works for Dataskyddslagen\"*\n- *\"Compare incident reporting requirements across NIS2 Swedish implementations\"*\n- *\"Validate the citation NJA 2020 s. 45\"*\n- *\"Find Labour Court cases about discrimination from 2020-2023\"*\n\n---\n\n## What's Included\n\n| Category | Count | Details |\n|----------|-------|---------|\n| **Statutes** | 717 laws | Comprehensive Swedish legislation |\n| **Provisions** | 31,198 sections | Full-text searchable with FTS5 |\n| **Preparatory Works** | 3,625 documents | Propositions (Prop.) and SOUs |\n| **EU Cross-References** | 668 references | 228 EU directives and regulations |\n| **Legal Definitions** | 615 terms | Extracted from statute text |\n| **Database Size** | ~70 MB | Optimized SQLite, portable |\n| **Daily Updates** | Automated | Freshness checks against Riksdagen |\n\n**Verified data only** -- every citation is validated against official sources (Riksdagen, lagen.nu, EUR-Lex). 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 Riksdagen/SFS 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 SFS number + chapter/section\n- Cross-references help navigate without loading everything at once\n\n**Technical Architecture:**\n```\nRiksdagen 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 Riksdagen by SFS number | Search by plain Swedish: *\"personuppgifter samtycke\"* |\n| Navigate multi-chapter statutes manually | Get the exact provision with context |\n| Manual cross-referencing between laws | `build_legal_stance` aggregates across sources |\n| \"Is this statute still in force?\" → 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 5+ sites for updates | Daily automated freshness checks |\n| No API, no integration | MCP protocol → AI-native |\n\n**Traditional:** Search Riksdagen → Download SFS PDF → Ctrl+F → Cross-reference with proposition → Check EUR-Lex for EU basis → Repeat\n\n**This MCP:** *\"What EU law is the basis for DSL 3 kap. 5 § about consent?\"* → 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 31,198 provisions with BM25 ranking |\n| `get_provision` | Retrieve specific provision by SFS + chapter/section |\n| `search_case_law` | FTS5 search on case law with court/date filters |\n| `get_preparatory_works` | Get linked propositions and SOUs for a statute |\n| `validate_citation` | Validate citation against database (zero-hallucination check) |\n| `build_legal_stance` | Aggregate citations from statutes, case law, prep works |\n| `format_citation` | Format citations per Swedish conventions (full/short/pinpoint) |\n| `check_currency` | Check if statute is in force, amended, or repealed |\n\n### EU Law Integration Tools (5)\n\n| Tool | Description |\n|------|-------------|\n| `get_eu_basis` | Get EU directives/regulations for Swedish statute |\n| `get_swedish_implementations` | Find Swedish laws implementing EU act |\n| `search_eu_implementations` | Search EU documents with Swedish implementation counts |\n| `get_provision_eu_basis` | Get EU law references for specific provision |\n| `validate_eu_compliance` | Check implementation status (future, requires EU MCP) |\n\n---\n\n## EU Law Integration\n\n**668 cross-references** linking 49 Swedish statutes to EU law, with bi-directional lookup.\n\n| Metric | Value |\n|--------|-------|\n| **EU References** | 668 cross-references |\n| **EU Documents** | 228 unique directives and regulations |\n| **Swedish Statutes with EU Refs** | 49 (68% of database) |\n| **Directives** | 89 |\n| **Regulations** | 139 |\n| **EUR-Lex Integration** | Automated metadata fetching |\n\n### Most Referenced EU Acts\n\n1. **eIDAS Regulation** (910/2014) - 20 references\n2. **E-Signatures Directive** (1999/93) - 15 references\n3. **GDPR** (2016/679) - 15 references\n4. **Data Protection Directive** (1995/46) - 14 references\n5. **Market Surveillance Regulation** (2019/1020) - 14 references\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 Swedish legal databases:\n\n- **[Riksdagen](https://riksdagen.se/)** -- Swedish Parliament's official legal database\n- **[Svensk Forfattningssamling](https://svenskforfattningssamling.se/)** -- Official statute collection\n- **[Lagen.nu](https://lagen.nu)** -- Case law database (CC-BY Domstolsverket)\n- **[EUR-Lex](https://eur-lex.europa.eu/)** -- Official EU law database (metadata only)\n\n### Automated Freshness Checks (Daily)\n\nA [daily GitHub Actions workflow](.github/workflows/check-updates.yml) monitors all data sources:\n\n| Source | Check | Method |\n|--------|-------|--------|\n| **Statute amendments** | Riksdagen API date comparison | All 717 statutes checked |\n| **New statutes** | Riksdagen SFS publications (90-day window) | Diffed against database |\n| **Case law** | lagen.nu feed entry count | Compared to database |\n| **Preparatory works** | Riksdagen proposition API (30-day window) | New props 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## 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 Riksdagen/SFS publications. However:\n> - This is a **research tool**, not a substitute for professional legal counsel\n> - **Court case coverage 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 Swedish statute text, not EUR-Lex full text\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 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/swedish-law-mcp\ncd swedish-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 -- <sfs-number> <output.json>   # Ingest statute from Riksdagen\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\n```\n\n### Performance\n\n- **Search Speed:** <100ms for most FTS5 queries\n- **Database Size:** ~70 MB (efficient, portable)\n- **Reliability:** 100% ingestion success rate\n\n---\n\n## Related Projects: Complete Compliance Suite\n\nThis server is part of **Ansvar's Compliance Suite** -- MCP servers that work together for end-to-end compliance coverage:\n\n### [@ansvar/eu-regulations-mcp](https://github.com/Ansvar-Systems/EU_compliance_MCP)\n**Query 49 EU regulations directly from Claude** -- GDPR, AI Act, DORA, NIS2, MiFID II, eIDAS, and more. Full regulatory text with article-level search. `npx @ansvar/eu-regulations-mcp`\n\n### @ansvar/swedish-law-mcp (This Project)\n**Query 717 Swedish statutes directly from Claude** -- DSL, BrB, ABL, MB, and more. Full provision text with EU cross-references. `npx @ansvar/swedish-law-mcp`\n\n### [@ansvar/us-regulations-mcp](https://github.com/Ansvar-Systems/US_Compliance_MCP)\n**Query US federal and state compliance laws** -- HIPAA, CCPA, SOX, GLBA, FERPA, and more. `npm install @ansvar/us-regulations-mcp`\n\n### [@ansvar/ot-security-mcp](https://github.com/Ansvar-Systems/ot-security-mcp)\n**Query IEC 62443, NIST 800-82/53, and MITRE ATT&CK for ICS** -- Specialized for OT/ICS environments. `npx @ansvar/ot-security-mcp`\n\n### [@ansvar/automotive-cybersecurity-mcp](https://github.com/Ansvar-Systems/Automotive-MCP)\n**Query UNECE R155/R156 and ISO 21434** -- Automotive cybersecurity compliance. `npx @ansvar/automotive-cybersecurity-mcp`\n\n### [@ansvar/sanctions-mcp](https://github.com/Ansvar-Systems/Sanctions-MCP)\n**Offline-capable sanctions screening** -- OFAC, EU, UN sanctions lists. `pip install ansvar-sanctions-mcp`\n\n---\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nPriority areas:\n- Court case law expansion (currently limited coverage)\n- EU Regulations MCP integration (full EU law text, CJEU case law)\n- Historical statute versions and amendment tracking\n- Lower court decisions (Tingsrätt, Hovrätt)\n\n---\n\n## Roadmap\n\n- [x] **Statute expansion** -- 785% growth from 81 to 717 statutes (v1.1.0)\n- [x] **EU law integration** -- 668 cross-references to 228 EU directives/regulations (v1.1.0)\n- [ ] Court case law expansion (scraper updated, re-ingestion needed for 12K-18K cases)\n- [ ] Full EU text integration (via @ansvar/eu-regulations-mcp)\n- [ ] Lower court coverage (Tingsrätt, Hovrätt 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{swedish_law_mcp_2025,\n  author = {Ansvar Systems AB},\n  title = {Swedish Law MCP Server: Production-Grade Legal Research Tool},\n  year = {2025},\n  url = {https://github.com/Ansvar-Systems/swedish-law-mcp},\n  note = {Comprehensive Swedish legal database with 717 statutes 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 & Propositions:** Swedish Government (public domain)\n- **Case Law:** CC-BY Domstolsverket (via lagen.nu)\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. This MCP server started as our internal reference tool for Swedish law -- turns out everyone building for the Swedish market has the same research frustrations.\n\nSo we're open-sourcing it. Navigating 717 statutes 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","readmeFilename":"README.md"}