aemet-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aemet-mcp What are the active weather warnings in Spain today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
aemet-mcp
MCP server that exposes public weather data from AEMET (Agencia Estatal de Meteorología, Spain) to AI agents and MCP-compatible clients.
Three tools, well-typed, backed by AEMET's official OpenData API:
get_municipality_forecast— daily forecast (up to 7 days) for a Spanish municipality, by INE code.get_station_observation— last ~12h of hourly observation data (temperature, wind, precipitation…) from a weather station.get_weather_warnings— active weather warnings (CAP alerts) for a region or all of Spain.
Prerequisites
Node.js 20+
A free AEMET OpenData API key: request one at https://opendata.aemet.es/centrodedescargas/altaUsuario
Related MCP server: Weather MCP Server
Installation
No install needed — run it directly with npx:
npx -y @mmillan76/aemet-mcpThe server communicates over stdio, so it's meant to be launched by an MCP client rather than run standalone in a terminal.
Configuration
The server reads the API key from the AEMET_API_KEY environment variable.
It exits with an error at startup if it's missing.
Claude Desktop / Claude Code
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"aemet": {
"command": "npx",
"args": ["-y", "@mmillan76/aemet-mcp"],
"env": {
"AEMET_API_KEY": "your-api-key-here"
}
}
}
}Any other MCP client that supports stdio servers works the same way — point
it at npx -y @mmillan76/aemet-mcp with AEMET_API_KEY set in the environment.
Local development
git clone https://github.com/mmillan76/aemet-mcp.git
cd aemet-mcp
npm install
cp .env.example .env # fill in AEMET_API_KEY
npm run buildTest tool calls interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js(the Inspector reads AEMET_API_KEY from your shell environment, so export
it — or source .env — before running the command above)
Notes on the AEMET API
AEMET OpenData uses a two-step pattern on every endpoint: the first request
returns a JSON envelope with a datos URL, not the actual data; a second
request to that URL returns the real payload. This server hides that detail
— tools just return the final data. Rate limits apply per API key; if you
hit them, the tool returns a clear error instead of retrying silently.
License
MIT — see LICENSE.
Available Tools
3 toolsget_municipality_forecastGet municipality forecastA
Get the daily weather forecast (up to 7 days) for a Spanish municipality from AEMET (Spanish State Meteorological Agency), identified by its INE code.
Inputs: municipioCode (required).
get_station_observationGet station observationA
Get the last ~12 hours of hourly conventional observation data (temperature, wind, precipitation, etc.) for a specific AEMET automatic weather station.
Inputs: idema (required).
get_weather_warningsGet weather warningsA
Get the latest active weather warnings (CAP alerts) issued by AEMET for a Spanish region or the whole country: severity level, phenomenon, affected zone and validity.
Inputs: area (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a clearly distinct data type: forecasts for municipalities, observations from stations, and weather warnings. No overlap in purpose or resource.
All tool names follow the identical pattern 'get_' followed by a specific data type (municipality_forecast, station_observation, weather_warnings). This is consistent and predictable.
Three tools is well-scoped for a weather data server, covering the core data types without unnecessary bloat. Each tool has a clear and distinct purpose.
The tool set covers the primary weather data types (forecast, observation, warnings) for the AEMET domain. Minor gaps might include historical data or air quality, but the core surface is complete for typical use.
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that allows retrieving meteorological and climate data from Spain's State Meteorological Agency (AEMET) API directly from Claude AI and other MCP-compatible clients.95MIT
- AlicenseNot gradedqualityDmaintenanceMCP Server for global weather, forecasts, air quality, and climate data using Open-Meteo, no API key required.31 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides current weather and forecasts via Open-Meteo API, with an optional ML-based next-day max temperature prediction.-
- AlicenseAqualityCmaintenanceMCP server for weather forecasts via Open-Meteo (no API key needed), providing current weather, hourly, and daily forecasts with geocoding support.3MIT