Skip to main content
Glama
Krishna-Dhawangale

Weather MCP Server

🌦️ MCP 天气助手

一个基于模型上下文协议(MCP)的项目,将 Groq 托管的 LLM 连接到自定义的 Weather MCP Server,让您可以用自然语言提问天气相关问题,并获得基于 美国国家气象局(NWS)API 的真实数据、由工具驱动的实时答案。

工作原理

User
  ↓
"Are there any weather alerts for CA?"
  ↓
Groq LLM
  ↓
Decides to call get_alerts_tool
  ↓
MCP Client
  ↓
MCP Weather Server
  ↓
National Weather Service API
  ↓
Real-time weather alerts
  ↓
Groq LLM
  ↓
Natural-language answer
  1. 用户用纯英文提问。

  2. Groq LLM 解析问题并决定调用哪个工具(例如 get_alerts_toolget_forecast_tool)。

  3. MCP 客户端通过模型上下文协议将该工具调用发送到 MCP Weather Server

  4. 服务器向 National Weather Service API 查询实时数据。

  5. 结果通过客户端返回给 LLM。

  6. LLM 将原始数据转换为清晰的自然语言回复,呈现给用户。

Related MCP server: mcp-weather

功能特性

  • 🌦️ 按美国州获取实时天气警报

  • 📍 按位置(纬度/经度)获取天气预报

  • 🔌 基于 模型上下文协议(MCP) 构建——工具以标准化方式暴露,任何兼容 MCP 的客户端均可使用

  • ⚡ 由 Groq 提供快速 LLM 推理能力

  • 🧩 LLM 客户端与天气工具服务器之间清晰分离

项目结构

.
├── client/            # MCP client — connects to Groq LLM and the MCP server
├── server/             # MCP weather server — exposes get_alerts_tool, get_forecast_tool, etc.
├── requirements.txt     # or package.json, depending on stack
└── README.md

(请根据您的实际目录布局调整此结构树。)

前置条件

  • Python 3.10+(或 Node.js,取决于您的实现方式)

  • 一个 Groq API 密钥

  • 互联网连接(服务器调用公共 NWS API——NWS 无需 API 密钥)

安装

git clone https://github.com/Krishna-Dhawangale/MCP.git
cd MCP
pip install -r requirements.txt

配置

在项目根目录创建 .env 文件:

GROQ_API_KEY=your_groq_api_key_here

使用方式

  1. 启动 MCP 天气服务器:

    python server/weather_server.py
  2. 运行客户端:

    python client/main.py
  3. 提出一个问题:

    > Are there any weather alerts for CA?

    客户端会将查询路由到 LLM,LLM 会调用 MCP 服务器上的相应工具并返回自然语言答案。

可用工具

工具

说明

get_alerts_tool

获取指定美国州的当前天气警报

get_forecast_tool

获取指定纬度/经度的天气预报

路线图

  • 增加对更多地区(国际)的支持

  • 为重复查询添加缓存

  • 为工具处理器添加单元测试

  • 支持除 Groq 之外的更多 MCP 客户端

贡献

欢迎贡献!请随时提交 issue 或发起 pull request。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides weather forecast data from the US National Weather Service API through MCP tools. Enables users to get detailed weather forecasts by ZIP code or coordinates using natural language queries.
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.
  • F
    license
    B
    quality
    D
    maintenance
    Provides weather forecasts and alerts for US locations using the National Weather Service API. Enables users to retrieve active alerts by state and detailed forecasts by coordinates via MCP tools.
    2

View all related MCP servers

Related MCP Connectors

  • US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.

  • Get US weather forecasts, active alerts, and current observations.

  • US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Krishna-Dhawangale/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server