
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 分