Skip to main content

lovspor

Ask an AI assistant about Norwegian law and you get a confident answer — statute name, section number, sometimes a quote. Nothing in that loop checks whether the section actually exists. Lovspor does.

Lovspor keeps an open, daily-updated copy of Norwegian law — close to 6,000 acts and central regulations from Lovdata's public data, with full version history — and gives any AI assistant (Claude Desktop, Claude Code, Cursor, any MCP client) tools to search it, quote it, and verify citations against the real text.

What you can ask

Once connected, your assistant answers from the live corpus instead of stale training data:

  • "What changed in skatteloven this year?"
  • "What did husleieloven § 9-6 say in March 2023?" — full version history, diffable between any two dates
  • "Does this paragraph exist?" — validate_citation answers instead of guessing
  • "Is this quote verbatim?" — verify_quote checks it against the actual text

Quickstart

Requires uv. No clone, no account, no API key.

# 1. Fetch the legal corpus to ~/.cache/lovverk (re-run any time to update)
uvx lovspor fetch-corpus

# 2. Connect your AI client — Claude Code:
claude mcp add lovverk -- uvx lovspor mcp

Other MCP clients (Claude Desktop's claude_desktop_config.json, etc.):

{
  "mcpServers": {
    "lovverk": {
      "command": "uvx",
      "args": ["lovspor", "mcp"]
    }
  }
}

Restart the client and lovverk appears in its MCP list. Fifteen of the sixteen tools work immediately — no key, and no network access beyond your local corpus clone.

Full setup guide, all sixteen tools with examples, troubleshooting and limitations: docs/mcp.md.

What's inside — and what's not

Inside: all current Norwegian acts (lover) and central regulations (sentrale forskrifter) from Lovdata's public-data API, re-synced daily at 04:00 UTC, each with a structured per-act change history. Live count: the corpus_status tool.

Not inside: court decisions, preparatory works (forarbeider), agency circulars (rundskriv), municipal regulations. A rule can be binding and absent here — an empty result is not evidence that no such rule exists.

Optional: search by meaning

semantic_search is the one tool that needs an embedding key (OpenAI; the corpus vectors ship pre-computed — only your query is embedded). Bring your own key via the server's env:

{
  "mcpServers": {
    "lovverk": {
      "command": "uvx",
      "args": ["lovspor", "mcp"],
      "env": { "OPENAI_API_KEY": "sk-...your-own-key..." }
    }
  }
}

It's your key in your own local config file — keep that file private and never commit it. Without a key, semantic_search is simply disabled; the other fifteen tools are unaffected. Details: docs/embeddings.md.

Optional: hosted endpoint

Don't want to self-host? A hosted MCP endpoint runs at https://lovspor.bartoszkobylinski.com/mcp — ask for access, or see docs/mcp.md to run the same thing yourself.

How it works

A scheduled workflow pulls Lovdata's public-data tarballs daily, classifies each document as new / updated / renamed / removed, renders deterministic Markdown, and pushes the diff to lovverk — the public corpus repo — as conventional-commit history. lovspor (this repo, on PyPI) is the engine and MCP server; legal text never lives here.

Architecture and design rationale: docs/decisions.md. Release process: docs/releasing.md. Offline evals for the MCP surface: evals/ (repo-only tooling).

Install from source

git clone https://github.com/bartoszkobylinski/lovspor
cd lovspor
./scripts/bootstrap.sh     # uv sync + pre-commit hooks
uv run lovspor --help

Sources

  • https://api.lovdata.no/v1/publicData/get/gjeldende-lover.tar.bz2 — current Norwegian laws
  • https://api.lovdata.no/v1/publicData/get/gjeldende-sentrale-forskrifter.tar.bz2 — current central regulations

Data is licensed under Norsk lisens for offentlige data (NLOD) 2.0.

License

The engine code in this repository is licensed under MIT. See LICENSE.

The legal text produced by this engine is published in the lovverk repository under NLOD 2.0, with attribution to Lovdata.

  • cloveras/lovdata2 — JSON tooling and MCP server for the same Lovdata public data. lovspor is complementary, focused on Markdown rendering, Git-based change tracking, and an MCP server scoped to the lovverk corpus shape.

Metadata

Release files for lovspor 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lovspor 0.5.1
File Size Uploaded Provenance Actions
lovspor-0.5.1.tar.gz 394.9 kB With provenance Details for lovspor-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lovspor 0.5.1
File Interpreter ABI Platform Actions
lovspor-0.5.1-py3-none-any.whl Python 3 none any Details for lovspor-0.5.1-py3-none-any.whl

Total release size: 661.6 kB

Release files / lovspor-0.5.1.tar.gz

Download URL lovspor-0.5.1.tar.gz
Size 394.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5c31bab7a0d2df6d43e58b92ba72f0b00d8a7b355eb460b69c7f44dbcb4d6f37
BLAKE2b-256 checksum
How to use checksums
93bbe802924b02cdda6588d098b8d8051c4c9a05f4a03be0be8be4496362edf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / lovspor-0.5.1-py3-none-any.whl

Download URL lovspor-0.5.1-py3-none-any.whl
Size 266.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90cceb8e0cec76a5f71234d245cc9845606c64958f959673f505f6be0373532b
BLAKE2b-256 checksum
How to use checksums
a37c439d2a7abbbed1044e366993ee51a97a60d826625da1c0d3e734b3f3962c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Security for lovspor 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lovspor-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page