Skip to main content

weather-mcp

Python application PyPI

A minimal Model Context Protocol server in a single file. It speaks JSON-RPC 2.0 over stdio and exposes two tools, get_weather and get_hourly_forecast, backed by the free Open-Meteo API.

No third-party dependencies — standard library only. Requires Python 3.7+.

The tools

Tool Arguments Returns
get_weather location (string, required) — a place name like "Seattle" or "Paris, France" Current conditions, temperature (°F), and wind (mph) as a text block. Unknown place names come back as a result with isError: true.
get_hourly_forecast location (string, required); hours (integer, optional, 1–48, default 12) Hour-by-hour temperature (°F), precipitation probability, and conditions, one line per hour. Timestamps are local to the location. Out-of-range hours is clamped.

Usage

Once the server is wired into a client (see below), just ask in natural language — the model picks the tool and fills in the arguments:

You: What's the weather in Seattle right now?

Claude: (calls get_weather with location: "Seattle") Current weather in Seattle, United States: overcast, 54.2 °F, wind 1.1 mph.

You: Will it rain in Tokyo over the next 6 hours?

Claude: (calls get_hourly_forecast with location: "Tokyo", hours: 6) Yes — drizzle every hour, precipitation probability climbing from 76 % to 89 %.

Try it without a client

Drive the server directly over stdio with a hand-written JSON-RPC exchange:

printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"cli"}}}' \
  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_weather","arguments":{"location":"Seattle"}}}' \
  '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_hourly_forecast","arguments":{"location":"Tokyo","hours":6}}}' \
  | openmeteo-mcp        # or: python3 weather_mcp/server.py

The tools/call responses look like:

{"jsonrpc": "2.0", "id": 2, "result": {"content": [{"type": "text",
  "text": "Current weather in Seattle, United States:\n  Conditions:  overcast\n  Temperature: 54.2°F\n  Wind:        1.1 mph"}]}}
Hourly forecast for Tokyo, Japan (next 6 hours):
  2026-09-04 18:00  73.0°F  precip  76%  dense drizzle
  2026-09-04 19:00  72.5°F  precip  76%  dense drizzle
  2026-09-04 20:00  72.2°F  precip  78%  dense drizzle
  2026-09-04 21:00  71.8°F  precip  80%  slight rain
  2026-09-04 22:00  71.7°F  precip  84%  dense drizzle
  2026-09-04 23:00  71.3°F  precip  89%  moderate drizzle

An unknown place name comes back as a normal result with "isError": true:

{"jsonrpc": "2.0", "id": 4, "result": {"content": [{"type": "text",
  "text": "Could not find any location named 'Zzzxqq'."}], "isError": true}}

Install

Pick whichever fits your setup. All of them give you an openmeteo-mcp command (or an equivalent) that clients can launch.

The distribution is named myai-weather-mcp; both myai-weather-mcp and openmeteo-mcp launch the server.

From PyPI:

pipx install myai-weather-mcp      # or: pip install myai-weather-mcp

With uv — no install step at all:

uvx myai-weather-mcp
# or straight from GitHub:
uvx --from git+https://github.com/myAI-2025/weather-mcp openmeteo-mcp

With pipx or pip:

pipx install git+https://github.com/myAI-2025/weather-mcp
# or
pip install git+https://github.com/myAI-2025/weather-mcp

From a clone (no install):

git clone https://github.com/myAI-2025/weather-mcp
python3 weather-mcp/weather_mcp/server.py     # runs the server directly

Configure a client

Claude Code

claude mcp add --scope user weather -- openmeteo-mcp

If you cloned instead of installing, point at the file:

claude mcp add --scope user weather -- python3 /path/to/weather-mcp/weather_mcp/server.py

Restart Claude Code (or reconnect via /mcp). Both tools then appear as mcp__weather__get_weather and mcp__weather__get_hourly_forecast.

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\) and add:

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

Using uvx instead, so nothing needs installing first:

{
  "mcpServers": {
    "weather": {
      "command": "uvx",
      "args": ["myai-weather-mcp"]
    }
  }
}

Restart Claude Desktop. The tools appear under the connectors (plug) menu.

Any other MCP client

It's a standard stdio server: launch openmeteo-mcp (or python3 -m weather_mcp) as a subprocess and speak JSON-RPC 2.0 over its stdin/stdout. See How it works below.

Development

git clone https://github.com/myAI-2025/weather-mcp
cd weather-mcp
pip install -e ".[dev]"
python3 test_server.py     # one line per check
pytest                     # same checks, pytest-style

The suite monkeypatches the network functions, so it runs offline.

How it works

weather_mcp/server.py reads newline-delimited JSON-RPC messages from stdin and writes responses to stdout:

Method Behavior
initialize Echoes the client's protocolVersion, advertises the tools capability, returns serverInfo.
notifications/initialized Notification — no response.
tools/list Returns the get_weather and get_hourly_forecast tools and their input schemas.
tools/call Dispatches to the named tool: geocodes the location, fetches weather from Open-Meteo, formats a text block. Lookup/network failures return isError: true rather than a JSON-RPC error.
anything else (with an id) JSON-RPC error -32601, method not found.

Upstream calls: Open-Meteo geocoding (geocoding-api.open-meteo.com) then the forecast endpoint (api.open-meteo.com) with current=temperature_2m,wind_speed_10m,weather_code.

License

MIT — see LICENSE.

Release files for myai-weather-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myai-weather-mcp 0.1.2
File Size Uploaded
myai_weather_mcp-0.1.2.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for myai-weather-mcp 0.1.2
File Interpreter ABI Platform
myai_weather_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / myai_weather_mcp-0.1.2.tar.gz

Download URL myai_weather_mcp-0.1.2.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7228f5bd5d5dd43afa33d04c64f01eeca0cb0d896d18e70b8aaaebf703cf6af7
BLAKE2b-256 checksum
How to use checksums
474b9b71f8d5fbb2b6ac2934cfe2e7d5d512f7443cd825b9c48e28ee40802947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / myai_weather_mcp-0.1.2-py3-none-any.whl

Download URL myai_weather_mcp-0.1.2-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83aacb94e2dbd78197f16340a80f078eb2a3dd7774f1204f7b67a426d790c71a
BLAKE2b-256 checksum
How to use checksums
20418cad324ea5983d8c169b7a65b81607be7fceeea30bf3969b88a88b152275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page