Skip to main content
Glama

Weather MCP Server

by panzhenyao

天气 MCP 服务器

这是一个使用 OpenWeatherMap API 获取天气数据的 MCP 服务器。它可以托管在 MCP.so 上。

特征

  • 任何地点的当前天气数据
  • 天气预报(最多5天)
  • 支持公制和英制单位
  • 兼容 stdio 和 REST 传输模式
  • Docker 容器化,轻松部署
  • 与 MCP.so 托管要求兼容

先决条件

  • Node.js v18+
  • OpenWeatherMap API 密钥(在OpenWeatherMap免费获取)

入门

本地开发

  1. 克隆此存储库
    git clone https://github.com/yourusername/weather-mcp-server.git cd weather-mcp-server
  2. 安装依赖项
    npm install
  3. 构建 TypeScript 代码
    npm run build
  4. 以 stdio 模式运行服务器(用于本地测试)
    WEATHER_API_KEY=your_api_key_here npm start

以 REST 模式运行

WEATHER_API_KEY=your_api_key_here mode=rest port=9593 endpoint=/rest npm start

Docker

  1. 构建 Docker 镜像
    docker build -t mcp/weather-mcp-server .
  2. 运行容器
    docker run -i --rm -e WEATHER_API_KEY=your_api_key_here mcp/weather-mcp-server

用法

可用工具

current_weather

获取特定位置的当前天气数据。

参数:

  • location (必填):城市名称或城市名称+国家代码(例如,“伦敦”,“巴黎,法国”)
  • units (可选):测量单位。选项:“公制”(摄氏度)或“英制”(华氏度)。默认值:“公制”

示例请求:

{ "params": { "name": "current_weather", "arguments": { "location": "Tokyo,JP", "units": "metric" } } }
weather_forecast

获取特定位置的天气预报。

参数:

  • location (必填):城市名称或城市名称+国家代码(例如,“伦敦”,“巴黎,法国”)
  • units (可选):测量单位。选项:“公制”(摄氏度)或“英制”(华氏度)。默认值:“公制”
  • days (可选):预测的天数。最大值为 5。默认值:5

示例请求:

{ "params": { "name": "weather_forecast", "arguments": { "location": "New York,US", "units": "imperial", "days": 3 } } }

在 MCP.so 上托管

要在 MCP.so 上托管此服务器:

  1. 确保您的存储库在 GitHub 上公开,并采用 MIT、Apache 或类似许可证
  2. 将您的 MCP 服务器提交至 MCP.so 进行审核
  3. 一旦获得批准,您的服务器将在 MCP Playground 上可用

执照

麻省理工学院

接触

如有疑问或需要支持,请在 GitHub 上提出问题。

-
security - not tested
A
license - permissive license
-
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.

MCP 服务器连接到 OpenWeatherMap 的 API,以不同的测量单位提供世界各地当前天气数据和多日预报。

  1. 特征
    1. 先决条件
      1. 入门
        1. 本地开发
        2. 以 REST 模式运行
        3. Docker
      2. 用法
        1. 可用工具
      3. 在 MCP.so 上托管
        1. 执照
          1. 接触

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              This SSE-based MCP server allows users to connect and interact with National Weather Service APIs to retrieve weather alerts and forecasts.
              Last updated -
              90
              Python
            • -
              security
              F
              license
              -
              quality
              This is a Model Context Protocol (MCP) server that provides weather information using the National Weather Service (NWS) API. Features Get weather alerts for a US state Get weather forecast for a specific location (using latitude and longitude)
              Last updated -
              Python
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              An MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.
              Last updated -
              1
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
              Last updated -
              Python
              • Linux
              • Apple

            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/panzhenyao/mcp-server'

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