Open-Meteo 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., "@Open-Meteo MCP Server What's the current weather in Cape Town and a 3-day forecast?"
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.
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
Available Tools
2 toolsget_current_weatherC
Get the current weather for a city or town.
Args: location: City or town name, for example "Johannesburg" or "Cape Town".
Inputs: location (required). Returns: result
get_forecastA
Get a short daily weather forecast for a city or town.
Args: location: City or town name, for example "Johannesburg". days: Number of forecast days to return. Must be between 1 and 7.
Inputs: location (required), days. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools target clearly different time horizons: current conditions versus a multi-day forecast. There is no realistic scenario where an agent would confuse them, and the `days` parameter on the forecast tool reinforces the distinction.
Both tools follow the same get_<noun> convention (get_current_weather, get_forecast) in snake_case. The pattern is predictable and the only minor quibble — a missing 'weather' suffix on get_forecast — doesn't break consistency.
Two tools is thin for a weather service, even a minimal one. Each tool earns its place and the split (current vs forecast) is sensible, but the surface feels under-provisioned for the domain.
Core current-conditions and short-range forecast use cases are covered, which is the main workflow. However, obvious gaps exist: no hourly forecasts, no historical data, no multi-location or coordinate input, and no way to request specific weather variables (temperature/wind/precipitation filters) despite Open-Meteo supporting all of these.
Maintenance
Related MCP Connectors
Current weather and forecast lookup as an agent tool.
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
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
- AlicenseNot gradedqualityDmaintenanceProvides current weather information for any city worldwide using the free Open-Meteo API, enabling users to query temperature, wind speed, humidity, and weather conditions through natural language.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to fetch current weather, forecasts, and location information via Open-Meteo, with input validation, retries, and clear error messages.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to retrieve real-time weather conditions and 7-10 day forecasts for any location via Open-Meteo, with no API key required.74 npmMIT