Scb Mcp

io.github.isakskogstadPublished by GitHub account isakskogstadv2.5.3Updated Oct 27, 2026

MCP server for Statistics Sweden (SCB) - 1200+ tables with population, economy, environment data

VerifiedStreamable HTTPWeb executableWeb Search & ScrapingData & Analytics

Overview

AI-generated overview

Connects an assistant to Statistics Sweden's PxWebAPI, letting it search 1,200+ official statistical tables and fetch population, economy, environment, labour…

What you can do
  • Search statistical tables by keyword and category across 1,200+ SCB tables
  • Resolve region names to official region codes, with fuzzy matching for names lacking Swedish characters
  • Inspect a table's variables and value codes before querying
  • Fetch table data for chosen regions, variables and time periods, with preview and TOP() limits for large selections
When to use it
Useful when you need official Swedish statistics — demographics, GDP, emissions, employment, education — for analysis, dashboards, research or educational material, and want the assistant to find the right table and pull the numbers itself.
Requirements
The manifest lists a remote endpoint at scb-mcp.onrender.com with no authentication, environment variables or headers. The README instead describes running it locally over stdio: clone the repository, install with npm and build, then point the MCP client at the built entry file. Network access to SCB's PxWebAPI is needed.
Before you install
Read-only access to public statistics; no credentials or payments are involved. Note the mismatch between the manifest's remote endpoint and the README's local stdio setup, so verify which one you are connecting to. Queries are rate limited (30 requests per 10 seconds), and large selections can return very large datasets, so preview first.

Installation

In SourceWeft

  1. Open Scb Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.isakskogstad%2Fscb-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "scb": {
      "type": "http",
      "url": "https://scb-mcp.onrender.com/mcp"
    }
  }
}

README

[MCP SERVER]

[MCP Registry] [MCP Protocol]

📊 SCB MCP Server

SCB MCP är server som LLM:s och AI-chatbotar kan använda för att söka, hitta och hämta officiell data och statistik från Statistikbyrån (SCB). Det omfattar 1 200+ statistiktabeller med data om befolkning & demografi, ekonomi & finans, miljö, arbetsmarknad, utbildning och transport. Perfekt för att bygga interaktiva instrumentpaneler, forskningsverktyg och utbildningsapplikationer.


Översikt

🇬🇧 Overview

The SCB MCP server provides seamless integration with Statistics Sweden's PxWebAPI 2.0, enabling LLM:s to access:

  • Population & Demographics: Regional data, migrations, births, deaths (312+ regions)
  • Economy & Finance: GDP, taxes, business statistics, national accounts
  • Environment: Greenhouse gas emissions, water/waste management, sustainability metrics
  • Labor Market: Employment, unemployment, occupational data, skills matching
  • Education: Student statistics, course enrollments, skills development

Data ranges from 1950s to present (monthly/quarterly updates). Real-time population statistics updated to November 2025.

SCB MCP-servern ger sömlös integrering med Statistikbyråns (SCB) PxWebAPI 2.0, vilket gör det möjligt för LLM:s att tillgå:
  • Befolkning & demografi: Regionaldata, migrationer, födslar, dödsfall (312+ regioner)
  • Ekonomi & finans: BNP, skatter, företagsstatistik, nationalräkenskaper
  • Miljö: Växthusgaser, vatten/avfallshantering, hållbarhetsvärdena
  • Arbetsmarknad: Sysselsättning, arbetslöshet, yrkesdata, kompetensmatchning
  • Utbildning: Studentstatistik, kursanmälningar, kompetensutveckling

🇬🇧 Key features (English)
FeatureDescription
Comprehensive Access1,200+ tables, 312+ regions, 75+ years of historical data
Smart QueryingNatural language search, region code resolution ("Lerum" → 1441), TOP() & wildcard support
Fuzzy Matching"Goteborg" matches "Göteborg", "Malmo" matches "Malmö"
Developer-FriendlyFull documentation, clear errors with suggestions, selection validation, metadata in responses
Production-ReadyRate limiting (30 req/10s), consistent behavior, proper data types, language support (SV/EN)
Swedish by DefaultAll tools use Swedish (sv) as default for best search results
Real-Time DataMonthly/quarterly updates, population data to November 2025

Huvudfunktioner

FunktionBeskrivning
Omfattande åtkomst1 200+ tabeller, 312+ regioner, 75+ års historiska data
Smart sökningNaturspråkig sökning, regionkodupplösning ("Lerum" → 1441), TOP() & wildcard-stöd
Fuzzy matching"Goteborg" matchar "Göteborg", "Malmo" matchar "Malmö"
UtvecklarvänligFullständig dokumentation, tydliga felmeddelanden, valideringsmöjligheter, metadata i svaren
ProduktionsklarRate limiting (30 req/10s), konsekvent beteende, rätt datatyper, språkstöd (SV/EN)
Svenska som standardAlla verktyg använder svenska (sv) som default för bästa sökresultat
Aktuell dataMånatliga/kvartalsvisa uppdateringar, befolkningsdata till november 2025

🚀 Installation

Servern körs lokalt via stdio. Klona, bygg och peka din MCP-klient mot dist/index.js.

bash
git clone https://github.com/isakskogstad/SCB-MCP.gitcd SCB-MCPnpm installnpm run build

Claude Code (CLI)

bash
claude mcp add scb -- node /absolut/sökväg/till/SCB-MCP/dist/index.js

Claude Desktop / Codex / Gemini / Cursor (stdio)

Lägg till i klientens MCP-konfiguration (t.ex. ~/Library/Application Support/Claude/claude_desktop_config.json för Claude Desktop):

json
{  "mcpServers": {    "scb": {      "command": "node",      "args": ["/absolut/sökväg/till/SCB-MCP/dist/index.js"]    }  }}
🇬🇧 Installation (English)

The server runs locally over stdio. Clone, build, and point your MCP client to dist/index.js.

bash
git clone https://github.com/isakskogstad/SCB-MCP.gitcd SCB-MCPnpm installnpm run build
Claude Code (CLI)
bash
claude mcp add scb -- node /absolute/path/to/SCB-MCP/dist/index.js
Claude Desktop / Codex / Gemini / Cursor (stdio)
json
{  "mcpServers": {    "scb": {      "command": "node",      "args": ["/absolute/path/to/SCB-MCP/dist/index.js"]    }  }}

Användarguide

1. Sök efter statistiktabeller

python
# Hitta befolkningsrelaterade tabellerresults = scb.search_tables(query="befolkning statistik", limit=10)
# Filtrera efter kategoriresults = scb.search_tables(query="miljö", category="environment", limit=5)
🇬🇧 Usage guide (English)

1. Search for statistical tables

python
results = scb.search_tables(query="population", limit=10)results = scb.search_tables(query="environment", category="environment", limit=5)

2. Hitta regionkoder

python
# Lerum kommunregion = scb.find_region_code(query="Lerum")# Returnerar: code="1441", name="Lerum"
# Större regionerregion = scb.find_region_code(query="Stockholm")# Returnerar: code="01" (län), code="0180" (kommun)
# Fuzzy matching - fungerar utan svenska teckenregion = scb.find_region_code(query="Goteborg")# Returnerar: code="1480", name="Göteborg"
🇬🇧 Resolve region codes (English)
python
region = scb.find_region_code(query="Lerum")region = scb.find_region_code(query="Stockholm")
# Fuzzy matching - works without Swedish charactersregion = scb.find_region_code(query="Goteborg")# Returns: code="1480", name="Göteborg"

3. Hämta data

python
# Medelålder i Lerum 2024data = scb.get_table_data(    tableId="TAB637",    selection={        "Region": ["1441"],        "Kon": ["1+2"],        "Tid": ["2024"],        "ContentsCode": ["BE0101G9"]    })# Resultat: Medelålder i Lerum 2024: 40.1 år
🇬🇧 Fetch data (English)
python
data = scb.get_table_data(    tableId="TAB637",    selection={        "Region": ["1441"],        "Kon": ["1+2"],        "Tid": ["2024"],        "ContentsCode": ["BE0101G9"]    })

Best practices

ProblemLösning
Stor datamängd?Använd alltid preview_data() först för att testa
För mycket data?Använd "TOP(5)" istället för "*" för tidsperioder
Felaktiga koder?Anropa get_table_variables() först — koder varierar mellan tabeller
Osäker på enheter?Kontrollera variabeletikett för enheter (kt, ton, procent osv.)
🇬🇧 Best practices (English)
IssueSolution
Large dataset?Always use preview_data() first to test
Too much data?Use "TOP(5)" instead of "*" for time periods
Wrong codes?Call get_table_variables() first — codes vary between tables
Unsure about units?Check variable label for units (kt, tonnes, percent, etc.)

Praktiska exempel

Ex: Befolkningstrend Lerum vs Stockholm

python
# Jämför två regioner över tiddata = scb.get_table_data(    tableId="TAB637",    selection={        "Region": ["1441", "0180"],  # Lerum och Stockholm        "Kon": ["1+2"],        "Tid": ["TOP(5)"],        "ContentsCode": ["BE0101G9"]    })# Stockholm: 41.0 år (2024), Lerum: 40.1 år (2024)# Trend: Stockholm åldras snabbare
🇬🇧 Example 1: Population trends (English)
python
data = scb.get_table_data(    tableId="TAB637",    selection={        "Region": ["1441", "0180"],  # Lerum and Stockholm        "Kon": ["1+2"],        "Tid": ["TOP(5)"],        "ContentsCode": ["BE0101G9"]    })# Stockholm: 41.0 years (2024), Lerum: 40.1 years (2024)

Resurser


Av: Isak Skogstad

Source: README.md at commit 4f07125

Tools

0
SourceWeft has not read this server's tools yet.

Version history

1
  1. v2.5.3LatestSep 16, 2026

Score

75% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.