SW

sjanax01/weather-mcp-server

开发工具

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

24 stars 19 forks 质量 48 趋势 0MIT

一个简单的极简天气MCP服务器:)

概览

一个用于天气数据的模型上下文协议(MCP)服务器,使用 FastAPI 和 MCP 框架构建。该服务器提供多种与天气相关的工具,AI 助手可以用来获取当前天气状况、预报、空气质量数据等。 - 当前天气状况 - 天气预报(1-14天)- 历史天气数据 - 天气预警 - 空气质量信息 - 天文数据(日出、日落、月相) - 位置搜索 - 时区信息 - 体育赛事 - Python 3.13+ - uv 包管理器 - WeatherAPI API 密钥 通过Smithery自动安装Claude Desktop的天气数据服务器: 3. 在项目根创建一个 .env 文件,使用你的 WeatherAPI 密钥: 服务器默认会从 http://localhost:8000 开始。 本项目采用MIT许可证授权——详情请参见LICENSE文件。

概述(AI 翻译)

一个用于天气数据的模型上下文协议(MCP)服务器,使用 FastAPI 和 MCP 框架构建。该服务器提供多种与天气相关的工具,AI 助手可以用来获取当前天气状况、预报、空气质量数据等。

特色

  • 当前天气状况
  • 天气预报(1-14天)
  • 历史天气数据
  • 天气警报
  • 空气质量信息
  • 天文学数据(日出、日落、月相)
  • 位置搜索
  • 时区信息
  • 体育赛事

要求

  • Python 3.13+
  • UV包管理器
  • WeatherAPI API 密钥

安装

通过Smithery安装

通过Smithery自动安装Claude Desktop的天气数据服务器:

手动安装

  1. 克隆此仓库:

  2. 使用UV安装依赖:

  3. 在项目根节点用你的 WeatherAPI 密钥创建一个 .env 文件:

用途

运行服务器:

服务器默认会从 http://localhost:8000 开始。

许可证

本项目采用MIT许可证授权——详情请参见LICENSE文件。

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

README

Weather MCP Server

A Model Context Protocol (MCP) server for weather data, built with FastAPI and the MCP framework. This server provides various weather-related tools that can be used by AI assistants to retrieve current weather conditions, forecasts, air quality data, and more.

Features

  • Current weather conditions
  • Weather forecasts (1-14 days)
  • Historical weather data
  • Weather alerts
  • Air quality information
  • Astronomy data (sunrise, sunset, moon phases)
  • Location search
  • Timezone information
  • Sports events

Requirements

Installation

Installing via Smithery

To install Weather Data Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @devilcoder01/weather-mcp-server --client claude

Manual Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/Weather_mcp_server.git
    cd Weather_mcp_server
    
  2. Install dependencies using uv:

    uv venv
    uv pip install -e .
    
  3. Create a .env file in the project root with your WeatherAPI key:

    WEATHER_API_KEY=your_api_key_here
    

Usage

Run the server:

python main.py

The server will start on http://localhost:8000 by default.

License

This project is licensed under the MIT License - see the LICENSE file for details.

在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @devilcoder01/weather-mcp-server --client claude
新手?先看 mcpskill.org 教程 →