mcp-wttr
# mcp-wttr
A simple mcp server for returning weather data from wttr.in.
Made by following [this guide](https://modelcontextprotocol.io/quickstart/server).
The original implementation from the guide is [weather.py](./weather.py).
The wttr implementation is [wttr.py](./wttr.py).
## Installing
```bash
uv venv
source .venv/bin/activate
uv sync
# or for all tooling
uv sync --all-groups
```
### Add MCP Server - Gemini
```bash
mkdir -p ~/.gemini/extensions/wttr-extension
cat << EOF > ~/.gemini/extensions/wttr-extension/gemini-extension.json
{
"name": "mcp-wttr",
"version": "1.0.0",
"mcpServers": {
"wttr": {
"command": "uv",
"args": [
"--directory",
"$(pwd)",
"run",
"wttr.py"
]
}
}
}
EOF
```
## Debugging
Run the mcp inspector with
```bash
uv run mcp dev wttr.py
```
## Example - Gemini
```
> Get weather in Bristol
╭───────────────────────────────────────────────────────────╮
│ ✔ get_city_weather (wttr MCP Server) {"city":"Bristol"} │
│ │
│ Temperature=+20°C │
│ Wind=↓15km/h │
│ Humidity=46% │
│ Pressure=1017hPa │
│ Precipitation=0.0mm │
│ Weather=Overcast │
│ UV Index=1 │
╰───────────────────────────────────────────────────────────╯
✦ The weather in Bristol is: Temperature=+20°C, Wind=↓15km/h,
Humidity=46%, Pressure=1017hPa, Precipitation=0.0mm,
Weather=Overcast, UV Index=1.
```
```
╭──────────────────────────╮
│ > /ron_weather Bristol │
╰──────────────────────────╯
╭──────────────────────────────────────────────────────────╮
│ ✔ get_city_weather (wttr MCP Server) {"city":"Bristol"} │
│ │
│ Temperature=+20°C │
│ Wind=↓15km/h │
│ Humidity=46% │
│ Pressure=1017hPa │
│ Precipitation=0.0mm │
│ Weather=Overcast │
│ UV Index=1 │
╰──────────────────────────────────────────────────────────╯
✦ Great Odin's raven! Bristol, listen up! It's a balmy 20 degrees
out there, but don't let that overcast sky fool you. There's a
gentle breeze at 15km/h, just enough to keep things fresh
without messing up my magnificent hair. And the best part?
Not a single drop of rain! It's a great day for news, and a
great day for Bristol. I'm Ron Burgundy. Stay classy.
```
## Tooling
This project uses ruff for linting and formatting.
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of confusion or misselection between tools. Its purpose (fetch weather for a named city) is unambiguous.
The single name get_city_weather follows a clear verb_noun convention (get + city + weather) in snake_case. There are no competing conventions to contradict it.
A single tool is thin for a weather server; even a minimal service usually offers current conditions, forecast, or unit/coordinate options. It is focused and non-bloated, but borders on under-scoped.
Core read access for current weather by city is covered, but obvious operations like multi-day forecast, hourly data, or units/coordinate-based lookup are missing. As a read-only, single-resource tool there are no create/update/delete gaps to fill.