Sweden Parliament MCP Server
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., "@Sweden Parliament MCP ServerSearch Riksdag documents about climate from the 2024/25 session"
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.
Overview
Swedish parliamentary records from Riksdagen Open Data. Find proposals and committee reports, follow published decisions and main votes, read speeches, explore member assignments, and retrieve consolidated SFS statutes. Runs as a stdio process or a local Streamable HTTP server; no API key required.
Source: The Swedish Parliament. This independent service is not operated or endorsed by Sveriges riksdag. Swedish titles, labels, decisions, and text retain their source wording; English labels appear only where the source supplies them.
Tools
Tool | Description |
| Browse official document types, committees, parties, constituencies, sessions, and identifier and coverage guidance |
| Search parliamentary documents and consolidated SFS statutes by words, type, session, committee, party, or dates |
| Read publication metadata, decisions, reservations, activities, links, and paginated text |
| Find speeches within a session by debate heading, member, or party; retrieve full text through get mode |
| Read report decisions with party main-vote totals or one member's session main votes |
| Find register entries by name, party, constituency, and source service classification |
| Read an exact member IID and its published assignment history |
Related MCP server: se-eli-mcp
Capability reference
riksdag_list_reference tool
topic:document_types,committees,parties,constituencies,speech_types,sessions,identifiers, orcoverageDated offline snapshot with Swedish labels, available source English labels, source links, and
referenceVerifiedAt; document subtypes remain separate from parent codes, and the session catalog can lag current sessionsoffsetpagination;limitdefaults to 20 and is clamped to 100, withtotalCountand completenextCallarguments
riksdag_search_documents tool
Optional
query,documentType,session,committee,party,dateFrom, anddateTo; dates useYYYY-MM-DD, and codes or exact reference labels are acceptedRemote
pagestarts at 1;pageSizedefaults to 10 and is clamped to 50. Every fetched row is returned, with source ordering, availabletotalCount, andnextCallUse
documentType: "sfs"for consolidated statutes; narrow slow full-text searches withsessionordocumentType
riksdag_get_document tool
Required
documentIdfrom search, or an unambiguous SFS identifier such as1974:152; missing records returnfound: falseOmit
sectionsfor metadata, the complete outline, and the first text page; selectmetadata,decisions,reservations,activities,properties,attachments,references,text, orsource_htmlText and HTML use Unicode code-point offsets (
textOffset/htmlOffset); lengths default to 1,000 and explicittextLength/htmlLengthvalues are honored. Array sections usesectionOffset/sectionLimit(default 20, maximum applied 100)Follow
nextTextCall,nextHtmlCall, or eachsectionPages[].nextCall, retainingrevision; changed records fail withrevision_changed. Attachments are links, not downloaded filesSFS
versionKind: "consolidated"describes published consolidated text, which may include future-effective provisions; it is not an as-enacted or point-in-time legal version
riksdag_search_speeches tool
mode: "search"(default) requiressession; optionalmemberId,party, andspeechType: "all" | "speech"narrow the selection, withspeechexcluding repliesheadingContainsmatches all tokens against headings and subheadings, ignoring case and diacritics; it never searches speech body textLocal
offsetpagination;limitdefaults to 5 and is clamped to 20.textCountdefaults to 1, is clamped to 5, and accepts 0 for metadata onlymode: "get"requires a retrievalspeechIdcopied from search, notsourceSpeechId; get mode rejects search filters.textOffsetand optionaltextLengthread the whole published body throughnextTextCall; the default text page is 1,000 code pointstextStateisincluded,not_requested,unavailable, orfailed; transient hydration failures include recovery details. Retainrevisionon search or text continuations
riksdag_get_votes tool
Required
modeandsession;mode: "report"takesreport(designation or session:designation) or a reportdocumentId, whilemode: "member"requiresmemberIdand permitspartyReport mode returns authoritative decisions and complete party groups. Select one
point, or usepointOffset/pointLimit(default 5, maximum applied 10); member mode usesoffset/limit(default 20, maximum applied 500)Published main votes only, not every ballot round.
rollCallStateisavailable,acclamation,not_published, orunknown; acclamation requires explicit decision evidence, never merely empty vote rowsMissing aggregate counts remain unknown; additional source vote labels stay in
otherVotes. FollownextCallwithrevisionfor remaining whole points or member rows
riksdag_search_members tool
Optional
nameContainsmatches all tokens ignoring case and diacritics;partyandconstituencyaccept codes or exact reference labelssitting: "all" | "serving" | "not_serving"defaults toall; this filters source service classification, not verified sitting or elected membership. Historical entries and ministers can appear, and unknown classifications remain inallLocal
offsetpagination;limitdefaults to 20 and is clamped to 100. ReturnscandidateCount, exact filteredtotalCount,revision, andnextCallKeep leading zeros in
memberId. Some European Parliament entries have no IID and returndetailAvailable: false; theirsourceRecordIdis a different identifier and cannot be used withriksdag_get_member
riksdag_get_member tool
Required numeric-string
memberIdfrom search, including leading zeros; missing entries returnfound: falsewith guidancePublished register metadata and assignments in source order;
assignmentOffset/assignmentLimitdefault to 0 / 20, with a maximum applied limit of 100assignmentTotal,nextCall, andrevisionallow complete traversal. Assignment dates retain source precision and do not establish historical sitting status; contact details and photographs are excluded
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Riksdag-specific:
Keyless access to official document, speech, vote, and member endpoints, plus dated official reference tables
Document text as canonical Markdown or SFS source text, with separately selectable original HTML
Shared upstream concurrency, bounded public-response caching, and one 55-second deadline across queueing, retries, and text hydration
Historical coverage varies by record type; speeches and votes start in 1993/94, with gaps in older vote data
Agent-friendly output:
Source attribution, retrieval time, effective filters, and source warnings on both
content[]andstructuredContentComplete continuation calls for rows, sections, and text, with revision checks on local continuations; a changing remote document search is not a frozen snapshot
Explicit misses, unavailable text, unknown counts, and source service classifications; candidate saturation fails as
candidate_limit_reachedinstead of returning an incomplete traversal
Getting started
Add the following to your MCP client configuration file.
{
"mcpServers": {
"sweden-parliament-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/sweden-parliament-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"sweden-parliament-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/sweden-parliament-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"sweden-parliament-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/sweden-parliament-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
Riksdagen Open Data requires no API key or account.
Installation
Clone the repository:
git clone https://github.com/cyanheads/sweden-parliament-mcp-server.gitNavigate into the directory:
cd sweden-parliament-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env for optional transport, authentication, or logging overridesConfiguration
Variable | Description | Default |
| Transport: |
|
| HTTP server port. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for every server setting and the common framework overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Project structure
Directory | Purpose |
| Registers seven tools, initializes the service, and selects stateless HTTP sessions. |
| Seven read-only tool definitions; no resources or prompts. |
| Riksdagen endpoint parsing, reference tables, transport, cache, text conversion, and continuation. |
| Unit and integration tests, mirroring the |
See docs/tree.md for the full file tree.
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Riksdagen (Swedish Parliament) open data MCP.
Swedish public data as read-only tools: registries, statistics, domains, transport, energy.
Search Swiss parliamentary business, votes, debates, members, and declared interests.
71Official EUR-Lex, UK, US, and gazette search, metadata fetch, and change-only watches.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables querying Swedish statutes, provisions, case law, preparatory works, and EU law cross-references from any MCP-compatible client.1922 npm1Apache 2.0
- AlicenseAqualityAmaintenanceEnables AI agents to search and retrieve consolidated Swedish statutes (SFS) from the Riksdagen open data API, with verifiable citations and persistent identifiers.4182 PyPIApache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables 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.31MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query Swedish Parliament open data through natural language.8 npmMIT