Open-Meteo MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Open-Meteo MCP Server
A small MCP server that lets an AI agent look up real weather through the free Open-Meteo API.
Built as a focused take-home: one useful capability, implemented carefully, with clear safety boundaries. No API key required, and no secrets belong in this repo.
What it does
Two tools are exposed:
Tool | Purpose |
| Current temperature, humidity, wind, and weather code for a city or town |
| Short daily forecast for 1–7 days |
Related MCP server: Weather MCP Server
Why this scope
Open-Meteo was a practical choice: useful data, free access, and no account setup for reviewers.
The surface area is intentionally narrow. For agent-facing tools, a small interface with strong validation is usually safer than a broad one with unclear side effects. The goal here was correct behaviour and predictable failure modes, not feature count.
How MCP fits in
MCP (Model Context Protocol) is a standard way for AI hosts such as Claude or Cursor to call tools provided by a local server.
Typical flow:
A user asks about the weather
The AI host calls one of these tools
This server validates the input
This server calls Open-Meteo
The host receives a structured result and responds to the user
Project layout
src/weather_mcp/
validation.py # reject bad or unsafe input early
client.py # Open-Meteo-only HTTP access
server.py # MCP tool wiring
tests/ # unit checks
scripts/ # live smoke checkInstall
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .Run
python -m weather_mcp.serverOr:
open-meteo-mcpTransport is stdio, which is the normal pattern for local MCP servers. The host launches the process and communicates over stdin/stdout.
Example host config
{
"mcpServers": {
"open-meteo-weather": {
"command": "python",
"args": ["-m", "weather_mcp.server"],
"cwd": "/absolute/path/to/open-meteo-mcp",
"env": {
"PYTHONPATH": "src"
}
}
}
}If the package is installed editable, command can point to open-meteo-mcp instead.
Examples
Current weather
get_current_weather(location="Johannesburg")Example success payload:
{
"ok": true,
"data": {
"location": {
"name": "Johannesburg",
"country": "South Africa",
"region": "Gauteng"
},
"current": {
"temperature_c": 22.5,
"relative_humidity_percent": 40,
"wind_speed_kmh": 12.0
},
"source": "Open-Meteo (https://open-meteo.com)"
}
}Short forecast
get_forecast(location="Cape Town", days=3)Returns up to three daily high/low values.
Rejected input
get_current_weather(location="https://evil.example"){
"ok": false,
"error": "location may only contain letters, numbers, spaces, commas, periods, apostrophes, and hyphens"
}Tests and checks
pytest -qLive check against Open-Meteo (internet required, still no API key):
python scripts/smoke_check.pyQuick verification path
pip install -r requirements.txt
pip install -e .
pytest -q
python scripts/smoke_check.pyIf both succeed, core behaviour and the live API path are working.
What can go wrong when an AI agent uses this?
Agent-facing tools need explicit limits. These were the main failure cases considered.
Bad input
An agent may pass URLs, code fragments, or other non-location text.
Location values are validated for length and allowed characters before any network call. Invalid input fails fast with a clear error.
Upstream API failure
Open-Meteo can time out or return errors.
Requests use timeouts, redirects are not followed, and failures are returned as { "ok": false, "error": "..." } instead of crashing or inventing weather values.
Unintended tool use
Possible misuse includes oversized forecast windows, repeated noisy calls, or treating the server as a generic web fetcher.
Controls in place:
forecast days limited to 1–7
HTTP client allowlisted to Open-Meteo hosts only
tool descriptions that define valid input
structured errors that push the agent to retry or clarify, not guess
Ambiguous place names
Names like “Springfield” can match multiple places.
The server uses Open-Meteo’s best match and returns the resolved location details. If nothing matches, it returns a clear not-found error.
Design notes
Prefer a small working tool over a large incomplete one
Avoid secrets so the demo stays easy to run
Validate before calling the network
Keep success/failure responses structured for hosts and agents
Possible next steps
Per-process rate limiting for noisy agents
Optional lat/lon tools with the same validation rules
Contract tests that freeze tool schemas for review
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Current weather and forecast lookup as an agent tool.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch current weather conditions and forecasts for any city using the Open-Meteo API. Provides temperature, precipitation, and hourly forecast data through natural language queries.ISC
- AlicenseBqualityDmaintenanceEnables users to retrieve current weather information for any city location. Provides a simple interface to fetch weather data through natural language queries.1ISC
- AlicenseNot gradedqualityDmaintenanceProvides real-time weather data and forecasts for locations worldwide using the OpenWeatherMap API. It enables AI assistants to retrieve current conditions, temperature, and forecasts through a simple tool-based interface.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to fetch current weather, forecasts, and location information via Open-Meteo, with input validation, retries, and clear error messages.3MIT