Skip to main content
Glama
KDimkuz

mcp-weather-connector

by KDimkuz

mcp-weather-connector

An MCP server that gives an AI agent access to weather forecasts through Open-Meteo — a public API with no key or registration required.

Deliberately small: the repository is about how the tool layer for an agent is structured, not about weather. Weather here is a relatable pretext for showing the trust boundary between the model and the outside world.

Why

Model Context Protocol is a way to give a language model the right to take actions in external services. Once that right exists, the question arises: what happens if the model passes garbage to a tool right as the third-party service returns a 503?

Three decisions are made explicit in this code:

Model input is untrusted. The model can pass an empty string, a ten-kilobyte wall of text, or control characters. All of this is filtered out in server.py before the network call — not in a third-party API.

Errors are distinguished by type. Retrying a 4xx is pointless — it is a request error, and a retry will not fix it. A 5xx is more likely a one-off failure — one retry with a pause. The logic lives in _get_json and is verified by tests that assert the call count.

What goes out is text, not raw JSON. The agent has nothing to second-guess and no way to err when relaying the answer. A 200 response without the required field counts as a failure, not as a reason to return an empty value.

As a separate note: a day count outside the supported range is clamped to the boundary rather than treated as an error. If the model asks for a 30-day forecast, it is more useful to return seven days than to break the conversation with an error message.

Related MCP server: open-meteo-mcp-server

Tools

Tool

What it does

current_weather(city)

Current weather: temperature, feels like, humidity, wind

forecast(city, days=3)

Forecast for 1–7 days with precipitation

locate(query)

Checks whether a populated place exists and clarifies the country

locate exists for the single scenario where the agent is not sure about the spelling: better to check with the user than to silently return the weather for the wrong city.

Installation

pip install -e .

Connecting to Claude Desktop

In claude_desktop_config.json:

{
  "mcpServers": {
    "weather": {
      "command": "mcp-weather"
    }
  }
}

After the app restarts, the tools will appear in the list of available tools.

Development

pip install -e ".[dev]"
pytest
ruff check .

The tests cover what actually breaks: empty and oversized input, a non-numeric number of days, a 4xx with no retry, a 5xx with one retry, success on the second attempt, a 200 response without a payload, and an unknown weather code. HTTP is mocked with respx — no network is needed in the tests.

Structure

src/mcp_weather/
    client.py    — работа с Open-Meteo: типы, повторы, разбор ответа
    server.py    — MCP-слой: валидация входа и форматирование вывода
tests/
    test_tools.py

The network code is deliberately separated from the MCP layer: the client is tested on its own, and the agent's tools remain a thin wrapper over straightforward functions.

License

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables AI assistants to retrieve current weather, forecasts, and summaries for any global location using the Open-Meteo API, with no API key required.
    21
    Creative Commons Zero v1.0 Universal
  • A
    license
    A
    quality
    D
    maintenance
    Provides comprehensive access to Open-Meteo weather APIs, including forecasts, historical data, air quality, marine weather, and geocoding, enabling LLMs to retrieve weather information and location data.
    17
    668
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides live weather data (current conditions, forecasts) and city geocoding through Open-Meteo API, enabling AI assistants to answer weather queries without an API key.
    MIT

View all related MCP servers

Related MCP Connectors

  • Global weather via Open-Meteo: forecast, ERA5 archive, marine, air quality, geocoding, elevation.

  • US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.

  • Real-time weather conditions and multi-day forecasts via Open-Meteo — free, no API key required

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KDimkuz/mcp-weather-connector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server