AEMET API integration with MCP (Model Context Protocol)
Project description
AEMET-MCP. Integration via MCP with the AEMET API
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.
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
- Build the Docker image:
docker build -t aemet-mcp .
- 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:
- Go to Claude > Settings > Developer > Edit Config >
claude_desktop_config.json - Add the following block inside
"mcpServers":
"aemet_mcp_": {
"command": "uvx",
"args": [
"aemet_mcp"
],
"env": {
"AEMET_API_KEY": "YOUR_AEMET_API_KEY"
}
}
- Get a free API key from AEMET at: https://opendata.aemet.es/centrodedescargas/altaUsuario
- Replace
YOUR_AEMET_API_KEYwith your actual API key (leave the quotes). - 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aemet_mcp-0.3.2.tar.gz.
File metadata
- Download URL: aemet_mcp-0.3.2.tar.gz
- Upload date:
- Size: 128.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca8b569cfdcedddcf5ae7c10c26b337b28b35e4d2c13a4aaff7f3fd1b8ffa802
|
|
| MD5 |
7caf4685fd084ae3cc398b800b34561f
|
|
| BLAKE2b-256 |
a05f3ed47ac4794db44e73384b6fa5c7d9c38298a90d59f0b0436d7f16beac58
|
Provenance
The following attestation bundles were made for aemet_mcp-0.3.2.tar.gz:
Publisher:
pypi-publish.yml on AnCode666/aemet-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aemet_mcp-0.3.2.tar.gz -
Subject digest:
ca8b569cfdcedddcf5ae7c10c26b337b28b35e4d2c13a4aaff7f3fd1b8ffa802 - Sigstore transparency entry: 565628839
- Sigstore integration time:
-
Permalink:
AnCode666/aemet-mcp@32775768788bc8d77a8b4982e12fcf9e25682945 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/AnCode666
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@32775768788bc8d77a8b4982e12fcf9e25682945 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aemet_mcp-0.3.2-py3-none-any.whl.
File metadata
- Download URL: aemet_mcp-0.3.2-py3-none-any.whl
- Upload date:
- Size: 127.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
789187ba8b47ccdda4417ab7b89ed730e9098a8ceb5dc55eb02ff06656f448f8
|
|
| MD5 |
b06b8abfd6363aa0d55075adad6804b7
|
|
| BLAKE2b-256 |
50edd2a4672b63e31872ebb7ac419cdcf78d1db15ee317d59167283549e09166
|
Provenance
The following attestation bundles were made for aemet_mcp-0.3.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on AnCode666/aemet-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aemet_mcp-0.3.2-py3-none-any.whl -
Subject digest:
789187ba8b47ccdda4417ab7b89ed730e9098a8ceb5dc55eb02ff06656f448f8 - Sigstore transparency entry: 565628844
- Sigstore integration time:
-
Permalink:
AnCode666/aemet-mcp@32775768788bc8d77a8b4982e12fcf9e25682945 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/AnCode666
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@32775768788bc8d77a8b4982e12fcf9e25682945 -
Trigger Event:
release
-
Statement type: