MCP server wrapping Open-Meteo for an LLM voice assistant.
weather-mcp exposes weather lookup as a pair of MCP tools backed by the public
Open-Meteo API. The intended consumer is an LLM-driven
voice assistant: tool output is fed to the model as context, not always read aloud
verbatim. Because of that, responses are short TTS-friendly prose and each weather
response opens with the local time at the queried location, so the model can
reason about freshness ("rain this afternoon" makes no sense at 11 PM).
| Tool | Parameters | Returns |
|---|---|---|
get_current_weather |
location: str |
One TTS-friendly sentence: current temperature, feels-like, sky conditions, wind. |
get_forecast |
location: str, days: int (1–14) |
TTS-friendly paragraph, one sentence per day. |
Disambiguation. A bare city like Paris returns a spoken list of options.
Adding a qualifier — Paris, France or Paris, TX — picks one.
Day clamping. days values outside 1–14 are clamped, and the response opens
with a brief acknowledgment of the clamp.
- Python 3.13+
uvfor environment and dependency management- Internet access (Open-Meteo public API; no API key required)
uv syncuv run weather-mcpBy default the server binds 0.0.0.0:8001 and speaks the SSE transport.
Override the bind with --host and --port, or with the environment
variables WEATHER_MCP_HOST and WEATHER_MCP_PORT. CLI flags take
precedence over environment variables.
Any MCP client that supports the SSE transport can connect by pointing at
http://<host>:8001/sse. Schemas vary by client; the snippet below shows where
the URL goes:
{
"mcpServers": {
"weather": {
"url": "http://<host>:8001/sse"
}
}
}uv run pytestTests use respx to stub Open-Meteo HTTP calls; no network is required.
Save as /etc/systemd/system/weather-mcp.service:
[Unit]
Description=Weather MCP server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/weather-mcp
ExecStart=/opt/weather-mcp/.venv/bin/weather-mcp
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetThen:
systemctl daemon-reload
systemctl enable --now weather-mcp
journalctl -u weather-mcp -fTo bind a different address or port, set Environment=WEATHER_MCP_HOST=...
and/or Environment=WEATHER_MCP_PORT=... in the unit's [Service] section.
main.py— FastMCP server, tool functions, lifespan, SSE entrypoint.open_meteo.py— HTTP I/O for Open-Meteo geocoding and forecast endpoints.formatting.py— TTS-friendly prose builders.
See CHANGELOG.md.
Licensed under the Apache License 2.0; full text in LICENSE.