eurostat-mcp
eurostat-mcp
用于访问 Eurostat 数据的 MCP 服务器,专为本地模型设计(已针对 Qwen3.8-27B 测试):4 个工具、精简 schema、服务端校验、紧凑输出。
架构
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 长格式(
dims,time,value,flag),每个数据集一个文件,由 DuckDB 查询。query_data即使在非离线模式下也优先提供镜像数据,并显示数据日期(“本地镜像,Eurostat 数据日期为 JJ.MM.AAAA”)。结构 + 目录:每次同步时更新,离线模式下无 TTL 提供服务;当 Eurostat 不可达时,serve-stale-on-error。
失效由 TOC 的
last update of data列驱动,而不是 TTL:--resync只重新处理已修改的数据集。
骨架的局限性与后续演进
搜索:仅使用 FTS5/BM25。为模糊查询添加基于 embeddings 的混合搜索(例如 sqlite-vec 中的 bge-m3)。
结构:通过 Statistics API 上的
lastTimePeriod=1技巧获取。对于非常大的数据集,切换到 SDMX 2.1 的datastructure(XML)端点并做专门解析。数据缓存:当前只缓存结构。为
query_data的响应添加缓存(TTL 24 小时——Eurostat 数据发布在 11 点/23 点)。聚合:将 store.py 迁移到 DuckDB,在服务端提供聚合(平均值、增长)等,而不是向
query_data返回原始数据。HTTP 多用户:在 streamable HTTP 传输前添加 auth(bearer)和 rate limiting。
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