Skip to main content

se-eli-mcp

Instalacja (jedna komenda)

Opublikowany na PyPI + MCP Registry (io.github.matematicsolutions/se-eli-mcp). Uruchomienie bez klonowania:

uvx se-eli-mcp

Konfiguracja klienta MCP (stdio):

{ "mcpServers": { "se-eli-mcp": { "command": "uvx", "args": ["se-eli-mcp"] } } }

Windows 11 ze Smart App Control

Smart App Control blokuje niepodpisane pliki wykonywalne, a uvx.exe, pip.exe i generowany przy instalacji se-eli-mcp.exe podpisane nie sa. python.exe z python.org jest podpisany przez Python Software Foundation, wiec uruchomienie przez modul omija blokade:

python -m pip install se-eli-mcp
python -m se_eli_mcp
{ "mcpServers": { "se-eli-mcp": { "command": "python", "args": ["-m", "se_eli_mcp"] } } }

Nie wylaczaj Smart App Control, zeby to obejsc - wylaczenia nie da sie cofnac bez ponownej instalacji systemu.

(Budowanie ze źródeł — niżej.)

An MCP server for Swedish statutes (SFS, Svensk författningssamling), served as open data by the Riksdagen (parliament) at data.riksdagen.se (keyless). It gives an AI agent the consolidated text of an act with a verifiable citation: a persistent identifier, a human-readable citation, and a link to the official source.

Part of the eu-legal-mcp line by MateMatic — one connector per EU member state, the same citation contract everywhere.

On ELI. Sweden does not publish native ELI (/eli/) URIs. To keep the line's contract honest, eli_uri carries the official persistent document identifier instead — the data.riksdagen.se/dokument URI (e.g. https://data.riksdagen.se/dokument/sfs-2018-218). The SFS number (2018:218) is the canonical Swedish citation. The connector never fabricates an /eli/ URI and says so in its tool instructions. See DISCOVERY.md.

Tools

Tool What it does
se_search(query) Free-text search over SFS statutes (title and full text). Returns acts, each with the citation contract.
se_get_act(sfs_number) Metadata for one act by its SFS number (e.g. 2018:218) — title, authority, date, consolidation marker.
se_get_text(sfs_number) The full consolidated plain text of one act.

Every response carries the citation contract:

  • eli_uri — the official persistent identifier (document URI; see the ELI note above).
  • human_readable_citation — the act title, which embeds the SFS number, e.g. Lag (2018:218) med kompletterande bestämmelser till EU:s dataskyddsförordning.
  • source_url — the browsable data.riksdagen.se page for the act.
  • consolidated_through — the last amendment folded into the text (the "ändrad t.o.m." marker).

Install

pip install -e ".[dev]"

Register it with your MCP client (see .mcp.json.example):

{
  "mcpServers": {
    "se-eli-mcp": {
      "command": "se-eli-mcp",
      "env": {
        "SE_ELI_BASE_URL": "https://data.riksdagen.se",
        "SE_ELI_CACHE_DIR": "~/.matematic/cache/se-eli",
        "SE_ELI_AUDIT_DIR": "~/.matematic/audit"
      }
    }
  }
}

Design

  • Public data only. Read-only against the keyless Riksdagen open-data API; nothing is sent beyond the query / SFS number.
  • Audit log. Every call appends one JSON line to ~/.matematic/audit/se-eli-mcp.jsonl (AI Act art. 12 record-keeping).
  • Vendor-neutral. No LLM provider, no telemetry; own backoff + on-disk cache.
  • No fabrication. Identifiers and titles are parsed from the source record. If Riksdagen's schema changes, the connector fails loudly rather than returning stale or invented data.

See CONSTITUTION.md (the 4 principles) and DISCOVERY.md (how the source was mapped).

Tests

pytest tests/test_instructions_drift.py tests/test_parse.py   # offline
pytest tests/test_smoke.py                                     # live Riksdagen API

Licence

Apache-2.0. The Swedish legislation served is official public data of the Kingdom of Sweden; this connector adds no rights over it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

se_eli_mcp-0.2.1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

se_eli_mcp-0.2.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file se_eli_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: se_eli_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for se_eli_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2ec903774ca0b3422ad02d284feb4941e3190e7254f37ca756121cef170ae9c5
MD5 d8057f40a4a18765e694f16b688f7c51
BLAKE2b-256 e4ebb3814f91c1060bad531d893189ab8f97811616ccc3793d91d5a92a8d08df

See more details on using hashes here.

Provenance

The following attestation bundles were made for se_eli_mcp-0.2.1.tar.gz:

Publisher: release.yml on matematicsolutions/se-eli-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se_eli_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: se_eli_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for se_eli_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be0626677b5e7fa1c7958cb27c3d426a1108f6ea82b5060b2fff48897d352538
MD5 b84f0f17391c64fbf1017d516bdc781d
BLAKE2b-256 ee1cebc902d136289a1c124c059c218c75f35d20b71f495c8016e03c72653e26

See more details on using hashes here.

Provenance

The following attestation bundles were made for se_eli_mcp-0.2.1-py3-none-any.whl:

Publisher: release.yml on matematicsolutions/se-eli-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page