se-eli-mcp
This MCP server provides access to Swedish statutes (SFS) via Riksdagen open data, with search, metadata, full-text retrieval, and explicit coverage/gap reporting.
se_search(query) — free-text search over SFS statutes (title and full text), returning matching acts with citation metadata.
se_get_act(sfs_number) — fetch metadata for a specific act by its SFS number (e.g.
2018:218), including title, authority, date, and consolidation marker.se_get_text(sfs_number) — retrieve the full consolidated plain text of a statute, along with document identifiers and source links.
se_coverage() — declare what the connector covers, its data families, and known gaps with fallback sources.
Every response includes the citation contract:
eli_uri(official persistent document URI),human_readable_citation,source_url, andconsolidated_through.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@se-eli-mcp Find the Swedish Data Protection Act"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-mcpPublished on PyPI + MCP Registry (io.github.matematicsolutions/se-eli-mcp). Run without cloning:
uvx se-eli-mcpConfigure your MCP client (stdio):
{ "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:
python -m pip install se-eli-mcp
python -m se_eli_mcppip.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.
{ "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_uricarries the official persistent document identifier instead — thedata.riksdagen.se/dokumentURI (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. SeeDISCOVERY.md.
Related MCP server: Danish Law MCP Server
Tools
Tool | What it does |
| Free-text search over SFS statutes (title and full text). Returns acts, each with the citation contract. |
| Metadata for one act by its SFS number (e.g. |
| The full consolidated plain text of one act. |
| 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 browsabledata.riksdagen.sepage 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(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
pytest tests/test_instructions_drift.py tests/test_parse.py # offline
pytest tests/test_smoke.py # live Riksdagen APILicence
Apache-2.0. The Swedish legislation served is official public data of the Kingdom of Sweden; this connector adds no rights over it.
Available Tools
4 toolsse_coverageARead-onlyIdempotent
Declare what this connector covers, how it is sourced, and what it does NOT cover.
Call this before telling a user that the law "does not contain" something, and whenever a search comes back empty: the absence may be a gap in this connector rather than in the law. Every gap carries a fallback saying where to look instead.
Returns:
Coverage with families, an as-of note, and a non-empty list of known gaps.
Inputs: no named parameters. Returns: What this connector covers, how it is sourced, and what it does not cover.
se_get_actARead-onlyIdempotent
Fetch metadata for a Swedish statute by its SFS number.
Inputs: sfs_number (required). Returns: A Swedish statute (SFS), parsed from a Riksdagen document record.
se_get_textARead-onlyIdempotent
Fetch the full consolidated plain text of a Swedish statute by its SFS number.
Inputs: sfs_number (required). Returns: Result of ``se_get_text`` (full consolidated plain text).
se_searchARead-onlyIdempotent
Search Swedish statutes (SFS) by free text (title and full text).
Inputs: query (required). Returns: Result of ``se_search``.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a clearly distinct purpose: search by text, fetch metadata by SFS number, fetch full text, and declare coverage gaps. No two tools could be confused for one another.
All tools share the se_ prefix and mostly follow a verb-based pattern (se_search, se_get_act, se_get_text). se_coverage is a noun instead of a verb, which is a minor deviation but still predictable and readable.
Four tools is a well-scoped set for a Swedish legal information connector. Each tool has a clear role with no redundancy.
The connector provides search, metadata retrieval, full text retrieval, and explicit coverage gap handling, which covers the core research workflow. A minor gap is the lack of functions for listing or browsing statutes, but the coverage tool mitigates confusion from missing results.
Maintenance
Related MCP Connectors
Search Swedish parliamentary documents, speeches, votes, members, and statutes.
Resolve, search and verify legal citations against the official sources, with provenance.
Swiss federal law (Fedlex) and political data (LINDAS) for agents, every answer with sources
Swedish B2B intelligence for AI agents: insolvency risk, procurement, BRF health and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceQuery Swedish public data from AI tools. Includes company data, SCB statistics, weather, transport, public agencies, and more through the Apiverket API.253 npm2MIT
- AlicenseAqualityFmaintenanceEnables querying and analyzing Danish legislation, including search, citation validation, currency checks, and EU law integration, directly from AI assistants.1543 npm1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to query and retrieve real-time open data, documents, protocols, and records from the Swedish Parliament (Riksdag) and Government Offices through 32 specialized MCP tools.32MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Swedish Parliament open data through natural language.95 npmMIT