Skip to main content
Glama
Weather MCP Tool

Weather MCP Tool

by shivakarnati

Weather MCP Tool

Overview

The Weather project is a lightweight MCP‑based service that exposes weather data for the United States and will be extended to support Germany. It communicates over stdin/stdout using simple JSON messages and can be used from the command line, scripts, or as an RPC service inside a larger system.

Feature

Description

get_alerts(state)

Retrieve active NOAA Weather Alerts for a US state (e.g. CA).

get_forecast(lat,long)

Get a 5‑period weather forecast for a geographic coordinate.

Future

A dedicated /weather/germany endpoint backed by the German Meteorological Service (DWD).

The code follows the OpenSpec workflow – design, tasks, and specs are stored under openspec/changes/. When a new feature is finished a change is archived and the main specs are updated.

Related MCP server: Weather MCP Server

Prerequisites

  • Python 3.14 or newer (the project requires the typing Literal and defint syntax which was stabilized in 3.14).

  • uv – Python build tool. Install via:

    pip install uv

Installation

# Clone the repository
git clone https://github.com/your-org/weather.git
cd weather

# Create a transient environment with uv
uv sync

# Install the tool globally (optional)
uv pip install --editable .

After installation you can invoke the command line wrapper using weather.

Usage

The MCP server can be started with:

uv run weather

The server is ready to accept JSON requests on stdin and writes the result to stdout. The following examples show how to call the two built‑in tools.

1. Get alerts for California

printf '{"tool": "get_alerts", "args": ["CA"]}' | uv run weather

The output will be plain text that lists all active alerts for the state.

2. Get forecast for a coordinate

printf '{"tool": "get_forecast", "args": [37.7749, -122.4194]}' | uv run weather

You can also run the server as a daemon and communicate with it over a socket. Refer to the MCP documentation for a full description of transports and protocol.

Development

Running Tests

The project currently ships with no tests, but you can easily add pytest or similar tools. Example:

uv run pytest

Contributing

All changes are managed through the OpenSpec change‑driven workflow. When you create a new feature:

  1. Create a change directory under openspec/changes/ (e.g. add-germany-weather).

  2. Follow the conventions for design, tasks, and specs.

  3. Use the OpenSpec CLI tools (openspec apply, openspec archive, etc.) to move the change and publish the artifacts.

The proposal.md, design.md, tasks.md, and spec.md files inside a change directory should be as complete as possible to keep reviewers on the same page.

Packaging

Build a distributable wheel with:

uv wheel . --wheel-dir dist

To install from a wheel:

pip install dist/weather-0.1.0-py3-none-any.whl

License

This project is released under the MIT License.


Note: This README was generated as part of the repository scaffolding. Feel free to adapt it further to match your project's conventions or add more details about the upcoming Germany endpoint map.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides weather forecasts and alerts for US locations using the National Weather Service API. Supports getting detailed forecasts by coordinates and active weather alerts by state code.
      90 npm
      GPL 3.0
    • A
      license
      B
      quality
      D
      maintenance
      Provides weather information and alerts from the National Weather Service, including active weather alerts for US states and location-based forecasts using latitude/longitude coordinates.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides weather information using the US National Weather Service API, including active weather alerts for US states and location-specific forecasts based on latitude and longitude coordinates.
      90 npm
      MIT