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 分