MCP server for check Spanish climate data using AEMET web API
Configuration
View docs{
"mcpServers": {
"ancode666-aemet-mcp": {
"command": "uvx",
"args": [
"aemet_mcp"
],
"env": {
"AEMET_API_KEY": "YOUR_AEMET_API_KEY"
}
}
}
}You can access historical climate data and meteorological information from Spain’s AEMET API directly through MCP-compatible clients. This server exposes tools that let you query daily values, monthly summaries, beach conditions, and rainfall analyses, all while securely handling API keys and supporting data files.
Once you have the MCP server running, you can interact with it from any compatible client. You’ll authenticate with your API key and then ask natural language questions like querying historical temperatures for a city, listing nearby weather stations, checking Beach and UV indices, or retrieving rainfall data for a municipality over a date range. You can leverage specialized prompts to drive rainfall analysis, station lookups, and data retrieval, with results formatted for easy consumption by your client.
Prerequisites you need to meet before installation are as follows.
1) Ensure you have Python 3.10 or higher installed.
2) Install the uv package manager for Python.
3) Optionally, install additional deployment options such as Docker or Smithery to run the MCP server in different environments.
Installation with uv
Install uv (choose one of the methods below):
curl -LsSf https://astral.sh/uv/install.sh | sh
```
"```
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex""}Alternatively, install uv with pip:
pip install uvInstall with Smithery (optional) to enable automatic integration with Claude Desktop:
npx -y @smithery/cli install @AnCode666/aemet-mcp --client claudeYou can run the MCP server in a Docker container. Build the image and launch it with your AEMET API key.
docker build -t aemet-mcp .
```
"```
```bash
docker run -e AEMET_API_KEY=YOUR_AEMET_API_KEY aemet-mcpIf you are integrating with Claude Desktop through Docker, configure the client to run the MCP server with the AEMET API key.
"aemet_mcp_docker": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e", "AEMET_API_KEY=YOUR_AEMET_API_KEY",
"aemet-mcp"
]
}To enable MCP access from Claude Desktop, add the following entry to your MCP server configurations.
"aemet_mcp_": {
"command": "uvx",
"args": [
"aemet_mcp"
],
"env": {
"AEMET_API_KEY": "YOUR_AEMET_API_KEY"
}
}You can ask for current and historical data such as the following examples. Use natural language and the MCP server will return structured data ready for your client to consume.
- What is the weather like in Seville?
- List beaches in the province of Málaga.
- Show radiation levels at Maspalomas beach for tomorrow.
- Retrieve historical rainfall data for Albacete between 2020-01-01 and 2020-02-01.
- Find weather stations within 50 km of lat 40.4165, lon -3.70256.
A specialized prompt helps analyze historical precipitation data for a municipality. Use the prompt to identify municipality codes, find the nearest weather station, retrieve data, and perform statistical and climate pattern analyses.
# Example usage of the rainfall analysis prompt
obtener_datos_lluvia_municipio("Madrid", "2023-01-01", "2023-12-31")Prompts for rainfall data analysis for a municipality, including municipality code lookup, nearest weather station, historical precipitation retrieval, statistical analysis, climate pattern exploration, and visualization recommendations.