Weather Api Mcp Server

Weather Api Mcp Server

🚀 mcp-weather-api

mcp-weather-api 是一个强大的天气信息获取工具,支持多种配置选项与位置格式,能轻松满足你对天气数据的需求。

🚀 快速开始

mcp-weather-api 是一个用于获取天气信息的工具,支持多种配置选项和位置格式。以下是详细的安装、配置和使用说明。

📦 安装指南

要使用 mcp-weather-api,请按照以下步骤进行安装:

方法一:通过 npm 安装

打开终端并运行以下命令:

npm install -g mcp-weather-api

方法二:手动下载

GitHub 下载最新版本的压缩包,并解压到任意目录。

🛠️ 配置

在项目根目录下创建一个 config.json 文件,添加以下配置:

{
"weather-api-key": "your_api_key",
"default-location": "Beijing",
"units": "metric"
}

可用选项:

  • weather-api-key:天气 API 的密钥。
  • default-location:默认查询的位置,默认为北京。
  • units:单位系统,支持 imperialmetric

💻 使用示例

基础用法

获取当前天气:

mcp-weather-api --location Shanghai

设置默认位置:

mcp-weather-api --set-default-location Guangzhou

显示帮助信息:

mcp-weather-api --help

🛠️ 开发

如果你希望对工具进行二次开发,请按照以下步骤操作:

克隆仓库

git clone https://github.com/username/repo.git
cd repo

安装依赖

npm install

运行测试

npm test

⚠️ 注意事项

⚠️ 重要提示

  • 确保你拥有有效的天气 API 密钥。
  • 部分地理位置可能不支持,建议查阅 API 文档。
  • 工具默认使用 metric 单位(摄氏度),如需使用华氏度,请设置为 imperial
  • 0 关注
  • 0 收藏,25 浏览
  • system 提出于 2025-10-01 19:09

相似服务问题

相关AI产品