AK

ano-kuhanathan/eurostat-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 5 forks 质量 67 趋势 18MIT

A Model Context Protocol (MCP) server that provides tools to query Eurostat APIs for European statistics data.

概览

A Model Context Protocol (MCP) server that provides tools to query Eurostat APIs for European statistics data. - - Find Eurostat datasets by keyword - - Retrieve data with flexible filtering options - - Save data locally for further analysis - : - SDMX 3.0 API for regular datasets (GDP, unemployment, population, etc.) - SDMX 2.1 Comext API for trade/production datasets (DS-prefixed) - Python 3.10 or higher - uv (recommended) or pip Add the following to your Claude Desktop configuration file: : ~/Library/Application Support/Claude/claude_desktop_config.json : %APPDATA%\Claude\claude_desktop_config.json Add to your Claude Code settings (.claude/settings.json in your project or ~/.claude/settings.json globally): - NAMA_10_GDP - GDP and main components - NAMQ_10_GDP - Quarterly GDP - UNE_RT_M - Monthly unemployment rate - UNE_RT_A - Annual unemployment rate - LFSI_EMP_A - Employment rates

README

以下为原文 README 节选,完整内容请查看原文。

Eurostat MCP Server

A Model Context Protocol (MCP) server that provides tools to query Eurostat APIs for European statistics data.

Features

  • Search datasets - Find Eurostat datasets by keyword
  • Query data - Retrieve data with flexible filtering options
  • Export to CSV - Save data locally for further analysis
  • Support for both APIs:
    • SDMX 3.0 API for regular datasets (GDP, unemployment, population, etc.)
    • SDMX 2.1 Comext API for trade/production datasets (DS-prefixed)

Available Tools

Tool Description
search_datasets Search for datasets by keyword
get_dataset_info Get metadata and dimensions for a dataset
query_eurostat_data Query data with filters (geo, time, etc.)
get_available_values List valid values for a dimension
list_popular_datasets Show commonly used datasets by category
export_to_csv Export data to a local CSV file
export_multiple_datasets Batch export multiple datasets

Installation

Prerequisites

  • Python 3.10 or higher
  • uv (recommended) or pip
# Clone the repository
git clone https://github.com/YOUR_USERNAME/eurostat-mcp.git
cd eurostat-mcp

# Install dependencies
uv pip install -r requirements.txt

Install with pip

# Clone the repository
git clone https://github.com/YOUR_USERNAME/eurostat-mcp.git
cd eurostat-mcp

# Create virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Configuration

Claude Desktop

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "eurostat": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/eurostat-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

Or with Python directly:

{
  "mcpServers": {
    "eurostat": {
      "command": "python",
      "args": ["/path/to/eurostat-mcp/server.py"]
    }
  }
}

Claude Code (CLI)

Add to your Claude Code settings (.claude/settings.json in your project or ~/.claude/settings.json globally):

{
  "mcpServers": {
    "eurostat": {
      "command": "python",
      "args": ["/path/to/eurostat-mcp/server.py"]
    }
  }
}

Usage Examples

Search for datasets

Search for GDP datasets
→ search_datasets("GDP")

Query unemployment data

Get monthly unemployment rate for Germany and France in 2024
→ query_eurostat_data(
    dataset_id="UNE_RT_M",
    geo="DE+FR",
    time_period="ge:2024"
  )

Query international trade data (Comext)

Get German exports to China in 2024
→ query_eurostat_data(
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "eurostat": { "command": "uv", "args": [ "--directory", "/path/to/eurostat-mcp", "run", "server.py" ] } } }