一键导入
riksdag-regering-mcp
Riksdag-Regering MCP server with 32 specialized tools for Swedish political data (Parliament, Government, MPs, votes, documents)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Riksdag-Regering MCP server with 32 specialized tools for Swedish political data (Parliament, Government, MPs, votes, documents)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Master GitHub Agentic Workflows authoring - markdown syntax, natural language instructions, YAML frontmatter, compilation, and workflow patterns
Comprehensive expertise in GitHub Agentic Workflows (v0.68.1) — AI-powered repository automation with five-layer security, safe outputs, MCP tools, and Continuous AI patterns
Comprehensive guide for MCP (Model Context Protocol) server setup, transport protocols, configuration validation, lifecycle management, tool discovery, and error handling patterns
Comprehensive Hack23 threat modeling process using STRIDE, MITRE ATT&CK, attack trees, and quantitative risk assessment per ISMS Threat_Modeling.md policy
Fiscal policy, budget analysis, economic forecasting, monetary policy, trade policy for political journalists
Comprehensive guide to integrating agentic automation with GitHub Actions CI/CD pipelines, including workflow triggers, environment configuration, secrets management, matrix strategies, and deployment patterns for production-ready autonomous systems.
| name | riksdag-regering-mcp |
| description | Riksdag-Regering MCP server with 32 specialized tools for Swedish political data (Parliament, Government, MPs, votes, documents) |
| license | Apache-2.0 |
Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.
Provide comprehensive access to Swedish political data through the riksdag-regering-mcp Model Context Protocol (MCP) server. Enables intelligence operatives and political analysts to query, analyze, and visualize data from the Swedish Riksdag (Parliament) and Regeringen (Government).
scripts/scb-fetch.ts KPI/AKU/HEK/fuel presets and scripts/riksbank-fetch.ts policy-rate/minutes context for Swedish-specific impact estimates.In gh-aw agentic workflows, MCP tools are called directly by name without any prefix. The MCP gateway routes to the correct server automatically:
// Direct tool calls in agentic workflows (no prefix needed):
get_sync_status({}) // Health check — ALWAYS call first
get_propositioner({ rm: "2025/26", limit: 20 }) // Government propositions
get_betankanden({ rm: "2025/26", limit: 20 }) // Committee reports
search_dokument({ doktyp: "prop", rm: "2025/26" }) // Search documents
search_voteringar({ rm: "2025/26", parti: "S" }) // Search votes
get_calendar_events({ from: "2026-04-01", tom: "2026-04-30" }) // Calendar events
⚠️ Tool names use underscores (e.g.,
get_sync_status, NOTget-sync-status). The gateway athttp://host.docker.internal:$MCP_GATEWAY_PORT/mcp/riksdag-regering(port8080for gh-aw v0.69+, port80for legacy gh-aw <0.69 — resolved dynamically bymcp-setup.sh) handles routing. See.github/prompts/02-mcp-access.mdfor MCP server access, direct tool invocation, and tool-naming conventions (and the.github/prompts/README.mdfor the full module catalogue).
// Get all votes from current riksmöte
const votes = await riksdag_regering_mcp.search_voteringar({
rm: "2024/25",
limit: 200
});
// Analyze party cohesion
const partyDiscipline = {};
for (const party of ['S', 'M', 'SD', 'C', 'V', 'KD', 'L', 'MP']) {
const partyVotes = await riksdag_regering_mcp.get_voting_group({
rm: "2024/25",
groupBy: "parti",
limit: 200
});
// Calculate cohesion metric
partyDiscipline[party] = calculateCohesion(partyVotes);
}
// Get reports from all committees
const committees = ['AU', 'FiU', 'JuU', 'KU', 'SkU', 'SfU', 'UU'];
const productivity = {};
for (const committee of committees) {
const reports = await riksdag_regering_mcp.get_betankanden({
organ: committee,
rm: "2024/25",
limit: 100
});
productivity[committee] = {
count: reports.length,
avgProcessingTime: calculateAvgTime(reports)
};
}
// Search government propositions on specific topic
const props = await riksdag_regering_mcp.search_regering({
type: "propositioner",
title: "migration",
dateFrom: "2024-01-01",
limit: 50
});
// Get full content for analysis
for (const prop of props) {
const content = await riksdag_regering_mcp.get_g0v_document_content({
regeringenUrl: prop.url
});
// Analyze policy positions
analyzePolicy(content);
}
// Get latest parliamentary activity
const motions = await riksdag_regering_mcp.get_motioner({ limit: 10 });
const props = await riksdag_regering_mcp.get_propositioner({ limit: 10 });
const questions = await riksdag_regering_mcp.get_fragor({ limit: 10 });
// Create bilingual dashboard (Swedish/English)
const dashboard = {
sv: formatDashboardSV({ motions, props, questions }),
en: formatDashboardEN({ motions, props, questions })
};
// ❌ BAD: Fetching too much data
const allDocs = await riksdag_regering_mcp.search_dokument({
limit: 200 // Default, could be thousands
});
// ✅ GOOD: Targeted query with filters
const recentDocs = await riksdag_regering_mcp.search_dokument({
rm: "2024/25",
doktyp: "mot",
organ: "FiU",
limit: 50
});
// ❌ BAD: Only getting first page
const votes = await riksdag_regering_mcp.search_voteringar({ limit: 20 });
// ✅ GOOD: Handling pagination
const allVotes = await riksdag_regering_mcp.fetch_paginated_documents({
doktyp: "votering",
rm: "2024/25",
fetchAll: true,
maxPages: 10
});
RULE #1: Call get_sync_status() before any data queries
// === DATA FRESHNESS CHECK ===
// ALWAYS call this FIRST - validates freshness and warms up server
const syncStatus = get_sync_status({});
console.log("Last data sync:", syncStatus.last_updated);
// Calculate hours since last sync
const lastSync = new Date(syncStatus.last_updated);
const hoursSinceSync = (Date.now() - lastSync.getTime()) / 3600000;
// Warn if data is stale (>48 hours)
if (hoursSinceSync > 48) {
console.warn(`⚠️ DATA MAY BE STALE: ${hoursSinceSync.toFixed(1)} hours since last sync`);
// Include disclaimer in analysis/articles
}
Why this matters:
Only 3 of 32 tools support explicit date parameters:
| Tool | Date Parameters | Example |
|---|---|---|
get_calendar_events | from, tom | { from: "2026-02-17", tom: "2026-02-23" } |
search_regering | from_date, to_date | { from_date: "2026-02-01", to_date: "2026-02-17" } |
analyze_g0v_by_department | dateFrom, dateTo | { dateFrom: "2026-02-01", dateTo: "2026-02-17" } |
All other 29 tools require post-query date filtering by:
datum - votes, speeches (voting/speech date)publicerad - committee reports, propositions (publication date)inlämnad - motions, questions, interpellations (submission date)// === STEP 1: Check data freshness ===
const syncStatus = get_sync_status({});
// === STEP 2: Query with explicit dates (where supported) ===
const govDocs = search_regering({
from_date: "2026-02-01",
to_date: "2026-02-17",
limit: 50
});
// === STEP 3: Filter by date for tools without date params ===
const betankanden = get_betankanden({ rm: "2025/26", limit: 100 });
// Filter results by publication date
const fromDate = new Date("2026-02-01");
const recentBetankanden = betankanden.filter(bet =>
new Date(bet.publicerad) >= fromDate
);
console.log(`Found ${recentBetankanden.length} committee reports from ${fromDate.toISOString().split('T')[0]}`);
// ❌ BAD: Relies on implicit sorting without date awareness
const votes = search_voteringar({ rm: "2025/26", limit: 50 });
// Problem: No idea when votes occurred, might be months old
// ✅ GOOD: Explicit date filtering
const votes = search_voteringar({ rm: "2025/26", limit: 50 });
const recentVotes = votes.filter(v =>
new Date(v.datum) >= new Date("2026-02-01")
);
console.log(`Found ${recentVotes.length} votes since 2026-02-01`);
Combine multiple tools for richer analysis:
// 1. Get recent committee reports
const betankanden = get_betankanden({ rm: "2025/26", limit: 20 });
const recentBet = betankanden.filter(b =>
new Date(b.publicerad) >= new Date("2026-02-01")
);
// 2. Get full details for each report
const reportDetails = recentBet.map(bet =>
get_dokument({ dok_id: bet.dok_id })
);
// 3. Find related votes
const votes = search_voteringar({ rm: "2025/26", limit: 100 });
const relatedVotes = votes.filter(v =>
recentBet.some(bet => v.bet === bet.beteckning)
);
// 4. Get committee members' speeches
const speeches = search_anforanden({ rm: "2025/26", limit: 100 });
const committeeSpeeches = speeches.filter(a =>
recentBet.some(bet => a.dokument_hangar_samman === bet.dok_id)
);
// Now you have: reports + details + votes + speeches
// 1. Get voting patterns by party
const voteGroups = get_voting_group({ rm: "2025/26", groupBy: "parti" });
// 2. Get recent votes
const votes = search_voteringar({ rm: "2025/26", limit: 200 });
const recentVotes = votes.filter(v =>
new Date(v.datum) >= new Date("2026-02-01")
);
// 3. Get party motions
const motions = get_motioner({ rm: "2025/26", limit: 100 });
const partyMotions = motions.filter(m =>
new Date(m.inlämnad) >= new Date("2026-02-01")
);
// 4. Calculate party cohesion
const partyDiscipline = calculateCohesion(voteGroups, recentVotes);
| Issue | Cause | Solution |
|---|---|---|
| Tool not found | Wrong tool name | Use exact names: get_calendar_events, search_voteringar |
| Empty results | No data in timeframe | Check get_sync_status(), widen date range, verify rm parameter |
| Stale data | Last sync >48h ago | Note in analysis with disclaimer, use available data |
| Timeout | Cold start (30-60s) | Wait - MCP framework retries automatically |
| Too broad results | No date filtering | Add date params OR filter by datum/publicerad/inlämnad |
| Swedish-only results | Riksdag API returns Swedish | Must translate to target languages |
| Missing documents | Wrong riksmöte (rm) | Verify rm parameter (e.g., "2025/26") |
get_sync_status() first, then batch data queriesfetch_paginated_documents for large datasetsTemplate 1: Daily News Monitoring
const syncStatus = get_sync_status({});
const today = new Date().toISOString().split('T')[0];
const yesterday = new Date(Date.now() - 86400000).toISOString().split('T')[0];
// Government activity
const govDocs = search_regering({
from_date: yesterday,
to_date: today,
limit: 50
});
// Parliamentary calendar
const events = get_calendar_events({
from: today,
tom: today,
limit: 50
});
// Recent votes (filter by date)
const votes = search_voteringar({ rm: "2025/26", limit: 50 });
const todayVotes = votes.filter(v => v.datum === today);
Template 2: Weekly Analysis
const syncStatus = get_sync_status({});
const today = new Date();
const weekAgo = new Date(Date.now() - 7 * 86400000);
// Committee reports (filter by publicerad)
const reports = get_betankanden({ rm: "2025/26", limit: 100 });
const weeklyReports = reports.filter(r =>
new Date(r.publicerad) >= weekAgo
);
// Propositions (filter by publicerad)
const props = get_propositioner({ rm: "2025/26", limit: 50 });
const weeklyProps = props.filter(p =>
new Date(p.publicerad) >= weekAgo
);
// Questions (filter by inlämnad)
const questions = get_fragor({ rm: "2025/26", limit: 100 });
const weeklyQuestions = questions.filter(q =>
new Date(q.inlämnad) >= weekAgo
);
Template 3: MP Activity Analysis
const syncStatus = get_sync_status({});
// Get MP profile
const mp = get_ledamot({ intressent_id: "XXXXXXXX" });
// Get MP's motions
const allMotions = get_motioner({ rm: "2025/26", limit: 200 });
const mpMotions = allMotions.filter(m =>
m.intressent_id === mp.intressent_id
);
// Get MP's speeches
const speeches = search_anforanden({
rm: "2025/26",
talare: mp.tilltalsnamn + " " + mp.efternamn,
limit: 100
});
// Get MP's voting record
const votes = search_voteringar({ rm: "2025/26", limit: 200 });
// Requires cross-referencing with ledamöter data
{
"mcpServers": {
"riksdag-regering": {
"type": "http",
"url": "https://riksdag-regering-ai.onrender.com/mcp",
"tools": ["*"]
}
}
}
# Install globally
npm install -g riksdag-regering-mcp
# Run locally
riksdag-regering-mcp
# Listens on http://localhost:3000/mcp
fetchAll carefully)Version: 1.0
Last Updated: 2026-02-06
Maintained by: Hack23 AB
This skill is consumed by the 11 agentic news workflows in .github/workflows/news-*.md. The authoritative contract lives in .github/prompts/README.md; this skill supplies domain expertise on top of that contract.
ai-driven-analysis-guide.md + every template in analysis/templates/.analysis/daily/$ARTICLE_DATE/$SUBFOLDER/; 05-analysis-gate.md is the single blocking gate.