Skip to main content
Glama

statline-mcp

🇳🇱 Nederlandse versie

MCP server for the CBS StatLine OData API (Statistics Netherlands). The full table catalog (~6,000 tables) is cached locally in SQLite (FTS5) and is searchable; an MCP user can then navigate through a table and retrieve the figures.

Tools

Tool

Purpose

search_tables

Search the catalog by title/description (prefix matching, nl/en, current tables by default)

get_table_info

Description, period, status and dimensions of a table

get_table_measures

Measures (columns) with unit and topic group, searchable

list_dimension_values

Valid values of a dimension (regions, periods, categories), searchable

query_data

Retrieve figures with filters, pagination and labels

refresh_catalog

Show cache status / refresh the catalog (automatically after 24 hours)

Typical flow: search_tables("werkloosheid") → get_table_info("85224NED") → list_dimension_values(..., "Perioden") → query_data(..., filters={"Perioden": "laatste:4kw"}).

Note: most CBS tables are in Dutch. English versions exist for part of the catalog (table IDs ending in ENG); use language="en" in search_tables to restrict results to those.

Filters in query_data

For each dimension you can pass:

Input

Meaning

"GM0363"

a key

"Amsterdam"

a title (case-insensitive)

"2023*"

all values starting with 2023

"laatste", "laatste:5"

the most recent 1 or 5 values ("laatste" = latest)

"laatste:4kw", "laatste:3jaar", "laatste:12maand"

same, but counting only quarters / years / months (useful for mixed periods)

Multiple values in a list are combined with OR, different dimensions with AND.

Related MCP server: mcp-cbs-nl

Installation

You need uv. uv fetches a suitable Python (≥ 3.10) itself if needed.

Option 1: straight from GitHub (no clone needed)

uvx --from git+https://github.com/pascal-cbs/MCP-server-StatLine statline-mcp

This starts the server over stdio. You normally won't run this yourself; instead, let an MCP client launch the command (see below).

Option 2: clone locally

git clone https://github.com/pascal-cbs/MCP-server-StatLine.git
cd MCP-server-StatLine
uv sync
uv run statline-mcp   # starts the server over stdio

Adding to Claude Code

With option 1 (from GitHub):

claude mcp add statline -- uvx --from git+https://github.com/pascal-cbs/MCP-server-StatLine statline-mcp

With option 2 (local copy):

claude mcp add statline -- uv --directory /path/to/MCP-server-StatLine run statline-mcp

By default the server applies to the current project only. To make it available in all your projects:

claude mcp add --scope user statline -- uvx --from git+https://github.com/pascal-cbs/MCP-server-StatLine statline-mcp

Then check with claude mcp list that the server is connected, or type /mcp in Claude Code. Start a new session if needed, then try for example:

Find a CBS table about unemployment and give me the last four quarterly figures.

Remove it with claude mcp remove statline.

Adding to other MCP clients

For Claude Desktop and other clients with a JSON configuration (for Claude Desktop: claude_desktop_config.json):

{
  "mcpServers": {
    "statline": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/pascal-cbs/MCP-server-StatLine", "statline-mcp"]
    }
  }
}

For a local copy use "command": "uv" with "args": ["--directory", "/path/to/MCP-server-StatLine", "run", "statline-mcp"]. If the client cannot find uv/uvx, give the full path (which uvx).

Configuration (environment variables)

  • STATLINE_CACHE_DIR – cache directory (default ~/.cache/statline-mcp)

  • STATLINE_CATALOG_MAX_AGE_HOURS – maximum age of the catalog cache (default 24)

The first search fetches the catalog from CBS (a few seconds); after that, searching runs locally.

Notes

  • Data comes from TypedDataSet; pagination with offset automatically uses the ODataFeed endpoint because ODataApi does not support $skip.

  • CBS keys are sometimes padded with spaces ('GM0363 '); the server handles this and returns trimmed values.

  • CBS does not return a total row count; use next_offset to keep paginating.

Available Tools

6 tools
get_table_infoA

Beschrijving van één tabel plus zijn dimensies (waar je op filtert) en aantal meetwaarden.

Dit is het startpunt om door een tabel te navigeren. Gebruik daarna get_table_measures voor de kolommen en list_dimension_values voor de waarden van een dimensie.

Args: table_id: Tabel-ID zoals '83765NED' of '85874ENG'. full_description: Voeg de lange officiële toelichting toe (kan veel tekst zijn).

Inputs: table_id (required), full_description. Returns: object

get_table_measuresA

Lijst de meetwaarden (kolommen met cijfers) van een tabel, met eenheid en onderwerpgroep.

Args: table_id: Tabel-ID. search: Filter op tekst in titel, sleutel, groep of omschrijving. limit: Maximaal aantal meetwaarden (1-200). offset: Aantal over te slaan (paginering).

Inputs: table_id (required), limit, offset, search. Returns: object

list_dimension_valuesA

Lijst de geldige waarden van een dimensie (bv. regio's, perioden, geslacht, bedrijfstakken).

De 'key' kun je gebruiken in query_data.filters. Perioden-sleutels hebben vorm als '2023JJ00' (jaar), '2023KW01' (kwartaal), '2023MM01' (maand).

Args: table_id: Tabel-ID. dimension: Dimensie-sleutel of -titel uit get_table_info (bv. 'Perioden', 'RegioS'). search: Filter op tekst in sleutel, titel of groep (bv. 'amsterdam'). limit: Maximaal aantal waarden (1-500). offset: Aantal over te slaan (paginering).

Inputs: table_id (required), dimension (required), limit, offset, +1 more. Returns: object

query_dataA

Haal cijfers op uit een CBS-tabel.

Filters per dimensie accepteren: een sleutel ('GM0363'), een titel ('Amsterdam'), een voorvoegsel met sterretje ('2023*' = alle perioden van 2023), of 'laatste' / 'laatste:5' voor de meest recente 1 resp. 5 waarden. Bij een tijddimensie met gemengde perioden (jaar + kwartaal) voeg je een type toe: 'laatste:4kw' (4 kwartalen), 'laatste:3jaar', 'laatste:12maand'. Meerdere waarden in een lijst worden met OF gecombineerd, verschillende dimensies met EN. Een dimensie zonder filter levert alle waarden op.

Voorbeeld: filters={"RegioS": ["Amsterdam", "Utrecht"], "Perioden": "laatste:3"}, measures=["Werkloosheid"].

Args: table_id: Tabel-ID. filters: {dimensie: waarde(n)}. Zie list_dimension_values voor geldige waarden. measures: Meetwaarden (sleutel of (deel van) titel). Standaard de eerste 10. limit: Maximaal aantal rijen per aanroep (1-1000). offset: Aantal rijen om over te slaan (paginering). labels: Toon dimensiewaarden als titel (standaard), sleutel of beide. odata_filter: Extra ruwe OData $filter-expressie (voor gevorderd gebruik), met AND toegevoegd.

Inputs: table_id (required), limit, labels, offset, +3 more. Returns: object

refresh_catalogA

Toon de status van de lokale cataloguscache en ververs hem desgewenst.

De catalogus wordt automatisch ververst als hij ouder is dan 24 uur.

Args: force: Haal de catalogus nu opnieuw op bij het CBS.

Inputs: force. Returns: object

search_tablesA

Doorzoek de CBS-catalogus (ca. 6000 tabellen) op titel en beschrijving.

Zoektermen worden als voorvoegsel gematcht (bv. 'werkloos' vindt 'werkloosheid'); alle termen moeten voorkomen, anders valt de zoekactie terug op 'minstens één term'. Een tabel-ID (bv. '83765NED') kan ook direct worden opgegeven.

Args: query: Zoektekst, bv. 'huizenprijzen gemeente' of 'unemployment'. language: Beperk tot Nederlandstalige ('nl') of Engelstalige ('en') tabellen. include_discontinued: Neem ook stopgezette tabellen mee (standaard alleen actuele). limit: Maximaal aantal resultaten (1-50). offset: Aantal resultaten om over te slaan (voor volgende pagina).

Inputs: query (required), limit, offset, language, +1 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct stage of the CBS data workflow: cache refresh, catalog search, table metadata, measure listing, dimension values, and data querying. Although several tools take a table_id, their purposes are clearly separated by descriptions and expected outputs.

    Naming Consistency5/5

    All tool names use snake_case and follow a predictable verb_noun pattern: refresh_catalog, search_tables, get_table_info, get_table_measures, list_dimension_values, query_data. There is no mixing of conventions.

    Tool Count5/5

    Six tools cleanly cover the full read-only pipeline from dataset discovery to data retrieval. The count is well-scoped, with no redundant or missing steps for the server's apparent purpose.

    Completeness5/5

    The surface covers catalog refresh, search, table metadata, dimensions, measures, and data querying, which are the essential operations for CBS StatLine access. No obvious lifecycle gaps remain for a read-only statistical data server.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables accessing and querying Dutch government open datasets from CBS and data.overheid.nl, with tools for searching, filtering, downloading, and analyzing data using CSV, Parquet, DuckDB, or Pandas.
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables querying Statistics Netherlands (CBS) data, including metadata for tables like '37296eng', through an MCP interface.
      90 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Access Statbel Belgium open data via natural language queries. Provides tools to query bestat datasets through an MCP gateway.
      71 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables searching, exploring, and querying over 1,500 OECD statistical datasets via SDMX, covering national accounts, employment, trade, PISA, health, and more.
      384 npm
      5
      Apache 2.0