nl-opendata-mcp
The nl-opendata-mcp server provides an MCP interface to discover, explore, query, and export Dutch government open data from CBS (Statistics Netherlands) and data.overheid.nl, covering 4800+ statistical datasets.
Discovery & Search
List all available CBS datasets (with pagination) or search by keyword in title, summary, or both
Check whether a dataset is queryable via CBS OData or download-only via data.overheid.nl
Inspect dataset details: title, dimensions, measures, column definitions, data types, and sample rows
Estimate dataset size (row/column counts) and get a recommended fetch strategy before downloading
Metadata Retrieval
Retrieve dataset info, column structure, available endpoints, and dimension values/filter codes (e.g., gender, time period categories)
Data Querying & Export
Query datasets with OData filter syntax, column selection, pagination, and automatic translation of coded values to human-readable text
Save datasets to CSV files (full or partial, with optional value translation)
Save datasets to a DuckDB database for efficient local SQL querying
List previously downloaded local CSV files with their sizes and row counts
Analysis (optional, disabled by default due to security implications)
Execute Python/Pandas code directly on remote CBS datasets or local CSV files for on-the-fly statistics, filtering, and aggregation
Accesses Dutch government open data from CBS (Centraal Bureau voor de Statistiek), including browsing, searching, querying, and downloading over 4800 datasets.
Saves datasets directly to DuckDB for efficient SQL-based querying and analysis.
Executes Python Pandas code on datasets for custom data analysis and manipulation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nl-opendata-mcp search for CBS datasets about population"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NL OpenData MCP Server
A comprehensive Model Context Protocol (MCP) server for accessing Dutch government open data from CBS (Centraal Bureau voor de Statistiek) and data.overheid.nl.
This is a small side project to experiment with MCP and see if it can be useful for accessing Dutch government open data. It is not production ready and should not be used for production.
I have tested it with Claude Desktop and LM Studio and it works wreasonably well. It should work with the most MCP clients. The results are always dependent on the quality of the model you use. Frontier models understand data and mcp tools well and produce good results. Local models may not understand the tools calling and produce unexpected results.
For local models I got the best results using the Devstral2 small model with gpt-oss 20b close second. Context length is a very limiting factor for local models. Yo will need at least 30k tokens context length for basic analysis to work.
✨ Features
📊 Access 4800+ CBS Datasets - Browse and query statistical data on population, economy, health, environment, and more
🔍 Smart Search - Search datasets by title, summary, or both with local caching for fast results
📥 Flexible Data Fetching - Query, filter, and download datasets in CSV or Parquet format
🐍 Python Analysis - Execute Pandas code directly on datasets without downloading
🗂️ Dual Source Support - Check availability across CBS OData and data.overheid.nl
Related MCP server: mcp-overheid-nl
📦 Installation
Using uvx (Recommended)
# Run directly from PyPI
uvx nl-opendata-mcp
# Or run directly from GitHub
uvx --from git+https://github.com/soulnai/nl-opendata-mcp.git nl-opendata-mcpInstall with pip/uv
# Install from PyPI
uv pip install nl-opendata-mcp
# Install from GitHub
uv pip install git+https://github.com/soulnai/nl-opendata-mcp.gitFrom Source (Development)
# Clone the repository
git clone https://github.com/soulnai/nl-opendata-mcp.git
cd nl-opendata-mcp
# Install dependencies and package in editable mode
uv sync
uv pip install -e .
# Run the server
uv run nl-opendata-mcp🔧 Configuration
Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"nl-opendata-mcp": {
"command": "uvx",
"args": ["nl-opendata-mcp"]
}
}
}LM Studio
Add to your LM Studio configuration (mcp.json):
{
"mcpServers": {
"nl-opendata-mcp": {
"command": "uvx",
"args": ["nl-opendata-mcp"]
}
}
}With Environment Variables
The server supports different transport modes:
# Default: stdio transport
uvx nl-opendata-mcp
# HTTP transport (port 8000)
TRANSPORT=http uvx nl-opendata-mcp
# SSE transport (port 8000)
TRANSPORT=sse uvx nl-opendata-mcp🛠️ Available Tools
Discovery Tools
Tool | Description |
| List available datasets from the CBS catalog |
| Search datasets by keyword (in title, summary, or both) |
| Check if a dataset is available via CBS OData or data.overheid.nl |
| Estimate dataset size before fetching (rows, columns, recommended strategy) |
| Get comprehensive dataset summary (metadata, structure, sample data) |
Metadata Tools
Tool | Description |
| Unified metadata tool - get info, structure, dimension values, or custom endpoints |
cbs_get_metadata types:
metadata_type="info"- Dataset description (TableInfos)metadata_type="structure"- Column definitions and data types (DataProperties)metadata_type="endpoints"- Available metadata endpointsmetadata_type="dimensions"- Dimension values with codes for filtering (requiresendpoint_name)metadata_type="custom"- Query custom endpoint (requiresendpoint_name)
Data Fetching Tools
Tool | Description |
| Query data with filtering and column selection |
| Save dataset to CSV (use |
Analysis Tools (disabled by default)
Tool | Description |
| Execute Python/Pandas code on a remote dataset |
| Execute Python/Pandas code on a local CSV file |
📖 Usage Examples
1. Discovering Datasets
List available datasets:
Use cbs_list_datasets with top=20 to see the first 20 datasetsSearch for population data:
Use cbs_search_datasets with query="bevolking" to find population datasetsSearch only in titles:
Use cbs_search_datasets with query="inflatie" and search_field="title"2. Exploring a Dataset
Get a comprehensive overview (recommended first step):
Use cbs_inspect_dataset_details with dataset_id="85313NED"
# Returns:
# - Source confirmation (CBS OData or data.overheid.nl)
# - Title and description
# - Column definitions with types
# - Sample data (first 5 rows)Check dataset size before fetching:
Use cbs_estimate_dataset_size with dataset_id="85313NED"
# Returns:
# - Estimated row count
# - Column count
# - Recommended fetch strategyGet detailed column structure:
Use cbs_get_metadata with dataset_id="85313NED" and metadata_type="structure"
# Returns CSV with: Key, Type, Title, Description for each column3. Querying Data
Basic query with pagination:
Use cbs_query_dataset with:
- dataset_id="85313NED"
- top=100
- skip=0Query with OData filter:
Use cbs_query_dataset with:
- dataset_id="85313NED"
- filter="Perioden eq '2023JJ00'"
- top=50Select specific columns:
Use cbs_query_dataset with:
- dataset_id="85313NED"
- select=["Perioden", "TotaleBevolking_1", "Mannen_2", "Vrouwen_3"]
- top=100Query with multiple conditions:
Use cbs_query_dataset with:
- dataset_id="85313NED"
- filter="Perioden eq '2023JJ00' and Leeftijd eq '10000'"4. Downloading Full Datasets
Save complete dataset to CSV:
Use cbs_save_dataset with:
- dataset_id="85313NED"
- file_name="population_data.csv"
- fetch_all=true5. Analyzing Data
Note: Analysis tools are disabled by default. To enable them, set USE_PYTHON_ANALYSIS=true in the environment. It is security risk to let the model write and execute Python code on a client machine. Recommended for advanced users only. It's better to let the model query and save the data to a file, and let your CLI LLM coding tool to analyse it by writing and executing scripts. If you are running it in a non CLI environment (like LM Studio) and still want to give it the ability to analyse data, you can enable it by setting USE_PYTHON_ANALYSIS=true in the environment.
Analyze remote dataset with Pandas:
Use cbs_analyze_remote_dataset with:
- dataset_id="85313NED"
- analysis_code="print(df.describe())"Calculate statistics:
Use cbs_analyze_remote_dataset with:
- dataset_id="85313NED"
- analysis_code="result = df['TotaleBevolking_1'].mean()"Filter and aggregate:
Use cbs_analyze_remote_dataset with:
- dataset_id="85313NED"
- analysis_code="""
filtered = df[df['Perioden'].str.contains('2023')]
result = filtered.groupby('Leeftijd')['TotaleBevolking_1'].sum()
print(result)
"""Analyze a local CSV file:
Use cbs_analyze_local_dataset with:
- dataset_path="downloads/85313NED_full.csv"
- analysis_code="print(df.info())"6. Working with Metadata
Get classification codes (e.g., gender categories):
Use cbs_get_metadata with:
- dataset_id="85313NED"
- metadata_type="dimensions"
- endpoint_name="Geslacht"Get time period definitions:
Use cbs_get_metadata with:
- dataset_id="85313NED"
- metadata_type="dimensions"
- endpoint_name="Perioden"🎯 Common Workflows
Workflow 1: Quick Data Exploration
1. cbs_search_datasets(query="unemployment") # Find relevant datasets
2. cbs_inspect_dataset_details(dataset_id="82809NED") # Get overview
3. cbs_query_dataset(dataset_id="82809NED", top=10) # Preview dataWorkflow 2: Full Dataset Analysis
1. cbs_estimate_dataset_size(dataset_id="85313NED") # Check size
2. cbs_save_dataset(dataset_id="85313NED", fetch_all=True) # Save full dataset to CSV
3. cbs_analyze_local_dataset(...) # Analyze locally with PandasWorkflow 3: Filtered Data Export
1. cbs_get_metadata(dataset_id="85313NED", metadata_type="structure") # Get column names
2. cbs_get_metadata(dataset_id="85313NED", metadata_type="dimensions", endpoint_name="Perioden") # Get period codes
3. cbs_query_dataset(dataset_id="85313NED", filter="Perioden eq '2023JJ00'", select=["..."]) # Query
4. cbs_save_dataset(dataset_id="85313NED", file_name="filtered_data.csv") # Export📁 Output Formats
Format | Use Case |
CSV | Universal compatibility, works with Excel, Pandas, etc. |
🔗 OData Filter Examples
The CBS OData API uses OData v3 syntax for filtering:
# Exact match
Perioden eq '2023JJ00'
# Substring match
substringof('Amsterdam', RegioS)
# Multiple conditions
Perioden eq '2023JJ00' and Leeftijd eq '10000'
# OR conditions
Geslacht eq '1100' or Geslacht eq '2000'
# Numeric comparisons
TotaleBevolking_1 gt 100000📚 Resources
Available Tools
9 toolscbs_check_dataset_availabilityARead-onlyIdempotent
Checks if a dataset is available via CBS OData (queryable) or data.overheid.nl (download-only).
Args: params: DatasetIdInput containing: - dataset_id (str): Dataset ID (e.g., '83583NED')
Returns: str: Availability status and source information
Inputs: params (required). Returns: result
cbs_estimate_dataset_sizeARead-onlyIdempotent
Estimates the size of a dataset before fetching.
Args: params: DatasetIdInput containing: - dataset_id (str): Dataset ID (e.g., '85313NED')
Returns: str: Size estimation with row count, column count, and recommended fetch strategy
Inputs: params (required). Returns: result
cbs_get_metadataARead-onlyIdempotent
Unified metadata tool for detailed info, structure, dimension values, or custom endpoints.
Args: params: GetMetadataInput containing: - dataset_id (str): Dataset ID (e.g., '85313NED') - metadata_type (str): Type of metadata: - 'info': Dataset description (TableInfos) - 'structure': Column definitions (DataProperties) - 'endpoints': Available metadata endpoints - 'dimensions': Dimension values with codes for filtering (requires endpoint_name) - 'custom': Custom endpoint query (requires endpoint_name) - endpoint_name (str, optional): Required for 'dimensions' and 'custom' types (e.g., 'Geslacht', 'Perioden', 'Luchthavens')
Returns: str: CSV for info/structure/dimensions, JSON for endpoints/custom
Examples: - Get columns: metadata_type="structure" - Get dimension codes: metadata_type="dimensions", endpoint_name="Geslacht" - Get raw endpoint: metadata_type="custom", endpoint_name="CategoryGroups"
IMPORTANT - Finding Dimension Codes: Use metadata_type="dimensions" to find codes for OData filtering. CBS uses coded values (e.g., 'A043591') that map to names (e.g., 'Eindhoven Airport').
Workflow:
1. Get dimension codes: metadata_type="dimensions", endpoint_name="Luchthavens"
2. Use code in query: filter="Luchthavens eq 'A043591'"Inputs: params (required). Returns: result
cbs_inspect_dataset_detailsARead-onlyIdempotent
Compact dataset overview: title, dimensions, measures, and sample data. Use this first to understand a dataset's structure.
Args: params: DatasetIdInput containing: - dataset_id (str): Dataset ID (e.g., '85313NED')
Returns: str: Compact report with title, column list, and 3-row sample
Inputs: params (required). Returns: result
cbs_list_datasetsBRead-onlyIdempotent
Lists available datasets from the CBS OData Catalog.
Args: params: ListDatasetsInput containing: - top (int): Number of records to return (default: 10, max: 1000) - skip (int): Number of records to skip (default: 0)
Returns: str: CSV string containing dataset list with columns: Identifier, Title, Summary
Inputs: params (required). Returns: result
cbs_list_local_datasetsARead-onlyIdempotent
Lists all locally saved CSV datasets in the downloads directory.
Returns: str: List of CSV files with sizes and row counts.
Inputs: no named parameters. Returns: result
cbs_query_datasetARead-onlyIdempotent
Queries data from a dataset with optional filtering and column selection.
Args: params: QueryDatasetInput containing: - dataset_id (str): Dataset ID (e.g., '85313NED') - top (int): Number of records (default: 10) - skip (int): Records to skip (default: 0) - filter (str, optional): OData filter (e.g., "Perioden eq '2023JJ00'") - select (List[str], optional): Column names to return - compact (bool): Return summary for large results (default: True) - translate (bool): Translate coded dimension values to text (default: True)
Returns: str: CSV data with human-readable dimension values
Note: Use cbs_get_metadata with metadata_type="dimensions" to find filter codes.
Inputs: params (required). Returns: result
cbs_save_datasetBIdempotent
Saves a dataset to a CSV file.
Args: params: SaveDatasetInput containing: - dataset_id (str): Dataset ID (e.g., '85313NED') - file_name (str): File name to save the dataset - top (int): Records per request (default: 1000) - skip (int): Records to skip (default: 0) - fetch_all (bool): Fetch all records with pagination (default: False) - translate (bool): Translate coded values to text (default: True)
Returns: str: Success message with file path and record count
Inputs: params (required). Returns: result
cbs_search_datasetsARead-onlyIdempotent
Searches for datasets in the CBS OData Catalog by keyword.
Args: params: SearchDatasetsInput containing: - query (str): Search term (e.g., "Bevolking", "Inflation") - top (int): Number of records to return (default: 10) - skip (int): Number of records to skip (default: 0) - search_field (str): Where to search - "all", "title", or "summary"
Returns: str: CSV string containing matching datasets
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Every tool serves a clearly distinct purpose: listing, searching, checking availability, estimating size, retrieving metadata, inspecting details, querying data, saving to file, and listing local files. There is no overlap or ambiguity.
All tools follow a consistent 'cbs_verb_noun' pattern in snake_case (e.g., cbs_list_datasets, cbs_query_dataset). The naming is predictable and well-structured.
With 9 tools covering discovery, metadata, querying, and local storage, the count is well-scoped for a data access server. Each tool is justified and the set feels neither sparse nor bloated.
The tool surface covers the full lifecycle of working with CBS datasets: discovery, metadata inspection, size estimation, querying with filtering, and saving locally. Minor gaps exist (e.g., no delete for local files, no direct download without saving), but these do not hinder core workflows.
Maintenance
Related MCP Connectors
Search, sample and query open reproducible datasets published as immutable Parquet with schemas.
data.overheid.nl MCP — the Netherlands national open-data portal (CKAN API).
Live Dutch open data for AI assistants: transport, weather, water, traffic, housing, government.
Netherlands Open Data (data.overheid.nl/data) CKAN MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn unofficial MCP server providing access to Dutch government open data from data.overheid.nl, CBS statistics, and KVK business registry. Enables natural language queries for discovering datasets, inspecting metadata, and querying data without API keys or authentication.14MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to the Dutch national open-data portal (data.overheid.nl) via CKAN API, enabling listing organizations and datasets through direct tool calls or natural language queries.96 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables searching, viewing metadata, and querying tabular resources from Netherlands Open Data (data.overheid.nl) via CKAN.80 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables language models to search and query Statistics Netherlands open data, turning natural-language questions into traceable statistics by discovering tables, resolving codes, and retrieving filtered observations.1MIT