Unlocking Government Statistics for AI Assistants

Official statistics from the German Federal Statistical Office (Destatis) and Eurostat are among the most valuable public data sources in Europe. They cover everything from population demographics and economic indicators to labor markets, health data, environmental metrics, and international trade. But accessing this data has traditionally required navigating complex web portals, understanding arcane table naming conventions, and manually exporting files.

The Destatis MCP Server changes this by implementing the Model Context Protocol (MCP) to give AI assistants like Claude direct, programmatic access to both the Destatis GENESIS database and Eurostat statistical data. Ask your AI about German GDP growth, population trends, or unemployment rates — and it will query the official sources in real time.

„What is the current unemployment rate in Germany?“ — Your AI will query Destatis GENESIS and return the official answer, with the table reference.“

The Problem

Despite being freely available, official statistical data remains underutilized due to access barriers:

  • Complex interfaces: The GENESIS-Online portal requires knowledge of table IDs, variable codes, and classification systems
  • No AI integration: AI assistants cannot natively query Destatis or Eurostat; users must manually search, export, and paste data
  • Language barriers: Many statistical tables are only available in German, making them inaccessible to international researchers
  • Format limitations: Data comes in various formats (HTML, CSV, Excel, flat files) that require different handling
  • Large dataset handling: Requests returning more than 40,000 values require special job-based processing
  • Authentication requirements: Full API access requires API tokens or username/password credentials

The Solution

The Destatis MCP Server wraps the entire GENESIS REST API and Eurostat data access in a set of MCP tools that any compatible AI assistant can discover and call. It supports both STDIO transport (for Claude Desktop) and SSE transport (for web-based integration), making it versatile across deployment scenarios.

The server handles authentication, pagination, large dataset jobs, format conversion, and multilingual support (German and English) transparently — so the AI (and the user) only needs to ask a natural language question.

Key Features

Feature Description
Dual Data Sources Access both Destatis GENESIS (German) and Eurostat (European) statistical databases
Full Category Coverage Economy, population, labor, health, environment, trade, prices, production, social statistics, and more
Comprehensive Search Search across tables, statistics, variables, and cubes with configurable result limits
Multiple Output Formats HTML, CSV, Excel (XLSX), JSON, and Flat File CSV formats
Multilingual German and English language options for all queries
Advanced Filtering Filter by year range, region, country, and classification variables
Large Dataset Support Job system for requests exceeding 40,000 values
Dual Transport STDIO for Claude Desktop and SSE for web-based integration
Dynamic Configuration Web interface for updating API tokens and credentials per session
Production Deployed Live at destatis-mcp.bigdataheaven-software.de with SSL/TLS

Technology Stack

  • Protocol: Model Context Protocol (MCP) with STDIO and SSE transport
  • Language: Full TypeScript implementation with comprehensive type definitions
  • Runtime: Node.js
  • APIs: Destatis GENESIS REST API 2020 + Eurostat data API
  • Authentication: API token (default provided), username/password for extended access
  • SSE Server: Express-based with CORS support and session management
  • Deployment: Docker support with docker-compose, plus native Node.js
  • Production URL: https://destatis-mcp.bigdataheaven-software.de/
  • Default Port: 3004
  • License: MIT

Architecture

The server supports two deployment modes to cover different integration scenarios:

Mode 1: Claude Desktop (STDIO)
+----------------+     STDIO      +------------------+     HTTPS     +----------------+
| Claude Desktop | <-----------> | Destatis MCP     | <----------> | GENESIS API    |
|                |               | Server           |              | Eurostat API   |
+----------------+               +------------------+              +----------------+

Mode 2: Web Integration (SSE)
+----------------+     SSE/HTTP    +------------------+     HTTPS     +----------------+
| Web AI Client  | <-----------> | SSE Server       | <----------> | GENESIS API    |
| (Browser)      |               | (Port 3004)      |              | Eurostat API   |
+----------------+               +------------------+              +----------------+
                                       |
                                 /config (Web UI)
                                 /health (Status)
                                 /sse (MCP Channel)
                                 /messages (Commands)

The SSE server adds several capabilities beyond basic STDIO transport:

  • Dynamic token configuration: Users can update API credentials through a web interface at /config
  • Session management: Separate configurations per connected session
  • Real-time notifications: SSE-based updates for authentication and configuration changes
  • CORS support: Configurable for web client integration

Available MCP Tools

The server exposes seven tools covering the full GENESIS API surface:

  • test_connection — Verify API connectivity and authentication
  • find_data — Search for statistical data across tables, statistics, variables, or cubes
  • get_table — Retrieve a statistical table by ID with format, year, region, and classification filters
  • get_table_metadata — Get metadata information for a specific table
  • get_variable — Retrieve information about a statistical variable
  • get_cube — Retrieve data cubes in CSV, Excel, or Flat File CSV format
  • get_statistics — Get information about a specific statistic
  • get_job — Retrieve results from previously submitted large-data jobs

Common Statistical Areas

The Destatis GENESIS database covers all major statistical domains in Germany:

Domain (German) Domain (English) Example Topics
Bevolkerung Population Census data, demographics, migration
Wirtschaft Economy GDP, production, business climate
Arbeitsmarkt Labor Market Employment, unemployment, wages
Bildung Education Schools, universities, qualifications
Gesundheit Health Hospitals, diseases, health spending
Umwelt Environment Emissions, waste, energy, climate
Verkehr Transportation Roads, railways, shipping, aviation

Deployment Options

The server supports multiple deployment strategies:

# Claude Desktop (STDIO mode)
npm start

# SSE Web Server
npm run start:sse

# Docker deployment
docker-compose up -d

# Manual Docker
docker build -t destatis-mcp .
docker run -p 3004:3004 destatis-mcp

The production instance is already deployed and accessible at https://destatis-mcp.bigdataheaven-software.de/ with SSL/TLS encryption, ready for immediate use by web-based AI clients.

Conclusion

The Destatis MCP Server transforms one of Europe’s richest public data sources into an AI-accessible resource. By implementing the Model Context Protocol, it allows AI assistants to autonomously search, retrieve, and present official German and European statistics in response to natural language questions. For researchers, analysts, journalists, and policymakers, this means instant access to authoritative data without navigating complex portals or memorizing table codes. The dual transport support (STDIO and SSE) ensures compatibility with both desktop and web-based AI clients, making official statistics truly accessible to everyone.