eurostat-mcp
eurostat-mcp
Eurostat のデータにアクセスするための MCP サーバー。ローカルモデル向けに設計 (Qwen3.8-27B でテスト済み):ツールは 4 つ、スキーマは限定、サーバー側で 検証、出力はコンパクト。
アーキテクチャ
Modèle (Qwen3.8-27B via vLLM / llama.cpp + harness MCP)
│ tool calls
▼
server.py 4 tools : search_datasets, get_structure, list_codes, query_data
│ validation DSD + suggestions difflib + plafond 400 cellules
▼
store.py SQLite : catalogue en FTS5 (TTL 24h), structures DSD (TTL 24h)
▼
eurostat_client.py API dissémination Eurostat (catalogue TSV + Statistics JSON-stat)モデルは SDMX URL を直接構築することはない。すべてのリクエストは query_data
を経由し、キャッシュされた DSD に照らしてディメンションとコードを検証し、
対処可能なエラー(Code 'FRA' inconnu. Vouliez-vous : FR ?)を返す。
Related MCP server: DuckDB Eurostat MCP Server
インストール
pip install "mcp>=1.2" httpx pyarrow duckdb # SDK mcp 1.x et 2.x
python -m territorial_mcp.server # stdio
MCP_TRANSPORT=http python -m territorial_mcp.server # streamable HTTPMCP クライアント設定(stdio):
{
"mcpServers": {
"eurostat": {
"command": "python",
"args": ["-m", "territorial_mcp.server"],
"cwd": "/chemin/vers/eurostat-mcp"
}
}
}モデル側の典型的なフロー
search_datasets("GDP quarterly")→ 候補コードget_structure("namq_10_gdp")→ ディメンション、切り詰めたコードlist_codes("namq_10_gdp", "geo", contains="fr")必要に応じてquery_data("namq_10_gdp", {"geo": "FR+BE", "na_item": "B1GQ", "unit": "CP_MEUR"}, time_from="2022")
Qwen3.8-27B に関する注記:推論レベルは中または低めに固定すること(既定の
xhigh は単純なツールの連携を考えすぎてしまう)。
完全オフラインモード
# 1. (en ligne) construire le miroir — TOC-driven, idempotent
python -m territorial_mcp.mirror --datasets nama_10_gdp,une_rt_m
python -m territorial_mcp.mirror --all # tout le catalogue, ~24 Go compressés
python -m territorial_mcp.mirror --resync # cron quotidien : ne retélécharge
# que ce que le TOC signale comme modifié
# 2. (hors ligne) servir uniquement depuis le miroir + caches
EUROSTAT_OFFLINE=1 python -m territorial_mcp.serverデータ:Parquet に zstd 圧縮された long 形式(dims, time, value, flag)、 データセットごとに 1 ファイル、DuckDB で照会される。
query_dataは オフラインモードでなくてもミラーを優先して提供し、データの日付 ("miroir local, données Eurostat du JJ.MM.AAAA")を表示する。構造+カタログ:同期のたびに更新され、オフラインモードでは TTL なしで 提供される。Eurostat に接続できない場合は serve-stale-on-error。
無効化は TTL ではなく、TOC の
last update of data列によって制御される。--resyncは変更されたデータセットのみに作用する。
スケルトンの限界と今後の拡張
検索:FTS5/BM25 のみ。あいまいなクエリのため、エンベディング (例:sqlite-vec 内の bge-m3)を使ったハイブリッド検索を追加する。
構造:Statistics API の
lastTimePeriod=1という手法で取得する。 非常に大きなデータセットでは、専用パーサを伴う SDMX 2.1 のdatastructure(XML)エンドポイントに移行する。データキャッシュ:キャッシュされるのは構造のみ。
query数据の応答5 キャッシュ(TTL 24 時間 — Eurostat は 11 時/23 時に公開)を追加する。集計:store.py を DuckDB に移行し、モデルへ生データを返すのではなく、 サーバー側で集計(平均、成長率)を提供する。
HTTP マルチユーザー:streamable HTTP トランスポートの前に、 認証(bearer)とレート制限を追加する。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceExposes the Eurostat Statistics API, enabling LLMs to discover, explore, and retrieve official EU statistical data through search, dimension inspection, and data retrieval tools.2
- AlicenseNot gradedqualityCmaintenanceEnables querying Eurostat data using natural language, powered by DuckDB for optimized performance.MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Eurostat statistical data through natural language or direct MCP tools, wrapping the Eurostat API without authentication.6MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to European Central Bank statistical data through SDMX data flows, enabling querying and listing of data flows via natural language or direct tool calls.3MIT
Related MCP Connectors
Search and query the Eurostat catalogue — EU economy, demography, trade, and NUTS regional data.
Eurostat MCP — wraps Eurostat Statistical Data API (no auth required)
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/scampion/nutshell-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server