Skip to main content
Glama
AEMET-MCP

AEMET-MCP

by AnCode666

AEMET-MCP. Integration via MCP with the AEMET API

en es

DESCRIPTION

AEMET is the State Meteorological Agency of Spain.

Aemet-mcp allows you to retrieve historical climate data and meteorological information from the AEMET API directly from Claude AI and other MCP compatible clients, using the Model Context Protocol (MCP).

Aemet-mcp is an MCP server that exposes tools enabling LLMs to query data from weather stations across Spain.

It includes secure handling of API keys and resource JSON files for using supporting data.

Related MCP server: Weather MCP

KEY FEATURES

  • Query for historical daily values (temperature, wind, precipitation, etc.)

  • Access to monthly climate summaries by station.

  • Filtering by year, month, and AEMET station code.

  • Query beach conditions, including ultraviolet radiation indices.

  • Rainfall data analysis prompt for Spanish municipalities with historical precipitation data

  • Responses ready for use in JSON format.

INSTALLATION

Installing via Smithery

To install AEMET Weather Data Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @AnCode666/aemet-mcp --client claude

Install with uv

Prerequisites

  • Python 3.10 or higher.

  • uv package manager.

Installing uv

The first step is to install uv, a package manager for Python.
It can be installed from the command line.

On macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

You can also install it with pip:

pip install uv

For more information about installing uv, visit the uv documentation.

Install with Docker

You can also run AEMET-MCP using Docker:

Prerequisites

  • Docker installed on your system

Steps

  1. Build the Docker image:

docker build -t aemet-mcp .
  1. Run the container:

docker run -e AEMET_API_KEY=YOUR_AEMET_API_KEY aemet-mcp

Replace YOUR_AEMET_API_KEY with your actual API key from AEMET.

Integration with Claude Desktop using Docker

To use the Docker version with Claude Desktop, add this configuration to your claude_desktop_config.json:

"aemet_mcp_docker": {
    "command": "docker",
    "args": [
        "run",
        "--rm",
        "-i",
        "-e", "AEMET_API_KEY=YOUR_AEMET_API_KEY",
        "aemet-mcp"
    ]
}

INTEGRATION WITH CLIENTS LIKE CLAUDE DESKTOP

Once uv is installed, you can use the MCP server from any compatible client such as Claude for Desktop, in which case the steps to follow are:

  1. Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json

  2. Add the following block inside "mcpServers":

"aemet_mcp_": {
    "command": "uvx",
    "args": [
        "aemet_mcp"
    ],
    "env": {
        "AEMET_API_KEY": "YOUR_AEMET_API_KEY"
    }
}
  1. Get a free API key from AEMET at: https://opendata.aemet.es/centrodedescargas/altaUsuario

  2. Replace YOUR_AEMET_API_KEY with your actual API key (leave the quotes).

  3. If you already have another MCP server configured, separate each with a comma ,.

In general, to integrate it into any other MCP-compatible client such as Cursor, CODEGPT, or Roo Code, simply go to the MCP server configuration of your client and add the same code block.

USAGE EXAMPLES

Once properly configured, you can ask things like:

  • "What's the weather like in Seville?"

  • "Give me a list of the beaches in the province of Málaga"

  • "Tell me the radiation levels at Maspalomas beach for tomorrow"

  • "Give me the historical rainfall data for Albacete between January 1st, 2020 and February 1st, 2020"

  • "Give me a list of the weather stations within a 50 km radius from the coordinates lat:40.4165, lon:-3.70256"

Rainfall Data Analysis

The server includes a specialized prompt for analyzing historical precipitation data for Spanish municipalities. Use the obtener_datos_lluvia_municipio prompt with:

obtener_datos_lluvia_municipio("Madrid", "2023-01-01", "2023-12-31")

This prompt provides structured guidance for meteorological analysis, including:

  • Municipality code search and validation

  • Nearest weather station identification

  • Historical precipitation data retrieval

  • Statistical analysis and trend identification

  • Climate pattern analysis with seasonal variations

  • Data visualization recommendations

DISTRIBUTIONS

Smithery

Glama

MseeP

MCP Review

MCP review certified

Available Tools

9 tools
find_nearby_stationsB

Find weather stations within a given radius (in km) from a given geographic coordinate.

Args: lat: Latitude in decimal degrees (e.g., 43.36) lon: Longitude in decimal degrees (e.g., -8.41) radio_km: Search radius in kilometers

Inputs: lat (required), lon (required), radio_km.

get_beach_data_uvA

Query information on beaches or UV index from AEMET.

Args: name_or_code: Partial or full name of the beach, or its BEACH_ID. Also accepts 'list' or 'list:'. dias_frc: Number of forecast days, starting form 0, which means 0 days from today, to 4, which means 4 days from today. query_type: 'beach' for forecast, 'UV_index' for UV index, must be in english.

Returns: Requested information or list of matches.

Inputs: nombre_o_codigo (required), dias_frc (required), tipo_consulta.

get_daily_forecastB

Get the daily weather forecast for a Spanish municipality.

Args: municipality_code: AEMET municipality code (e.g., "28079" for Madrid)

Inputs: municipality_code (required).

get_historical_dataA

Obtain historical meteorological data for a specific station.

Args: station_id: Identifier of the station (e.g. "3195" for Madrid Retiro) start_date: Start date in format YYYYY-MM-DD end_date: End date in format YYYYY-MM-DD

Inputs: station_id (required), start_date (required), end_date (required).

get_station_dataB

Obtain specific weather data for a weather station.

Args: station_id: Station identifier (e.g., "8416Y" for Valencia))

Inputs: station_id (required).

get_station_listA

Get a list of all available weather stations or filter by one or more search terms, including approximate matches.

Args: search_terms: Optional terms (space or comma separated) to filter stations by name or province.

Inputs: search_terms.

monthly_climate_dataC

Retrieve monthly climatological data for a specific weather station.

Args: station_id: Weather station identifier (e.g., "3195" for Madrid Retiro). year: Year (YYYY). month: Month (1-12).

Returns: A JSON with the monthly climate summary.

Inputs: station_id (required), year (required), month (required).

search_municipality_codeA

Search Spanish municipalities by name or province (accent-insensitive, typo-tolerant).

Args: nombre: Partial or approximate name of a municipality or province.

Returns: A list of matching municipalities with their codes and provinces.

Inputs: nombre (required).

solve_beach_codeC

Search beaches by name, province, or municipality.

Args: nombre: Search string (accent-insensitive) tipo: One of 'playa', 'provincia', or 'municipio'

Inputs: nombre (required), tipo.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation5/5

    Every tool targets a distinct resource or operation: stations (find, list, get data, historical, monthly), beaches (search, get data), daily forecast, and municipality search. No overlapping purposes.

    Naming Consistency3/5

    Naming conventions are mixed: some use 'get_', others 'find_', 'search_', 'solve_', and one is adjective_noun ('monthly_climate_data'). While all are descriptive, the pattern is inconsistent.

    Tool Count5/5

    Nine tools is well-scoped for a weather data API covering stations, beaches, forecasts, historical data, and municipality lookup. Each tool serves a clear purpose without unnecessary duplication.

    Completeness4/5

    The tool set covers core weather queries: station listings, current data, daily forecasts, historical and monthly climate, beach info, and UV index. Missing are alerts or radar, but the surface is largely complete for common use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server built with the mcp-framework to provide weather-related tools and data to AI clients. It enables integration of weather capabilities and custom tools into the MCP ecosystem for use with platforms like Claude Desktop.
      9 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A MCP server for querying real-time weather information for any city worldwide using the free Open-Meteo API, supporting CLI and integration with AI clients like Claude and Cursor.
      46 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to answer Mexico weather questions using official government data, resolving municipality names via INEGI and fetching forecasts from CONAGUA/SMN.
      -