# AEMET [Health: Active]

**Category:** 🌳 Environment & Nature  
**Repository:** https://github.com/mmillan76/aemet-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 81  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/aemet

## Description
MCP server exposing AEMET (Spanish weather agency) forecasts, station data and warnings.

## Tools
Capabilities this server exposes over MCP:

- **get_municipality_forecast** — Get the daily weather forecast (up to 7 days) for a Spanish municipality from AEMET (Spanish State Meteorological Agency), identified by its INE code.
- **get_station_observation** — Get the last ~12 hours of hourly conventional observation data (temperature, wind, precipitation, etc.) for a specific AEMET automatic weather station.
- **get_weather_warnings** — 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.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "aemet": {
    "command": "npx",
    "args": ["-y","@mmillan76/aemet-mcp"],
    "env": {
      "AEMET_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `AEMET_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What AEMET MCP server does

The AEMET MCP server exposes selected public data from Spain’s Agencia Estatal de Meteorología through three typed MCP tools. It is intended for AI agents and clients that can launch standard input/output MCP servers.

The available data covers three use cases:

- Daily forecasts for a Spanish municipality, identified by its INE code, for up to seven days.
- Approximately the latest 12 hours of hourly observations from a weather station, including measurements such as temperature, wind, and precipitation.
- Active CAP weather alerts for a selected region or for Spain as a whole.

This makes the server suitable for assistants that need location-specific Spanish weather information, recent station readings, or a check for current warnings.

## How it works

The server communicates with its MCP client over stdio. A client starts the package, sends tool requests, and receives the resulting weather data; it is not designed to provide a standalone terminal interface.

Behind the tools, the server calls AEMET’s official OpenData API. AEMET uses a two-request response flow: an initial API call returns a JSON envelope containing a URL in `datos`, and a follow-up request retrieves the actual payload. The server handles this sequence internally, so callers receive the final data instead of managing the intermediate URL.

AEMET applies rate limits per API key. When a limit or other API error occurs, the server reports an error rather than silently retrying.

## Setup and configuration

The AEMET MCP server requires Node.js 20 or newer and a free AEMET OpenData API key. Keys can be requested through AEMET’s OpenData registration page. Set the key in `AEMET_API_KEY`; startup fails if that variable is absent.

No package installation is required for normal use. Configure an MCP client to run:

```bash
npx -y @mmillan76/aemet-mcp
```

Pass `AEMET_API_KEY` in the client’s environment. Claude Desktop and Claude Code can use this command-and-environment configuration, and other clients can use the same arrangement when they support stdio servers.

For local development, clone the repository, run `npm install`, create `.env` from `.env.example`, set the API key, and run `npm run build`. The compiled server can be inspected interactively with MCP Inspector using `node dist/index.js`, with the API key exported in the shell or loaded from the environment.

## Tools and capabilities

- `get_municipality_forecast`: retrieves a daily forecast for a Spanish municipality by INE code, covering up to seven days.
- `get_station_observation`: retrieves roughly 12 hours of hourly observations from a weather station, including weather measurements such as temperature, wind, and precipitation.
- `get_weather_warnings`: retrieves active CAP alerts for a region or all of Spain.

## Limitations and notes

The data source is limited to AEMET’s public Spanish weather services. Municipality forecasts require an INE code, and station observations require a weather station. API-key rate limits can affect requests. The server supports stdio rather than acting as an independently hosted HTTP service, and it does not silently retry failed or rate-limited API calls.

_Full upstream README: https://allmcps.com/mcp/aemet/readme_

