Skip to main content
Glama

mcp-csu

MCP server for the Czech Statistical Office (ČSÚ / CZSO) DataStat API. Gives AI assistants direct access to 700+ statistical datasets about the Czech Republic — population, economy, prices, wages, employment, industry, agriculture, trade, tourism, environment, and more.

Single Python file. No cloning required — just uvx mcp-csu.

Features

  • Full catalog access — search, browse, and inspect all 700+ datasets and 1500+ predefined tables

  • Data retrieval — fetch statistical data as CSV, query individual values with full context

  • AI-optimized output — human-readable text for metadata, CSV for data, automatic truncation with row counts

  • Rate limiting — built-in concurrency control (3 parallel requests) and minimum request interval (150ms)

  • Caching — catalog listings cached in memory for 10 minutes to avoid redundant requests

  • No authentication — the DataStat API is public

Related MCP server: datacube-sk

Prerequisites

  • uv (Python package runner)

That's it. Python and all dependencies are managed automatically by uv.

Configuration

Claude Code

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "csu": {
      "command": "uvx",
      "args": ["mcp-csu"]
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "csu": {
      "command": "uvx",
      "args": ["mcp-csu"]
    }
  }
}

Any MCP client

The server uses stdio transport (default). Launch command:

uvx mcp-csu

Data model

The DataStat database has a hierarchical structure:

Dataset (sada)              e.g. CEN0101H — "Míra inflace"
├── Dimensions (dimenze)    e.g. CasR (years), Uz0 (territory)
│   └── Items (položky)     e.g. "2024", "CZ"
├── Indicators (ukazatele)  e.g. 6134J06 — "Průměrná roční míra inflace"
└── Selections (výběry)     e.g. CEN0101HT01 — "Průměrná roční míra inflace"
    └── CSV data            pre-configured table ready to fetch

Datasets contain raw multidimensional data. Each dataset has dimensions (time, territory, categories) and indicators (what is measured).

Selections are predefined views — a specific slice of a dataset with fixed dimension arrangement. They are the easiest way to get data.

Tools

Discovery

search_datasets

Full-text search across all datasets. Returns dataset codes, names, time period types, and territory levels.

Parameter

Type

Required

Description

query

string

yes

Search keyword (Czech recommended)

search_datasets("inflace")
→ Found 3 dataset(s):
    WCEN01 (v4) — Index spotřebitelských cen (indexy, míra inflace)
    WCEN01M (v1) — Index spotřebitelských cen — měsíční data
    CEN0101H (v1) — Míra inflace

search_selections

Full-text search across all predefined data tables.

Parameter

Type

Required

Description

query

string

yes

Search keyword (Czech recommended)

search_selections("mzdy")
→ Found 30 selection(s):
    MZDQ1T1 — Průměrný evidenční počet zaměstnanců a průměrné hrubé měsíční mzdy...
      Period: Čtvrtletí | Territory: Stát | Dataset: MZDQ1

list_datasets

Paginated listing of all datasets.

Parameter

Type

Default

Description

offset

int

0

Skip first N items

limit

int

30

Items per page (max 100)

list_selections

Paginated listing of all predefined tables.

Parameter

Type

Default

Description

offset

int

0

Skip first N items

limit

int

30

Items per page (max 100)

Exploration

get_dataset

Full dataset metadata: dimensions with item counts, indicators with definitions, keywords, update frequency.

Parameter

Type

Required

Description

dataset_code

string

yes

Dataset code (e.g. CEN0101H)

get_dataset("CEN0101H")
→ Dataset: CEN0101H (v1)
  Name: Míra inflace
  Keywords: míra inflace
  Update frequency: MONTHLY

  Dimensions (4):
    CasM — Měsíce (720 items)
    CasR — Roky (61 items)
    CASRMX — Měsíce, roky (780 items)
    Uz0 — Území (1 items)

  Indicators (4):
    6134J09 — Přírůstek průměrného ročního indexu spotřebitelských cen - měsíční
    6134J06 — Průměrná roční míra inflace
    ...

get_dataset_selections

List predefined data tables for a specific dataset.

Parameter

Type

Required

Description

dataset_code

string

yes

Dataset code

get_dataset_selections("CEN0101H")
→ Selections for CEN0101H (2):
    CEN0101HT01 — Průměrná roční míra inflace
      Period: Rok | Territory: Stát
    CEN0101HT02 — Míra inflace - měsíční
      Period: Měsíc | Territory: Stát

get_dimension_items

Get all possible values for a dimension. Supports hierarchy level filtering and pagination.

Parameter

Type

Default

Description

dimension_code

string

—

Dimension code from get_dataset()

level

string

null

Filter by hierarchy level (e.g. STAT, KRAJ, OKRES)

offset

int

0

Skip first N items

limit

int

50

Items per page (max 200)

get_dimension_items("UZ023H2U", level="KRAJ")
→ Dimension UZ023H2U — 14 item(s) at level KRAJ:
    CZ010 — Hlavní město Praha (Capital City Prague) [KRAJ]
    CZ020 — Středočeský kraj (Central Bohemian Region) [KRAJ]
    CZ031 — Jihočeský kraj (South Bohemian Region) [KRAJ]
    ...

get_indicator

Indicator definition and display format.

Parameter

Type

Required

Description

indicator_code

string

yes

Indicator code from get_dataset()

Data retrieval

get_selection_data

Primary data access tool. Fetches CSV data from a predefined selection.

Parameter

Type

Default

Description

selection_code

string

—

Selection code (e.g. CEN0101HT01)

max_rows

int

100

Max data rows. 0 = unlimited

get_selection_data("CEN0101HT01", max_rows=5)
→ "Ukazatel","Území","Roky","Hodnota"
  "Průměrná roční míra inflace","Česko","2025","2.5"
  "Průměrná roční míra inflace","Česko","2024","2.4"
  "Průměrná roční míra inflace","Česko","2023","10.7"
  "Průměrná roční míra inflace","Česko","2022","15.1"
  "Průměrná roční míra inflace","Česko","2021","3.8"

  [Showing 5 of 29 rows. Use max_rows=0 for all data or max_rows=10 to see more.]

get_value

Retrieve a single specific value. The most precise query — returns one number with full context (indicator name, dimension labels, publication date).

Parameter

Type

Default

Description

dataset_code

string

—

Dataset code

indicator_code

string

—

Indicator code

dimension_codes

list[str]

—

Dimension codes in order

item_codes

list[str]

—

Item codes matching dimensions

version

string

null

Dataset version (latest if omitted)

get_value("RSO01", "3971b",
          ["CasR", "TYPPROSJED", "UZ023H2U"],
          ["2023", "501", "CZ"])
→ Value: 6 258
  Indicator: Počet územních jednotek
    Roky: 2023
    Typ prostorové jednotky: Obec
    ČR, kraje, okresy: Česko
  Published: 2024-04-30T07:00:00Z

custom_query

Execute an arbitrary data query on a dataset. Returns CSV.

This is an advanced tool — prefer get_selection_data() when a suitable predefined table exists. The custom query API is sensitive to correct dimension placement and hierarchy level filtering.

Parameter

Type

Default

Description

dataset_code

string

—

Dataset code

dataset_version

string

—

Version from get_dataset()

columns

list[dict]

—

Column dimensions (each needs kodDimenze)

rows

list[dict]

—

Row dimensions

table_filters

list[dict]

null

Filter dimensions

max_rows

int

100

Max CSV rows

get_dataset_metadata

Dataset content statistics: record count, time range, publication and update timestamps.

Parameter

Type

Required

Description

dataset_code

string

yes

Dataset code

version

string

yes

Version from get_dataset()

Usage examples

Get Czech inflation rate

1. search_datasets("inflace")
   → CEN0101H — Míra inflace

2. get_dataset_selections("CEN0101H")
   → CEN0101HT01 — Průměrná roční míra inflace

3. get_selection_data("CEN0101HT01")
   → CSV with annual inflation rates from 1994 to present

Find average wages by region

1. search_selections("mzdy kraje")
   → MZDQ1T2 — ... dle krajů a regionů soudržnosti

2. get_selection_data("MZDQ1T2", max_rows=20)
   → CSV with wages by region

Get exact population of Prague in 2023

1. search_datasets("obyvatelstvo")
   → OBY01 — Obyvatelstvo podle pohlaví a věku

2. get_dataset("OBY01")
   → see dimensions and indicators

3. get_dimension_items("<territory_dim>", level="KRAJ")
   → find Prague code

4. get_value("OBY01", "<indicator>",
             ["<time_dim>", "<territory_dim>"],
             ["2023", "<prague_code>"])
   → exact value

The database is in Czech. Common search terms:

Czech

English

Example datasets

obyvatelstvo

population

OBY01, OBY02

mzdy

wages

MZDQ1, MZD01

ceny

prices

CEN01, CEN02

inflace

inflation

CEN0101H

HDP

GDP

NUC06R, NUC06Q

nezaměstnanost

unemployment

ZAM04

průmysl

industry

PRU01

stavebnictví

construction

STA01

vzdělání

education

VZD01

zdraví

health

ZDR01

zemědělství

agriculture

ZEM01

doprava

transport

DOP01

cestovní ruch

tourism

CRU01

životní prostředí

environment

ZPR01

kriminalita

crime

KRI01

volby

elections

VOL01

bytová výstavba

housing

BYT01

zahraniční obchod

foreign trade

VZO01

Technical details

Architecture

Single-file Python server using FastMCP framework over stdio transport. Dependencies managed via PEP 723 inline script metadata — uv run installs them automatically into an isolated environment.

Upstream API

The server wraps two DataStat REST APIs:

API

Base URL

Purpose

Catalog

https://data.csu.gov.cz/api/katalog/v1

Dataset/selection/dimension/indicator metadata

Data

https://data.csu.gov.cz/api/dotaz/v1

Data retrieval (CSV, JSON-STAT)

API documentation:

Rate limiting

The DataStat API does not document rate limits, but the server applies conservative throttling:

  • Max concurrent requests: 3 (semaphore)

  • Min request interval: 150ms (global)

  • Request timeout: 60 seconds

Caching

Catalog listings (list_datasets, list_selections) are cached in memory with a 10-minute TTL. These endpoints return the full catalog (700–1500 items) on every call since the API ignores pagination parameters — caching avoids repeated large transfers.

Output formatting

  • Metadata tools return structured text with clear labels

  • Data tools return CSV (most compact and LLM-friendly tabular format)

  • Truncation: data responses are limited to 100 rows by default, with total count shown. Adjustable via max_rows parameter

  • Language: all API responses are in Czech (Accept-Language: cs)

Dependencies

Package

Version

Purpose

mcp

>=1.0.0

MCP server framework (FastMCP)

httpx

>=0.27.0

Async HTTP client

Both installed automatically by uv run.

License

MIT

Available Tools

12 tools
custom_queryA

Execute a custom data query on a dataset (advanced).

IMPORTANT: Prefer get_selection_data() for predefined tables — it is much simpler and more reliable. Use custom_query only when no suitable predefined selection exists.

Caveats:

  • All dataset dimensions must be placed in columns, rows, or table_filters.

  • Datasets with multiple time dimensions (e.g., CasM + CasR + CASRMX) may only work with certain dimension combinations matching predefined selections.

  • Hierarchical territory dimensions may need "filtr" with "urovenHierarchieKod".

Args: dataset_code: Dataset code. dataset_version: Dataset version string from get_dataset(). columns: Column dimensions. Each dict must have "kodDimenze" (str). Optionally add "filtr" with [{"zobrazitPolozky": ["code1","code2"]}]. rows: Row dimensions. Same structure as columns. Use "kodDimenze": "#UKAZATEL" to put indicators as rows. table_filters: Header/filter dimensions. Same structure, but can also include "filtrTabulkyKod" (str) to filter to a single item. max_rows: Max CSV rows to return.

Inputs: dataset_code (required), dataset_version (required), columns (required), rows (required), +2 more. Returns: result

get_datasetA

Get detailed info about a dataset: description, dimensions, indicators, keywords.

Use this to understand dataset structure before querying data. The dimension codes and indicator codes are needed for get_value() and custom_query().

Inputs: dataset_code (required). Returns: result

get_dataset_metadataA

Get metadata about dataset content: record count, time range, last update.

Args: dataset_code: Dataset code. version: Dataset version from get_dataset().

Inputs: dataset_code (required), version (required). Returns: result

get_dataset_selectionsB

List predefined data tables for a specific dataset.

These selections can be fetched directly with get_selection_data(code). This is the recommended way to find available pre-built data views.

Inputs: dataset_code (required). Returns: result

get_dimension_itemsA

Get possible values for a dimension (e.g., years, regions, categories).

Args: dimension_code: Dimension code from get_dataset() output (e.g., CasR, Uz0). level: Filter by hierarchy level code (e.g., STAT, KRAJ, OKRES). offset: Skip first N items. limit: Max items to return (default 50, max 200).

Item codes are needed for get_value() and custom_query().

Inputs: dimension_code (required), level, offset, limit. Returns: result

get_indicatorC

Get detailed information about a statistical indicator.

Returns the indicator's full definition, display format, and related datasets.

Inputs: indicator_code (required). Returns: result

get_selection_dataA

Fetch actual statistical data from a predefined selection as CSV.

This is the primary and most reliable way to get data. Find selection codes via search_selections() or get_dataset_selections().

Args: selection_code: Selection code (e.g., CEN0101HT01). max_rows: Maximum number of data rows to return (default 100). Set to 0 for unlimited (use with caution — some tables are very large).

Inputs: selection_code (required), max_rows. Returns: result

get_valueA

Get a single specific value from a dataset.

This is the most precise way to query data — returns exactly one value. Requires knowing the exact dimension and item codes from get_dataset() and get_dimension_items().

Args: dataset_code: Dataset code (e.g., RSO01). indicator_code: Indicator code (e.g., 3971b). dimension_codes: List of dimension codes (e.g., ["CasR", "TYPPROSJED", "UZ023H2U"]). item_codes: List of item codes matching dimension_codes order (e.g., ["2023", "501", "CZ"]). version: Dataset version (optional, defaults to latest).

Example: Number of municipalities in Czech Republic in 2023: get_value("RSO01", "3971b", ["CasR","TYPPROSJED","UZ023H2U"], ["2023","501","CZ"])

Inputs: dataset_code (required), indicator_code (required), dimension_codes (required), item_codes (required), +1 more. Returns: result

list_datasetsA

List all available datasets with pagination.

Use offset and limit to page through results. Total: ~730 datasets.

Inputs: offset, limit. Returns: result

list_selectionsA

List all predefined data tables (selections) with pagination.

Selections are pre-configured data views that can be fetched directly. Use get_selection_data(code) to retrieve their data.

Inputs: offset, limit. Returns: result

search_datasetsA

Search for statistical datasets by keyword.

Search works best with Czech terms: obyvatelstvo=population, mzdy=wages, ceny=prices, nezaměstnanost=unemployment, průmysl=industry, HDP=GDP, inflace=inflation, vzdělání=education, zdraví=health.

Returns dataset codes usable with get_dataset() and get_dataset_selections().

Inputs: query (required). Returns: result

search_selectionsA

Search for predefined data tables (selections) by keyword.

Selections are pre-configured views of datasets — the easiest way to get data. Retrieve their data with get_selection_data(code). Search in Czech for best results.

Inputs: query (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of the CSU data workflow: discovery, metadata, dimension exploration, and data retrieval. Even the three query tools (get_value, get_selection_data, custom_query) are clearly differentiated by use-case guidance, making selection unambiguous.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern using snake_case (e.g., get_dataset, list_datasets, search_selections). The one outlier, custom_query, still adheres to the same pattern, so naming is uniform and predictable.

    Tool Count5/5

    With 12 tools covering search, listing, metadata, dimension exploration, and multiple query methods, the set is well-scoped for the CSU domain. No tools feel redundant or missing for core operations.

    Completeness5/5

    The tools provide end-to-end coverage: dataset discovery (list/search), structure exploration (get_dataset, get_dimension_items, get_indicator), and data retrieval (predefined selections, custom queries, single values). No obvious gaps exist in the statistical data access lifecycle.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables querying Czech Statistical Office open data through MCP tools and natural language questions.
      95 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables querying statistical data from the Statistical Office of the Slovak Republic via natural language or direct tool calls.
      85 npm
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to look up Czech companies, VAT status, entity KYC snapshots, address standardization, and Czech identifier validation via official ARES data.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to query official Statistics Denmark data without an API key — pulling national population counts and trends, browsing the subject tree, searching available tables, inspecting variable metadata, and retrieving detailed breakdowns by region, age, sex, and period in JSON-stat, bulk, or CSV format.
      84 npm
      MIT