Weather MCP

by kaisumi

天气 MCP

使用模型上下文协议 (MCP) 的天气预报应用程序

概述

该应用程序是一个 MCP 服务器,使用 Open-Meteo API 来检索和显示天气预报数据。可以通过 MCP 协议从 LLM 应用程序访问天气信息。

功能

  • 显示当前天气信息
  • 查看3天天气预报
  • 获取基于位置的天气信息
  • 通过 MCP 协议访问

设置

  1. 安装依赖项:
pip install -e .
  1. 设置环境变量:创建.env文件,设置所需的环境变量。
MCP_API_KEY=your_api_key_here MCP_BASE_URL=http://localhost:8000
  1. 启动 MCP 服务器:
python -m app.server
  1. 运行客户端:
python -m app.client

MCP 工具

获取天气

获取特定城市的当前天气信息和 3 天预报。

参数:

  • city :要获取天气信息的城市名称(例如东京、纽约)

响应示例:

{ "location": { "name": "東京", "country": "日本", "latitude": 35.6895, "longitude": 139.6917, "timezone": "Asia/Tokyo" }, "current": { "temperature": 22.5, "feels_like": 23.1, "humidity": 65, "wind_speed": 3.2, "wind_direction": 180, "precipitation": 0, "condition": "晴れ", "weather_code": 1 }, "forecast": [ { "date": "2023-04-10", "max_temp": 24.5, "min_temp": 15.2, "precipitation": 0, "condition": "晴れ", "sunrise": "05:30", "sunset": "18:15" }, ... ] }

执照

麻省理工学院

-
security - not tested
-
license - not tested
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器使用 Open-Meteo API 为指定城市提供当前天气信息和 3 天预报。

  1. 概述
    1. 功能
      1. 设置
        1. MCP 工具
          1. 获取天气
        2. 执照

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.
            Last updated -
            1
            Python
            Apache 2.0
            • Linux
            • Apple
          • -
            security
            -
            license
            -
            quality
            Provides a Model Context Protocol server that enables large language models to query and retrieve real-time weather forecasts for cities and regions across China.
            Last updated -
            Python
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that provides AI agents with tools to retrieve weather alerts and detailed forecasts for US locations using the National Weather Service API.
            Last updated -
            2
            115
            TypeScript
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that provides comprehensive weather data querying capabilities based on the Caiyun Weather API, supporting real-time weather, forecasts, and alerts with multi-language support.
            Last updated -
            7
            1
            TypeScript

          View all related MCP servers

          ID: c6kvophb25