
Scb Opendata Mcp
io.github.ashwinvisPublished by GitHub account ashwinvisv0.2.1Updated Oct 24, 2026
Statistics Sweden’s open data made available as an MCP server, using Python and FastMCP
Overview
Lets an assistant browse and fetch Statistics Sweden's open statistical tables, codelists, and saved queries through the SCB PxWebApi v2.
- What you can do
- Provides tools to list and search roughly 5,155 statistical tables, read table metadata and variables, and fetch table data with optional filters. It also exposes codelists for valid filter values, default selections, and saved-query tools to save, retrieve, and delete queries. Results support pagination and English or Swedish labels.
- When to use it
- Use it when an assistant needs official Swedish statistics on employment, labor costs, wages, or similar civil data, and you want table discovery and filtered data retrieval inside the chat rather than manual API calls.
- Requirements
- Runs locally as a Python package (scb-opendata-mcp) over stdio, requiring Python 3.11 or higher and pip or uv. It needs network access to Statistics Sweden's PxWebApi v2. No accounts, API keys, or environment variables are declared.
Installation
In SourceWeft
- Open Scb Opendata Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
MCP Server for Statistics Sweden (SCB) API
A FastMCP server that provides access to Statistics Sweden's PxWebApi v2, offering statistical tables covering employment, labor costs, wages, and other civil data from Sweden.
Features
- Table Discovery: Browse and search 5,155 statistical tables
- Data Retrieval: Fetch statistical data with optional filtering
- Codelists: Access code lists for valid filter values
- Saved Queries: Save and retrieve frequently used queries
- Pagination: Handle large result sets efficiently
- Language Support: English and Swedish
- Error Handling: Robust error handling with retry logic
Installation
Prerequisites
- Python 3.11 or higher
- pip or uv package manager
Install from PyPI
Install from source
Usage
Running the server
The package on installation
See scb_opendata_mcp --help for available options. An stdio transport mechanism also exists.
Fallback option
Configuration for common agent harnesses
Claude Code
Mistral Vibe
In ~/.vibe/config.toml or ~/.vibe/agents/name_of_agent.toml:
OpenCode
In ~/.config/opencode/opencode.jsonc:
Tools Available
Table Discovery
list_tables()- List all available statistical tables with paginationget_table_metadata(table_id)- Get detailed metadata including variablessearch_tables(query)- Convenience wrapper overlist_tables, to search tables by name or description
Data Retrieval
get_table_data(table_id, filters)- Fetch data with optional filteringget_table_default_selection(table_id)- Get default data selection for a table
Codelist Tools
list_codelists(table_id)- List all available codelists for the tableget_codelist(codelist_id)- Get specific codelist details
Saved Query Tools
get_saved_query(query_id)- Get a saved query including data and selection criteriaget_saved_query_data(query_id)- Get data from a specific saved queryget_saved_query_selection(query_id)- Get the selection query used in a specific saved querysave_query(table_id, selection)- Save a data querydelete_saved_query(query_id)- Delete a saved query
Development
Running Tests
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
Support
For issues or questions:
- Review the OpenAPI specification or alternatively from https://github.com/PxTools/PxApiSpecs/blob/master/PxAPI-2.yml.
- Visit Statistics Sweden API documentation:
SCB Open Data Skills
This is an unofficial companion repository SCB Open Data Skills that provides skill definitions for accessing Statistics Sweden's data through this MCP server. These skills are designed to work with major coding agent tools and provide workflows for various statistical domains.
Disclaimer
This is an unofficial tool. The code was generated using AI while using official documents and the API specification as context. Tests are also added to verify the functionality. A thorough rigorous verification test is recommended before using it in any serious application.
Source: README.md at commit a13e0b5
Tools
0Version history
1- v0.2.1LatestSep 16, 2026
Score
50% 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 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 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