关于 Weather MCP Server
Weather MCP Server 将 Claude 等 AI 助手连接到 National Weather Service API,提供美国各州的当前天气警报,以及指定坐标的天气预报。
主要功能
- 01按美国州查询有效警报
- 02按经纬度获取天气预报
- 03通过 FastMCP 暴露天气工具
适用场景
- 01查看某州的有效天气警报
- 02获取指定坐标位置的天气预报
MCP 相关
它向 MCP 客户端提供工具,用于查询 National Weather Service 的警报和预报。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
天气 MCP 服务
概述
本项目实现了一个模型上下文协议(MCP)服务,使 AI 助手(例如 Claude)能够与美国国家气象局(NWS)API 交互。该服务可提供指定位置的实时天气预警和预报。
功能
- 获取美国指定州的有效天气预警。
- 获取指定经纬度的天气预报。
- 使用 FastMCP 框架为 AI 交互提供工具。
使用的技术
- Python
- FastMCP
- httpx(用于异步 HTTP 请求)
前提条件
运行本项目之前,请确保已安装:
- Python(建议使用 3.11.6 或更高版本)
- uv 包管理器(pip install uv)
- httpx(pip install httpx)
- fastmcp(pip install fastmcp)
- Claude 桌面应用
uv 包管理器安装
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
添加到 PATH
安装与设置
-
克隆仓库:
git clone https://github.com/ankushmehta123/weather-mcp-server.git -
安装依赖:
pip install -r requirements.txt -
在 MCP 服务配置中添加以下内容
claude_desktop_config.json:"mcpServers": { "weather": { "command": "C:/Users/"enter_your_username"/.local/bin/uv.exe", "args": [ "--directory", "directory_location of main.py", "run", "main.py" ] } } }
Usage
Run main.py
python main.py
Available API Tools
Open Claude Desktop, you would see: 2 MCP tools available (at right-side of the search-bar)
You can ask real-time weather-related questions to Claude now
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。