Skip to main content
Glama

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
F
license - not found
-
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

          • A
            security
            A
            license
            A
            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 -
            3
            14
            Python
            Apache 2.0
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            A production-ready Model Context Protocol server that provides weather data from OpenWeatherMap API, allowing users to query current weather by city name or coordinates with support for different temperature units.
            Last updated -
            Python
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides comprehensive weather data and forecasts through the OpenWeatherMap API, enabling AI assistants to access real-time weather information, forecasts, air quality data, and location services.
            Last updated -
            11
            6
            JavaScript
            MIT License

          View all related MCP servers

          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/kaisumi/weather-mcp'

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