Open Data Spain MCP
About
MCP that unifies access to the main Spanish open data sources (BOE, INE, AEMET, Datos.gob.es)
Details
- Author
- albertouah
- Categories
- Search, Knowledge Base, Other
Jump to
Setup
Install Open Data Spain MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/albertouah/datos-gob-es-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
Hub de OpenData Espanol- Servidor MCP (Model Context Protocol) que unifica el acceso a las principales fuentes de datos abiertos de Espana en una sola interfaz.
Este servidor MCP actua como unhub centralizadoque conecta multiples APIs de datos publicos espanoles, permitiendo a asistentes de IA como Claude, ChatGPT y otros clientes MCP acceder a toda la informacion desde un unico punto.
- 11 herramientas MCPsimplificadas para consultar multiples APIs de datos publicos
- 5 recursos MCP(templates dinamicos) para acceso directo a datos
- 6 prompts MCPpara guias de busqueda detalladas
- Busqueda semantica: Busqueda por significado usando embeddings (IA)
- Cache de metadatos: Cache local de 24h para respuestas instantaneas
- Paginacion paralela: Descarga 5x mas rapida confetch_all=True
- Descarga integrada:get(id, include_data=true)en una sola llamada
- Busqueda AEMET por nombre: Usa nombres de municipio directamente (ej: "Madrid")
- Retry automatico: Reintentos con backoff exponencial para mayor resiliencia
- Sinonimos INE: Expansion de consultas para mejores resultados
- Cliente HTTP asincrono con rate limiting por API
- Modelos Pydantic para tipado seguro
- Listo para desplegar en FastMCP Cloud
# Clonar el repositorio git clone https://github.com/AlbertoUAH/datos-gob-es-mcp.git cd datos-gob-es-mcp # Crear entorno virtual e instalar make dev
# Crear entorno virtual python3 -m venv .venv source .venv/bin/activate # Instalar dependencias pip install -r requirements.txt
Crea un archivo.envbasandote en.env.example:
# Modo stdio (para clientes MCP) make run-stdio # O directamente mcp run server.py
flowchart TB subgraph Cliente["Cliente MCP"] ChatGPT["ChatGPT"] end subgraph MCP["Servidor MCP (FastMCP)"] Server["server.py"] end ChatGPT <-->|"Protocolo MCP"| Server subgraph Tools["TOOLS (11)"] subgraph ToolsDatosGob["datos.gob.es (2)"] search get end subgraph ToolsINE["INE (2)"] ine_search ine_download end subgraph ToolsAEMET["AEMET (3)"] aemet_list_locations aemet_get_observations aemet_get_forecast end subgraph ToolsBOE["BOE (3)"] boe_get_summary boe_get_document boe_search end end subgraph Resources["RESOURCES (5)"] R1["dataset://{id}"] R2["theme://{id}"] R3["publisher://{id}"] R4["format://{id}"] R5["keyword://{keyword}"] end subgraph Prompts["PROMPTS (6)"] P1["buscar_datos_por_tema"] P2["datasets_recientes"] P3["explorar_catalogo"] P4["analisis_dataset"] P5["guia_herramientas"] P6["buscar_estadisticas"] end Server --> Tools Server --> Resources Server --> Prompts subgraph APIs["APIs Externas"] API1["datos.gob.es"] API2["INE"] API3["AEMET"] API4["BOE"] end ToolsDatosGob --> API1 Resources --> API1 ToolsINE --> API2 ToolsAEMET --> API3 ToolsBOE --> API4
INE - Instituto Nacional de Estadistica (2 herramientas) - FUENTE PRINCIPAL DE ESTADISTICAS
El INE es lafuente oficial principalde estadisticas en Espana. Contiene datos de empleo (EPA), poblacion, precios (IPC), PIB, turismo, censos, y mas.
BOE - Boletin Oficial del Estado (3 herramientas)
Los IDs de temas, publicadores y provincias estan incluidos en las instrucciones del servidor MCP.
economia, hacienda, educacion, salud, medio-ambiente, transporte, turismo, empleo, sector-publico, ciencia-tecnologia, cultura-ocio, urbanismo-infraestructuras, energia
Publicadores principales (usar conpublisher=)
Templates dinamicos para acceso directo a datos de datos.gob.es:
Los prompts proporcionan guias estructuradas para tareas comunes de busqueda:
Usuario: Busca datasets sobre empleo en Andalucia Asistente: [Usa search(title="empleo Andalucia")]
Usuario: Encuentra datos sobre desempleo juvenil Asistente: [Usa search(query="desempleo juvenil")]
Usuario: Busca datasets de economia o hacienda Asistente: [Usa search(themes=["economia", "hacienda"])]
Obtener y descargar datos en una sola llamada
Usuario: Descarga los datos del dataset de presupuestos Asistente: [Usa get(dataset_id="l01280066-presupuestos", include_data=true)]
Usuario: Busca estadisticas sobre empleo Asistente: [Usa ine_search(query="empleo")] -> Obtiene operacion EPA (id: 30308) [Usa ine_search(operation_id="30308")] -> Lista tablas disponibles [Usa ine_download(table_id="4247", n_last=12)] -> Obtiene datos reales
Usuario: Dame el BOE de hoy Asistente: [Usa boe_get_summary()] Usuario: Dame el BOE del 2 de enero de 2025 Asistente: [Usa boe_get_summary(date="20250102")]
Usuario: Que tiempo hara manana en Madrid? Asistente: [Usa aemet_get_forecast(location="Madrid")] Usuario: Que tiempo hara en Sevilla? Asistente: [Usa aemet_get_forecast(location="Sevilla")]
Nota:aemet_get_forecastacepta tanto nombres de municipio como codigos (ej: "28079" para Madrid).
Anade a tu archivo de configuracionclaude_desktop_config.json:
{ "mcpServers": { "datos-gob-es": { "command": "mcp", "args": ["run", "/ruta/a/datos-gob-es-mcp/server.py"] } } }
make help # Mostrar ayuda make dev # Instalar en modo desarrollo make run # Ejecutar servidor make run-stdio # Ejecutar en modo stdio make inspect # Inspeccionar herramientas MCP make test # Ejecutar tests make lint # Verificar codigo con ruff make format # Formatear codigo con ruff make clean # Limpiar archivos de cache make notebooks # Iniciar servidor Jupyter # Benchmark de latencia python scripts/latency_benchmark.py
datos-gob-es-mcp/ ├── server.py # Servidor MCP principal ├── core/ # Modulo central │ ├── logging.py # Logging estructurado (structlog) │ ├── ratelimit.py # Rate limiting (aiolimiter) │ ├── config.py # Configuracion centralizada │ └── http.py # Cliente HTTP centralizado ├── integrations/ # APIs externas │ ├── ine.py # Instituto Nacional de Estadistica │ ├── aemet.py # Agencia de Meteorologia │ └── boe.py # Boletin Oficial del Estado ├── prompts/ # Guias de busqueda MCP ├── scripts/ # Scripts de utilidad │ └── latency_benchmark.py # Benchmark de latencia ├── examples/ # Jupyter notebooks de ejemplo ├── tests/ # Tests automatizados ├── docs/ # Documentacion adicional │ └── latency_report.md # Informe de latencia ├── requirements.txt # Dependencias Python ├── Makefile # Comandos de desarrollo └── README.md
- Con
PRELOAD_EMBEDDINGS_MODEL=true(habilitado por defecto). Verinforme completo.
Las contribuciones son bienvenidas. Por favor, abre un issue o pull request en el repositorio.
-
Model Context Protocol- Especificacion MCP- FastMCP- Framework para servidores MCP
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Fetch, convert, and search AWS documentation pages, with recommendations for related content.
Search campgrounds around the world on campertunity, check availability, and provide booking links.
The Ferryhopper MCP Server exposes ferry routes, schedules and booking redirects so an AI assistant can discover connections across Europe and the Mediterranean and send users to Ferryhopper to complete bookings.
All-in-One SEO & Web Intelligence Toolkit API from FetchSERP.
MCP server that provides read-only access to HyperKitty, the web-based email archive component of Mailman 3.
At Sunrise Apps, we believe AI agents should be limitless, especially when it comes to visual data. We created ImageSorcery to bridge the critical gap in AI's ability to interact with and manipulate images directly, all while upholding the highest standards of privacy and security.
Just Domain is the domain registrar for businesses built with AI. Its remote MCP server checks availability and returns first-year and renewal pricing, plus a link to register on justdomain.ai, with DNS and WHOIS privacy in the same place. No account, no API key, read only. Endpoint: https://mcp.justdomain.ai/
Research tools, including a Sqlite-backed document stash
Semantic search over 9 free-license stock photo sources. Hosted remote server with OAuth — no API key to paste.
SerpApi MCP Server for Google and other search engine results
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




