Weather CLI logo

Weather CLI

by liye71023326

Weather CLI is a weather query tool based on MCP (Model Control Protocol). It supports both command-line and server modes, using the wttr.in API to fetch global weather information.

View on GitHub

Last updated: N/A

What is Weather CLI?

Weather CLI is a tool to fetch weather information from wttr.in API. It supports both command-line interface and MCP server mode.

How to use Weather CLI?

You can use it either through the command line by installing the package and using weather-cli command, or by running the MCP server and using mcp call weather command.

Key features of Weather CLI

  • Fetches real-time weather information for any location globally

  • Supports Chinese weather descriptions

  • Displays detailed weather information (temperature, humidity, wind speed, etc.)

  • No API key required

  • Supports command-line and MCP server modes

Use cases of Weather CLI

  • Quickly check the weather in a specific location from the command line

  • Integrate weather information into other applications using the MCP server

  • Automate weather data retrieval for monitoring or analysis

  • Provide a simple weather service using the standardized MCP interface

FAQ from Weather CLI

What is MCP?

MCP (Model Control Protocol) is a lightweight service protocol for building and deploying machine learning model services.

How do I install Weather CLI?

You can install it using uv pip install -e . or pip install -e . after cloning the repository.

How do I query weather for a specific location?

In command-line mode, use weather-cli forecast --latitude <latitude> --longitude <longitude>. In MCP server mode, use mcp call weather get_forecast --latitude <latitude> --longitude <longitude>.

What information is returned by the get_forecast API?

The API returns a weather information string containing the city name, current weather conditions, temperature, humidity, wind speed, and more.

Is there a way to get weather alerts?

The get_alerts interface is currently not implemented.