Weather CLI: an MCP server for global weather forecasts

Weather CLI: an MCP server for global weather forecasts

weather-cli•byliye71023326

A weather query tool offering both a command-line interface and an MCP server mode that retrieves global weather information from the wttr.in API.

License: Not specified•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Provides a get_forecast interface that returns weather forecasts for a specified latitude and longitude, defaulting to Beijing.
  • •Forecast output includes city name, current conditions, temperature and feels-like, humidity and pressure, wind, visibility, cloud cover and precipitation.
  • •Exposes a get_alerts interface for weather alerts, noted as not yet implemented.
  • •Supports Chinese weather descriptions and requires no API key.

BEST FOR

  • •Querying current weather for any location worldwide by latitude and longitude.
  • •Adding weather lookups to MCP-enabled clients via a callable forecast tool.
  • •Defaulting to Beijing weather when no coordinates are supplied.

ABOUT WEATHER-CLI

Weather CLI: an MCP server for global weather forecasts is cataloged as an MCP server attributed to liye71023326. A weather query tool offering both a command-line interface and an MCP server mode that retrieves global weather information from the wttr.in API. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Weather CLI: an MCP server for global weather forecasts are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

上游原版 README

在 GitHub 查看同一版本原文

README.md · f7cca8a5b5cf · 采集于 2026-11-13 12:47:34 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Weather CLI

一个基于 MCP (Model Control Protocol) 的天气查询工具,支持命令行和服务器模式,使用 wttr.in API 获取全球天气信息。

功能特点

  • 获取全球任何位置的实时天气信息
  • 默认查询北京天气
  • 支持中文天气描述
  • 显示详细天气信息(温度、湿度、风速等)
  • 无需 API 密钥
  • 支持命令行和 MCP 服务器两种使用模式

什么是 MCP?

MCP (Model Control Protocol) 是一个轻量级的服务协议,用于构建和部署机器学习模型服务。在本项目中,我们使用 MCP:

  • 提供标准化的服务接口
  • 支持异步操作
  • 便于集成到其他系统
  • 支持多种传输协议(stdio、TCP、WebSocket 等)

安装

# 克隆仓库
git clone https://github.com/liye71023326/weather-cli.git
cd weather-cli

# 使用 uv 安装(推荐)
uv pip install -e .

# 或使用 pip 安装
pip install -e .

使用方法

1. 命令行模式

直接使用 weather-cli 命令:

# 查询北京天气(默认)
weather-cli forecast

# 查询上海天气
weather-cli forecast --latitude 31.2304 --longitude 121.4737

# 查询广州天气
weather-cli forecast --latitude 23.1291 --longitude 113.2644

2. MCP 服务器模式

启动服务器

# 方式 1:使用 Python 直接运行
python run_server.py

# 方式 2:使用 MCP CLI 工具运行
mcp run weather

使用 MCP 客户端查询天气

在另一个终端中:

# 查询北京天气(默认经纬度)
mcp call weather get_forecast

# 查询指定位置天气
mcp call weather get_forecast --latitude 31.2304 --longitude 121.4737

服务器 API 说明

  1. get_forecast 接口

    • 功能:获取指定位置的天气预报
    • 参数:
      • latitude: 纬度,范围 -90 到 90(默认:39.9042,北京)
      • longitude: 经度,范围 -180 到 180(默认:116.4074,北京)
    • 返回:天气信息字符串,包含:
      • 城市名称
      • 当前天气状况
      • 温度和体感温度
      • 湿度和气压
      • 风向和风速
      • 能见度和云量
      • 降水量
  2. get_alerts 接口

    • 功能:获取天气预警信息(暂未实现)
    • 参数:
      • state: 地区代码
    • 返回:提示信息

常用城市经纬度

  • 北京:39.9042, 116.4074(默认)
  • 上海:31.2304, 121.4737
  • 广州:23.1291, 113.2644
  • 深圳:22.5431, 114.0579
  • 成都:30.5728, 104.0668
  • 武汉:30.5928, 114.3055
  • 西安:34.3416, 108.9398
  • 杭州:30.2741, 120.1551

开发

系统要求

  • Python 3.13 或更高版本
  • httpx:用于异步 HTTP 请求
  • mcp[cli]:MCP 协议实现

项目结构

weather-cli/
├── weather/
│   ├── __init__.py  # MCP 服务器实现和天气 API 集成
│   └── cli.py       # 命令行界面实现
├── run_server.py    # MCP 服务器启动脚本
├── pyproject.toml   # 项目配置
├── .gitignore      # Git 忽略配置
└── README.md       # 本文件

扩展开发

如果你想扩展这个项目,可以:

  1. 添加新的天气数据源
  2. 实现更多天气相关功能(如未来天气预报)
  3. 添加其他传输协议支持
  4. 实现数据缓存机制
  5. 实现天气预警功能
  6. 添加更多城市的默认经纬度

贡献

欢迎提交 Issue 和 Pull Request 来改进这个项目!

许可证

MIT License

致谢

  • wttr.in - 提供天气数据
  • httpx - 异步 HTTP 客户端
  • mcp - Model Control Protocol 实现
  • FastMCP - MCP 的快速实现框架

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Weather CLI: an MCP server for global weather forecasts from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/weather-cli)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research