TM

timlukahorstmann/mcp-weather

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

34 stars 14 forks 质量 67 趋势 0MIT

timlukahorstmann/mcp-weather 是从 https://github.com/timlukahorstmann/mcp-weather. 导入的 MCP 服务器候选人。

概览

timlukahorstmann/mcp-weather 是从 https://github.com/timlukahorstmann/mcp-weather. 导入的 MCP 服务器候选人。

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,利用AccuWeather API提供每小时和每日天气预报。


快速启动

你需要一个AccuWeather API密钥(有免费套餐)。 点击这里注册并创建应用程序获取您的钥匙。

导出你的API密钥作为环境变量:

然后直接运行MCP天气服务器,使用:

或者,对于通过超级网关访问 HTTP/REST 的话:


MCP 服务器配置示例

为了与 Claude Desktop 或其他兼容 MCP 的客户端集成,请在配置中添加以下内容(例如 claude_desktop_config.json):


概述

该MCP服务器允许大型语言模型(如Claude)访问实时天气数据。当与大型语言模型集成时,它使模型能够:

  • 获取准确、最新的天气预报
  • 提供未来12小时的每小时天气数据
  • 获取最长15天的每日天气预报
  • 显示公制(°C)和英制(°F)两种单位的数据
  • 查看温度、状况、降水信息及其他天气详情

可用工具

每小时天气预报

  • 工具名称:weather-get_hourly
  • 提供未来12小时的每小时天气预报
  • 参数:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Weather Server

A Model Context Protocol (MCP) server that provides hourly and daily weather forecasts using the AccuWeather API.


Quick Start

You need an AccuWeather API key (free tier available).
Sign up here and create an app to get your key.

Export your API key as an environment variable:

export ACCUWEATHER_API_KEY=your_api_key_here

Then run the MCP Weather server directly with:

npx -y @timlukahorstmann/mcp-weather

Or, for HTTP/REST access via supergateway:

npx -y supergateway --stdio "npx -y @timlukahorstmann/mcp-weather" \
  --port 4004 \
  --baseUrl http://127.0.0.1:4004 \
  --ssePath /messages \
  --messagePath /message \
  --cors "*" \
  --env ACCUWEATHER_API_KEY="$ACCUWEATHER_API_KEY"

MCP Server Config Example

For integration with Claude Desktop or other MCP-compatible clients, add this to your config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "@timlukahorstmann/mcp-weather"],
      "env": {
        "ACCUWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Overview

This MCP server allows large language models (like Claude) to access real-time weather data. When integrated with an LLM, it enables the model to:

  • Fetch accurate, up-to-date weather forecasts
  • Provide hourly weather data for the next 12 hours
  • Access daily weather forecasts for up to 15 days
  • Display data in both metric (°C) and imperial (°F) units
  • View temperature, conditions, precipitation information, and other weather details

Available Tools

Hourly Weather Forecast

  • Tool name: weather-get_hourly
  • Provides hourly forecasts for the next 12 hours
在 GitHub 查看完整 README

安装

npx -y @timlukahorstmann/mcp-weather
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "weather": { "command": "npx", "args": ["-y", "@timlukahorstmann/mcp-weather"], "env": { "ACCUWEATHER_API_KEY": "your_api_key_here" } } } }