Labsco
MCP SERVER

MCP Weather Server

by KennyKang7012

Current conditions and a five-day forecast for any city, from OpenWeatherMap, in Chinese or English.

Weather & Environmental Conditions
Summary
Two tools, plus resources for the same data.

Exposing current conditions and the forecast as `weather://` resources as well as tools means a client that prefers to attach context rather than call a function gets the same data either way. An `api-status` resource is a small thing that saves a confusing failure when the key has run out of quota.

What it is

A Python server on the OpenWeatherMap API. It answers two questions — what is the weather there now, and what is it going to be — and accepts city names in Chinese or English, which is the reason to pick it over a generic weather wrapper.

What you get
  • `get_current_weather(city)` returns formatted current conditions — temperature, humidity, wind and the rest
  • `get_weather_forecast(city, days)` returns the forecast, with `days` from 1 to 5 and defaulting to 5
  • Resources alongside the tools: `weather://current/{city}`, `weather://forecast/{city}` and `weather://api-status`
  • City names work in Chinese or English
Requirements

Python 3.10 or newer and an OpenWeatherMap API key, passed as `OPENWEATHER_API_KEY`. Set up with `uv venv` then `uv pip install -r requirements.txt`, and configure your client to run `uv --directory . run main.py`. The repository also documents Docker, Docker Compose and Linux system-service deployment.

Setup effort

Build from source — clone the repository and build it, then point your client at the binary