Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Weekly Weather
  • HeFeng Weather MCP Server
  • Powertools MCP Search Server
  • MCP Pokemon Server
  • Image Processor MCP Server
Back to MCP Servers
Weather MCP Service

Weather MCP Service

Public
haichaozheng/weather-mcp

Provides weather forecasts and active weather alerts across US states using Model Context Protocol (MCP) with real-time data delivery via Server-Sent Events and Python-based FastMCP server integration.

python
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with Weather MCP Service

MCP Server

Unlock the full potential of Weather MCP Service through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

Weather MCP Service

一个基于 Model Control Protocol (MCP) 的天气信息服务,提供天气预报和警报查询功能。

功能

  • 获取美国各州的天气警报(get_alerts)
  • 通过经纬度查询天气预报(get_forecast)

技术栈

  • Python 3.11+
  • MCP (Model Control Protocol)
  • FastMCP 服务器
  • LangGraph + LangChain
  • SSE (Server-Sent Events) 传输

安装

  1. 克隆仓库:

    git clone https://github.com/haichaozheng/weather-mcp.git cd weather-mcp
  2. 创建虚拟环境:

    # 使用 Python 标准库 python -m venv weather_venv # 激活虚拟环境(Windows) weather_venv\Scripts\activate # 激活虚拟环境(Linux/Mac) source weather_venv/bin/activate
  3. 安装依赖:

    pip install -r requirements.txt
  4. 配置环境变量:

    • 创建 .env 文件,参考 .env.example 文件格式
    • 添加必要的 API 密钥

使用方法

  1. 启动 Weather 服务器:

    python weather/weather.py

    服务器将在 http://localhost:8000 上启动,使用 SSE 传输。

  2. 在另一个终端窗口中运行客户端:

    python weather/mcp_client.py

    客户端将连接到服务器并执行一系列天气查询测试。

API 功能

天气警报查询

get_alerts(state: str) -> str
  • state: 两字母美国州代码(例如:CA, NY)
  • 返回:该州的活跃天气警报列表

天气预报查询

get_forecast(latitude: float, longitude: float) -> str
  • latitude: 位置纬度
  • longitude: 位置经度
  • 返回:该位置的天气预报

项目结构

weather-mcp/ ├── weather/ │ ├── weather.py # 主服务器文件 │ ├── mcp_client.py # 客户端测试文件 ├── requirements.txt # 项目依赖 ├── .env.example # 环境变量示例 └── README.md # 本文档


## 环境变量配置

项目使用 `.env` 文件存储环境变量和敏感信息。请按照以下步骤设置:

1. 复制环境变量模板文件:
   ```bash
   cp .env.example .env
  1. 编辑 .env 文件,填入您的实际配置:

    MOONSHOT_API_KEY=your_actual_api_key
    
  2. 确保 .env 文件不会被提交到版本控制系统中

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Weekly Weather
    Weekly Weather

    Provides 8-day global weather forecasts and current conditions with detailed hourly and daily data, ...

    Added May 30, 2025
  • HeFeng Weather MCP Server
    HeFeng Weather MCP Server

    Provides real-time and extended weather forecasts for locations in China using Model Context Protoco...

    1 tools
    Added May 30, 2025
  • Powertools MCP Search Server
    Powertools MCP Search Server

    Model Context Protocol server enabling efficient local search of AWS Lambda Powertools documentation...

    2 tools
    Added May 30, 2025
  • MCP Pokemon Server
    MCP Pokemon Server

    An MCP server implementation enabling interaction with the PokeAPI to fetch dynamic Pokémon data and...

    Added May 30, 2025
  • Image Processor MCP Server
    Image Processor MCP Server

    A TypeScript-based Model Context Protocol server enabling creation, access, and summarization of tex...

    2 tools
    Added May 30, 2025