search_tablesLABSCO SUMMARY
Region-code resolution is why this beats calling the API yourself.
PxWebAPI is queryable but unforgiving: every table has its own variable codes and every municipality is a number. Resolving "Lerum" to 1441 and tolerating "Goteborg" without the umlaut removes the step where a query silently returns the wrong place. The documented working order — check variables, preview, then fetch — is worth following; the README is primarily Swedish with English sections folded in.
What it is
An MCP server over Statistics Sweden's PxWebAPI 2.0. It handles the two things that make official statistics hard to query from a conversation: finding the right table among more than a thousand, and turning a place name into the code the API expects.
What you get
- Statistical tables found by natural-language query, with an optional category filter and a result limit —
search_tables - Place names resolved to region codes —
find_region_codereturns "1441" for Lerum, "1480" for Göteborg, and both the county and municipality codes for Stockholm - Fuzzy matching that works without Swedish characters — "Goteborg" matches "Göteborg", "Malmo" matches "Malmö"
- Table data fetched by ID with a selection object over Region, Kon, Tid and ContentsCode —
get_table_data, with"TOP(5)"and wildcards supported for time periods - A table's variables and their valid codes listed before you query, since codes vary between tables —
get_table_variables - A cheap preview to test a selection before pulling a large dataset —
preview_data - Coverage across 312+ regions and 75+ years of history, with monthly and quarterly updates, in Swedish or English
Requirements
No account and no key — SCB's data is open. The server runs locally over stdio: clone the repository, npm install, npm run build, then claude mcp add scb -- node <YOUR_PATH_TO_SCB_MCP>/dist/index.js, or the equivalent mcpServers block pointing at dist/index.js. Version 2.5.3, published to the MCP Registry, speaking MCP 2025-03-26. Rate limiting is 30 requests per 10 seconds, and all tools default to Swedish for the best search results.
Setup effort
Build from source — git clone https://github.com/isakskogstad/SCB-MCP.git
USE CASES
Comparing two municipalities over time
Resolve both place names to codes, then request the same measure for both with the time period set to the most recent few years.
Finding which table holds what you need
Search by topic with a category filter rather than browsing the SCB database by hand.
Not getting an empty result from a wrong code
List the table's variables first, since the codes differ between tables, then build the selection from what it reports.
Testing a query before pulling a large dataset
Preview the selection first, and narrow time periods with a TOP expression instead of a wildcard.
5 tools
Listed in project docs. Your client may show a different list.
find_region_codeget_table_dataget_table_variablespreview_dataBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
node on PATH
Where it runs
All 3 documented clients run the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
git clone https://github.com/isakskogstad/SCB-MCP.git
cd SCB-MCP
npm install
npm run buildMCP Clients
Claude Code
claude mcp add scb -- node <YOUR_PATH_TO_SCB_MCP>/dist/index.jsClaude Desktop, Cursor
{
"mcpServers": {
"scb": {
"command": "node",
"args": [
"<YOUR_PATH_TO_SCB_MCP>/dist/index.js"
]
}
}
}