Se Eli Mcp

io.github.matematicsolutions由 GitHub 帳號 matematicsolutions 發布v0.3.3更新於 Oct 25, 2026

MCP server for Swedish statutes (SFS) via Riksdagen open data with verifiable citations.

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理檢索瑞典法規(SFS)的 Riksdagen 開放資料,並取得附可驗證引用的合併版法條全文。

可以做什麼
依標題與全文對瑞典法規進行自由文字檢索,並為每筆結果回傳引用資訊。依 SFS 編號查詢單一法規的中繼資料,例如標題、發布機關、日期與合併標記。取得單一法規完整的合併版純文字。說明此連接器涵蓋的範圍、各法規族的擷取時間,以及明確未涵蓋的內容與替代方案。
適用情境
適合助理需要回答瑞典法律問題並引用官方來源、而非憑記憶轉述的情況。適用於法律檢索、法遵查核,以及依賴某部 SFS 法規現行合併文本的起草工作。
執行需求
以本機 stdio 程序執行,從 PyPI 安裝,並以 uvx 或 Python 模組啟動;需要 Python 及連線至 Riksdagen 開放資料 API 的網路。無需帳號或 API 金鑰。可選環境變數可設定基礎位址、快取目錄與稽核目錄。
安裝前請注意
對公開資料僅供讀取,但每次呼叫都會附加寫入本機稽核日誌檔。首次使用時會從 GitHub Releases 取得一個小型設定檔,可用執行階段 URL 變數關閉;該請求不攜帶查詢內容。查詢字詞與 SFS 編號會傳送至 Riksdagen API。瑞典未發布原生 ELI URI,因此識別碼欄位實際承載 Riksdagen 文件 URI。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Se Eli Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

se-eli-mcp

Install (one command)

As a Claude plugin (Claude Code or the desktop app, needs uv); see plugin/README.md for what it sends and stores:

/plugin marketplace add matematicsolutions/se-eli-mcp/plugin install se-eli-mcp@se-eli-mcp

Published on PyPI + MCP Registry (io.github.matematicsolutions/se-eli-mcp). Run without cloning:

bash
uvx se-eli-mcp

Configure your MCP client (stdio):

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

Windows 11 with Smart App Control

Smart App Control blocks unsigned executables, which covers uvx.exe, pip.exe and the se-eli-mcp.exe launcher that pip writes at install time. The python.exe and py.exe from the python.org installer are signed by the Python Software Foundation, so running the module through the interpreter works:

bash
python -m pip install se-eli-mcppython -m se_eli_mcp

pip.exe is blocked for the same reason, so install with python -m pip, not pip install. If python is not on PATH, use the Windows launcher: py -3 -m se_eli_mcp.

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

Do not turn Smart App Control off to work around this - it cannot be re-enabled without reinstalling Windows.

Building from source: see Install.

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

ToolWhat 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.
se_coverage()Declare what this connector covers, when each family was captured, and - explicitly - what it does NOT cover. Every gap carries a fallback.

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

bash
pip install -e ".[dev]"

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

json
{  "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 (record-keeping).
  • Network - the server talks to the official source(s) named above and the local filesystem. Once, on first use, it also fetches a small configuration file (se-runtime.json.gz, updated source addresses) from this repository's GitHub Releases. That request carries no query content; GitHub's download counter for the file is the only usage signal we see. SE_ELI_RUNTIME_URL="" turns it off; the Claude plugin ships with it off. No LLM provider, no other 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

bash
pytest tests/test_instructions_drift.py tests/test_parse.py   # offlinepytest 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.

來源:README.md,提交 7af081f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分