pxweb-mcp
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., "@pxweb-mcp fetch population data for Norway in 2023 from SSB"
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.
pxweb-mcp
MCP server for accessing statistical data via the PxWeb API v2.
Quick Start
npx -y @jarib/pxweb-mcp
npx -y @jarib/pxweb-mcp --transport streamable-http --port 3000Related MCP server: mcp-stat-lv
Known PxWeb v2 Instances
Organization | URL |
Statistics Norway (SSB) |
|
Statistics Sweden (SCB) |
|
Use the --url option to connect to a different instance:
npx @jarib/pxweb-mcp --url https://statistikdatabasen.scb.se/api/v2Development
pnpm install
pnpm build
node build/index.jsConfiguration
{
"mcpServers": {
"pxweb": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}Links
License
MIT
Available Tools
6 toolsfetch_metadataA
Fetch detailed metadata for a table to understand its structure.
Returns variable IDs, value codes, elimination info, and available code lists. Use this to construct queries.
Inputs: table_id (required), language.
get_code_listA
Fetch a code list (valueset or grouping).
Valuesets (vs_*): Lists of valid values for a variable. Groupings (agg_*): Aggregation mappings (e.g., municipality mergers).
Find available code lists in table metadata under 'codeLists'.
Inputs: code_list_id (required), language.
get_table_infoA
Get basic information about a table (title, time range, variables).
Use this for a quick overview before fetching full metadata.
Inputs: table_id (required), language.
list_recent_tablesA
List tables updated in the past N days.
Use this to find newly published statistics.
Inputs: days (required), language.
query_tableB
Query data from a table using the v2 API syntax.
Value selection syntax:
Specific values: valueCodes[Region]=0301,0402
All values: valueCodes[Region]=*
Wildcard: valueCodes[Konsumgrp]=?? (two-digit codes)
Latest N: valueCodes[Tid]=top(5)
From value: valueCodes[Tid]=from(2020M01)
Range: valueCodes[Region]=[range(01,05)]
Output formats: json-stat2, csv, xlsx, html, px, json-px
For csv/xlsx/html, use stub and heading to control layout.
Inputs: table_id (required), value_codes (required), language, code_list, +2 more.
search_tablesA
Search for tables in Statistics Norway (SSB) database.
Supports wildcards (*) at end of words, boolean operators (AND, OR), and special filters:
title:word - search only in titles
updated:20250908* - tables updated on date
"word1 word2"~5 - proximity search (words within 5 words of each other)
Geographic indicators in titles: (F) = county, (K) = municipality, (B) = city district.
Inputs: query (required), language, include_discontinued.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Tools are mostly separable: search_tables and list_recent_tables both discover tables but use different criteria, and query_table/get_code_list have unique roles. The only mild overlap is get_table_info versus fetch_metadata, where the descriptions distinguish basic overview from detailed query-building metadata.
All tool names follow the same verb_noun snake_case pattern (search_tables, query_table, get_code_list, etc.). The use of fetch instead of get in fetch_metadata is a minor synonym variation but does not break the overall pattern.
Six tools is a well-scoped size for a statistical data server, covering discovery, metadata inspection, code lists, and querying. Each tool has a distinct role and none feels like filler.
The tool set supports the full user workflow: find tables, inspect metadata, resolve code lists, and query data. For a read-only public statistics API, there are no obvious missing operations that would create dead ends.
Maintenance
Related MCP Connectors
Statistics Norway (SSB) PxWebApi MCP.
MCP server for Statistics Sweden (SCB) - 1200+ tables with population, economy, environment data
Experimental MCP exploring Statistics Finland PxWeb statistical datasets.
Statistics Denmark (Danmarks Statistik / Statbank) MCP. Keyless REST API: https://api.statbank.dk/v1
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for official statistics from Statistics Finland (Tilastokeskus) — the StatFin database, exposed through the PxWeb API. Search 3000+ tables, inspect their dimensions, and pull data as JSON-stat2.451 npmMIT
- AlicenseNot gradedqualityCmaintenanceMCP server that enables querying Latvian official statistics from data.stat.gov.lv via PxWeb tables, allowing retrieval of table definitions and data through natural language or direct tool calls.296 npmMIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Statistics Norway (SSB) PxWebApi, enabling table metadata queries via a single tool.299 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for accessing Norges Bank exchange rates and interest rates via SDMX data flows.100 npmMIT