IPMA Weather MCP Server
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., "@IPMA Weather MCP Server what's the weather forecast for Lisbon tomorrow?"
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.
IPMA Weather MCP Server (Python)
A comprehensive Model Context Protocol (MCP) server providing access to Portuguese weather data from IPMA (Instituto Português do Mar e da Atmosfera).
Data Source
All data is provided by IPMA (Instituto Português do Mar e da Atmosfera, I.P.)
API Documentation: https://api.ipma.pt/
Weather forecasts are updated twice daily (00 UTC and 12 UTC)
Times are in UTC (add 0h in winter, +1h in summer for Continental Portugal/Madeira; -1h in winter, 0h in summer for Azores)
Related MCP server: IPMA MCP Server
Features
This MCP server provides complete access to the IPMA API with the following tools:
🌦️ Weather Forecasts
get_forecast - 5-day weather forecast for Portuguese cities
Detailed daily forecasts including temperature, precipitation, wind
Supports all Portuguese cities and islands (Madeira and Azores)
get_daily_aggregate_forecast - Daily aggregated forecast for all locations
Get forecasts for all Portugal in a single query
Supports up to 3 days (today, tomorrow, day after tomorrow)
⚠️ Weather Warnings
get_weather_warnings - Active meteorological warnings (up to 3 days)
Warning types: precipitation, wind, fog, maritime agitation, snow, thunderstorms, etc.
Awareness levels: green (normal), yellow, orange, red
Includes affected areas and time periods
🌊 Sea State
get_sea_forecast - Sea state forecast for coastal areas (up to 3 days)
Wave height, wave period, wave direction
Sea surface temperature
Covers all Portuguese coastal locations
🔥 Fire Risk
get_fire_risk - Fire risk forecast (up to 2 days)
RCM (Risco de Incêndio) classification for all municipalities
Risk levels: Low, Moderate, High, Very High, Maximum
☀️ UV Index
get_uv_forecast - UV radiation index forecast (up to 3 days)
UV index levels from Low to Extreme
Protection recommendations included
🌡️ Weather Stations
get_station_observations - Meteorological observations from weather stations
Last 24 hours of hourly data
Temperature, humidity, pressure, wind, precipitation, radiation
🔍 Seismic Data
get_seismic_data - Seismic activity information (last 30 days)
Coverage: Continental Portugal, Azores, Madeira
Filter by region
📚 Reference Data
list_available_cities - List all available locations
Complete list of cities and islands
Grouped by region (Continental, Madeira, Azores)
get_weather_type_descriptions - Weather type code descriptions
Portuguese and English descriptions
Helps interpret weather type IDs in forecasts
Installation
Install dependencies:
pip install -e .Configure your MCP client to use this server:
For Claude Desktop, add to your config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["-m", "weather"],
"cwd": "/path/to/weather-server-python"
}
}
}Or use uv for better environment management:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["run", "weather"],
"cwd": "/path/to/weather-server-python"
}
}
}Usage Examples
Once configured, you can ask Claude questions like:
"What's the weather forecast for Lisboa?"
"Are there any active weather warnings in Portugal?"
"What's the sea state forecast for Porto coast tomorrow?"
"Show me the fire risk for today"
"What are the UV levels for the next 3 days?"
"Get observations from weather station 1210881"
"List all available Portuguese cities"
"What seismic activity has been recorded in the Azores?"
API Coverage
This server implements all main IPMA open data endpoints:
✅ Avisos Meteorológicos até 3 dias
✅ Previsão Meteorológica Diária até 5 dias agregada por Local
✅ Previsão Meteorológica Diária até 3 dias, informação agregada por dia
✅ Informação sismicidade, últimos 30 dias (Açores, Continente, Madeira)
✅ Previsão do Estado do Mar até 3 dias, informação agregada por dia
✅ Previsão do Risco de Incêndio até 2 dias, informação agregada por dia
✅ Previsão do Risco de Ultravioletas até 3 dias (Índice Ultravioleta)
✅ Observação Meteorológica de Estações (dados horários, últimas 24 horas)
Integrating with Open WebUI
The IPMA MCP server can be integrated with Open WebUI (v0.6+) using mcpo (MCP-to-OpenAPI proxy), which bridges the stdio-based MCP server to REST endpoints accessible by Open WebUI.
Quick Start with install.sh
We provide an installation helper script to set up the environment:
# Make the script executable
chmod +x install.sh
# Run the installation
./install.shThe script will:
Install
uvif not already presentCreate a virtual environment
Install all dependencies
Verify the installation
Manual Setup
1. Prerequisites
Open WebUI installed and running (e.g., via Docker):
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway \ -v open-webui:/app/backend/data \ -e OLLAMA_BASE_URL=http://host.docker.internal:11434 \ --name open-webui --restart always \ ghcr.io/open-webui/open-webui:mainPython 3.10+ with
uv(install viacurl -LsSf https://astral.sh/uv/install.sh | sh)Clone this repository
2. Set Up Virtual Environment
cd /path/to/ipma-mcp-server
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .3. Test the MCP Server
Run the server directly (it uses stdio transport by default):
uv run python weather.pyThis starts the MCP server locally. Press Ctrl+C to stop.
4. Launch mcpo Proxy
Install mcpo (Open WebUI's official MCP-to-OpenAPI proxy):
uv tool install mcpoProxy the MCP server to OpenAPI on port 8000 (use a secure API key):
uvx mcpo --port 8000 --api-key "your-secret-key" -- uv run python weather.pyTest: Visit
http://localhost:8000/docsfor the auto-generated OpenAPI schemaAll IPMA tools should appear in the documentation
Docker Alternative:
docker run -p 8000:8000 -v /path/to/ipma-mcp-server:/app \
ghcr.io/open-webui/mcpo:main \
--api-key "your-secret-key" -- python /app/weather.py5. Add to Open WebUI
Open your Open WebUI instance (e.g.,
http://localhost:3000)Go to Settings (gear icon) > Tools (or Admin Panel > External Tools if admin)
Click + Add Tool Server
Configure:
Type: OpenAPI (or MCP Streamable HTTP if available)
URL:
http://localhost:8000(full base URL)Auth: Bearer token with your API key (
your-secret-key)
Save and restart Open WebUI if prompted
Integration Architecture
Open WebUI (Port 3000)
↓ HTTP REST calls
mcpo Proxy (Port 8000)
↓ stdio JSON-RPC
IPMA MCP Server (weather.py)
↓ HTTPS
IPMA API (api.ipma.pt)For full MCP documentation, see the Open WebUI MCP Guide.
License
See the Quickstart tutorial for more information about MCP.
Available Tools
10 toolsget_daily_aggregate_forecastA
Get daily aggregated weather forecast for Portugal (Previsão Meteorológica até 3 dias, agregada por dia).
Args:
day: Forecast day (0=today, 1=tomorrow, 2=day after tomorrow). Valid range: 0-2
Returns aggregated forecast for all Portuguese locations for the specified day.
Inputs: day.
get_fire_riskA
Get fire risk forecast for Portugal (Previsão Risco de Incêndio até 2 dias).
Args:
day: Forecast day (0=today, 1=tomorrow). Valid range: 0-1
Returns fire risk classification (RCM - Risco de Incêndio) for Portuguese municipalities.
Fire risk levels: 1=Low, 2=Moderate, 3=High, 4=Very High, 5=Maximum
Inputs: day.
get_forecastA
Get 5-day weather forecast for a Portuguese city (Previsão Meteorológica até 5 dias).
Args:
city_name: Name of the Portuguese city (e.g. Lisboa, Porto, Faro, Aveiro, Braga)
Returns detailed 5-day forecast including temperature, precipitation, wind, and weather type.
Inputs: city_name (required).
get_sea_forecastA
Get sea state forecast for Portuguese coastal areas (Previsão Estado do Mar até 3 dias).
Args:
location_name: Name of coastal location (e.g., 'Porto', 'Lisboa', 'Faro', 'Funchal', 'Leiria').
Leave empty to see all available locations.
day: Forecast day (0=today, 1=tomorrow, 2=day after tomorrow). Valid range: 0-2
Returns sea state forecast including wave height, period, direction, and sea temperature.
Inputs: location_name, day.
get_seismic_dataA
Get seismic activity data for Portugal (Informação sismicidade, últimos 30 dias).
Args:
region: Region to filter ('all', 'continente', 'açores', 'madeira').
Default is 'all' for all regions.
Note: This endpoint returns the last 30 days of seismic information for
Azores Archipelago, Continental Portugal, and Madeira Archipelago.
Inputs: region.
get_station_observationsA
Get meteorological observations from weather stations (Observações últimas 24 horas).
Args:
station_id: ID of the weather station. Leave empty to see all stations.
Returns hourly meteorological observations from the last 24 hours including:
- Temperature
- Humidity
- Pressure
- Wind speed and direction
- Precipitation
- Radiation
Inputs: station_id.
get_uv_forecastA
Get UV index forecast for Portugal (Previsão Índice Ultravioleta até 3 dias).
Returns UV radiation index forecast for Portuguese locations.
UV Index levels:
- 0-2: Low
- 3-5: Moderate
- 6-7: High
- 8-10: Very High
- 11+: Extreme
Inputs: no named parameters.
get_weather_type_descriptionsA
Get descriptions for all weather type codes used in forecasts.
Returns a mapping of weather type IDs to their Portuguese and English descriptions.
This helps interpret the idWeatherType field in forecast data.
Inputs: no named parameters.
get_weather_warningsA
Get Portuguese meteorological warnings for up to 3 days.
Returns current active weather warnings (Avisos Meteorológicos) including:
- Warning type (precipitation, wind, fog, maritime agitation, etc.)
- Awareness level (green, yellow, orange, red)
- Affected area
- Start and end times
Inputs: no named parameters.
list_available_citiesA
List all available Portuguese cities and islands for weather forecasts.
Returns a comprehensive list of all locations available in the IPMA database,
including district capitals and islands (Madeira and Azores).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose with no overlap. The tools cover different weather-related data types (daily forecasts, fire risk, sea state, UV index, seismic data, station observations, warnings, city lists, and weather type descriptions), and their descriptions make it easy to distinguish which tool to use for each specific query.
All tool names follow a consistent verb_noun pattern starting with 'get_' or 'list_', with clear and descriptive nouns (e.g., get_daily_aggregate_forecast, get_fire_risk, list_available_cities). There are no deviations in naming conventions, making the set predictable and easy to navigate.
With 10 tools, the server is well-scoped for providing comprehensive weather data for Portugal. Each tool serves a unique and necessary function, from forecasts and observations to warnings and metadata, without feeling bloated or insufficient for the domain.
The tool set provides complete coverage for weather data in Portugal, including forecasts (daily, city-specific, sea, UV), real-time data (observations, seismic activity, warnings), and supporting information (city lists, weather type descriptions). There are no obvious gaps, and agents can access all relevant meteorological aspects without dead ends.
Related MCP Connectors
IPMA Portugal MCP — weather, UV, sea state, and earthquakes from the Instituto Português do Mar e…
Portugal public data: weather, INE, Parliament, contracts, SNS, fuel, transit, power cuts.
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Weather, geocoding, FX rates, holidays, time zones, countries, earthquakes, sun and moon.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides access to Portuguese meteorological data from IPMA (Instituto Português do Mar e da Atmosfera), including weather forecasts, warnings, UV index, seismic data, and weather station observations for cities in Portugal.6MIT
- AlicenseAqualityDmaintenanceProvides access to Portuguese weather data from IPMA (Instituto Português do Mar e da Atmosfera), including weather forecasts, meteorological warnings, seismic data, UV index, and real-time observations from weather stations across Portugal.6MIT
- AlicenseNot gradedqualityCmaintenanceProvides weather, UV, sea state, and earthquake data from IPMA Portugal through an MCP gateway, enabling natural language queries for Portuguese meteorological and seismic information.58 npmMIT
- AlicenseAqualityDmaintenanceProvides AI assistants with live tools for Portuguese public data including fuel prices, weather, postal codes, statistics, and open data.8MIT