Weather MCP Server
Overview
Simple MCP server providing daily weather forecasts by proxying the Open-Meteo API. It is packaged as buddai/mcp-weather
and launched by weather.mcp.yml
over STDIO.
Components
main.py
– registers the singleload_weather_data
tool viaFastMCP
.openweather.py
– builds the Open-Meteo REST query, performs the HTTP request withrequests
, and returns the JSON payload.pyproject.toml
– declares runtime dependencies (mcp
,requests
).Dockerfile
– Python 3.13 two-stage build that installs dependencies and runspython3 main.py
as usermcp
.
Exposed MCP tools
Tool | Purpose | Input |
---|---|---|
load_weather_data | Fetches daily precipitation probability, wind speed, UV index, min/max temperature, and rain totals for a coordinate. | latitude , longitude (strings, defaults correspond to Madrid area). |
Configuration
mcp_servers/weather.mcp.yml
runs the container without extra env vars:
yaml
weather:
transport: stdio
command: docker
args:
- run
- --init
- -i
- --rm
- --network
- buddai_net
- buddai/mcp-weather
The service requires outbound Internet access to call api.open-meteo.com
. No API key is needed.
Running locally
- Install Python ≥ 3.11 and
pip install mcp==1.9.4 requests==2.32.4
. - Run
python main.py
to expose the STDIO server.
Docker usage
bash
docker build -t buddai/mcp-weather mcp_servers/weather
Execute:
bash
docker network create buddai_net # once
docker run --rm --init -i \
--network buddai_net \
buddai/mcp-weather
Development notes
- Adjust the query parameters in
openweather.py
if you need hourly data or different metrics; the current configuration pulls aggregated daily values in theEurope/Berlin
timezone. - Responses are raw Open-Meteo JSON; adapt downstream formatting in the calling agent if needed.
Troubleshooting
- HTTP errors: check outbound network access. Open-Meteo enforces rate limits; consider caching responses if you poll frequently.
- Units/timezone mismatches: update the query string to specify
timezone
and units explicitly for your target region.