
Scb Opendata Mcp
io.github.ashwinvis由 GitHub 帳號 ashwinvis 發布v0.2.1更新於 Oct 24, 2026
Statistics Sweden’s open data made available as an MCP server, using Python and FastMCP
概覽
讓助理透過 SCB PxWebApi v2 瀏覽並取得瑞典統計局的開放統計表、代碼清單與已儲存查詢。
- 可以做什麼
- 提供工具來列出與搜尋約 5,155 個統計表、讀取表中繼資料與變數,並依選用條件取得表資料。它也提供有效篩選值的代碼清單、預設選取,以及儲存、取得與刪除查詢的已儲存查詢工具。結果支援分頁,並支援英文或瑞典文標籤。
- 適用情境
- 當助理需要關於就業、勞動成本、薪資或類似民用資料的瑞典官方統計資料,並希望在對話中完成表的探索與篩選資料取得,而非手動呼叫 API 時,適合使用。
- 執行需求
- 以 Python 套件(scb-opendata-mcp)透過 stdio 在本機執行,需要 Python 3.11 或更高版本以及 pip 或 uv。需要網路存取瑞典統計局的 PxWebApi v2。未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Scb Opendata Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:README.md,提交 a13e0b5
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分