scb-opendata-mcp

scb-opendata-mcp

A FastMCP server that provides access to Statistics Sweden's PxWebApi v2, enabling querying of statistical tables on employment, wages, and other Swedish civil data.

Category
访问服务器

README

MCP Server for Statistics Sweden (SCB) API

PyPI

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

pip install scb-opendata-mcp

# Or with uv
uvx scb_opendata_mcp

Install from source

# Clone the repository
git clone https://github.com/ashwinvis/scb-opendata-mcp.git
cd scb-opendata-mcp

# Install dependencies
pip install .

# Or with uv
uv sync

Usage

Running the server

The package on installation

scb_opendata_mcp

# Or with uv
uv run scb_opendata_mcp

See scb_opendata_mcp --help for available options. An stdio transport mechanism also exists.

Fallback option

uv run fastmcp run src/scb_opendata_mcp/server.py -t http  # HTTP server

Configuration for common agent harnesses

Claude Code

claude mcp add --scope user --transport http scb_opendata_mcp http://localhost:6767

Mistral Vibe

In ~/.vibe/config.toml or ~/.vibe/agents/name_of_agent.toml:

[[mcp_servers]]
name = "scb_opendata_mcp"
transport = "http"
url = "http://localhost:6767/mcp"

OpenCode

In ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "scb_opendata_mcp": {
      "type": "remote",
      "url": "https://localhost:6767/mcp",
      "enabled": true
    }
  }
}

Tools Available

Table Discovery

  • list_tables() - List all available statistical tables with pagination
  • get_table_metadata(table_id) - Get detailed metadata including variables
  • search_tables(query) - Convenience wrapper over list_tables, to search tables by name or description

Data Retrieval

  • get_table_data(table_id, filters) - Fetch data with optional filtering
  • get_table_default_selection(table_id) - Get default data selection for a table

Codelist Tools

  • list_codelists(table_id) - List all available codelists for the table
  • get_codelist(codelist_id) - Get specific codelist details

Saved Query Tools

  • get_saved_query(query_id) - Get a saved query including data and selection criteria
  • get_saved_query_data(query_id) - Get data from a specific saved query
  • get_saved_query_selection(query_id) - Get the selection query used in a specific saved query
  • save_query(table_id, selection) - Save a data query
  • delete_saved_query(query_id) - Delete a saved query

Development

Running Tests

uv run pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Support

For issues or questions:

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.

<!-- mcp-name: io.github.ashwinvis/scb-opendata-mcp -->

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选