MCP weather forecast server backed by AMap

MCP weather forecast server backed by AMap

mcp-china-weather-server•byle-dawn

A TypeScript MCP server that queries AMap weather data for Chinese cities, supporting both current conditions and multi-day forecasts.

License: Not specified•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Provides a get-weather-forecast tool that returns weather for a specified Chinese city, either current conditions or a forecast.
  • •Automatically converts Chinese city names to AMap city codes via geocoding.
  • •Returns detailed weather data including temperature, humidity, wind direction and wind strength.
  • •Reads the AMap API key from the AMAP_API_KEY environment variable.

BEST FOR

  • •Looking up current weather conditions in Chinese cities.
  • •Retrieving multi-day weather forecasts for a Chinese city on a given date.

ABOUT MCP-CHINA-WEATHER-SERVER

MCP weather forecast server backed by AMap is cataloged as an MCP server attributed to le-dawn. A TypeScript MCP server that queries AMap weather data for Chinese cities, supporting both current conditions and multi-day forecasts. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP weather forecast server backed by AMap are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does the server need an API key, and how is it provided?

Yes, it uses an AMap API key, which is read from the AMAP_API_KEY environment variable rather than passed in each call.

What date format is used for forecast queries?

Dates use the YYYY-MM-DD format, defaulting to the current day if omitted.

What city name format should be used?

Standard Chinese city-level names should be used, such as 北京市 rather than 北京.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 226e56c94802 · 采集于 2026-11-13 12:47:17 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP 天气预报服务器

基于高德地图API的MCP (Model Context Protocol) 天气预报服务器,使用TypeScript开发。

🌟 功能特性

  • ✅ 实时天气查询 - 获取指定城市的当前天气状况
  • ✅ 天气预报查询 - 获取未来几天的天气预报
  • ✅ 智能城市识别 - 支持中国市级名称自动转换为城市编码
  • ✅ 时区支持 - 可选的时区时间参数
  • ✅ 详细天气信息 - 包含温度、湿度、风向、风力等完整信息
  • ✅ 错误处理 - 完善的错误提示和异常处理

📋 系统要求

  • Node.js 16.0 或更高版本
  • TypeScript 5.0 或更高版本
  • 高德地图API密钥

🚀 快速开始

1. 安装依赖

npm install

2. 构建项目

npm run build

3. 运行服务器

npm start

或者开发模式:

npm run dev

🔑 获取高德地图API密钥

  1. 访问 高德开放平台
  2. 注册并登录账号
  3. 进入控制台 → 应用管理 → 我的应用
  4. 创建新应用,选择「Web服务」类型
  5. 获取API Key

🛠️ 工具使用说明

get-weather-forecast

获取指定城市的天气信息。

参数说明

参数名类型必选说明示例
cityNamestring✅中国市级名称"北京市", "上海市", "广州市"
datestring❌查询日期 (YYYY-MM-DD)"2024-01-15" (默认当天)
forecastTypestring❌查询类型"current" (实时) 或 "forecast" (预报)

API密钥配置

本服务器从环境变量 AMAP_API_KEY 中读取高德地图API密钥,无需在调用时传递。请确保在启动服务器前设置此环境变量。

使用示例

实时天气查询:

{
  "cityName": "北京市",
  "forecastType": "current"
}

天气预报查询:

{
  "cityName": "广州市",
  "date": "2024-01-15",
  "forecastType": "forecast"
}

mcp-server 配置示例

{
  "mcpServers": {
    "weather-forecast": {
      "command": "node",
      "args": [
        "/path/to/your/build/index.js"
      ],
      "env": {
        "AMAP_API_KEY": "your_gaode_api_key_here"
      }
    }
  }
}

返回示例

实时天气:

🌈 天气查询结果

📍 北京 北京市
🌤️  天气:晴
🌡️  温度:15°C
💨 风向:西北风
🌪️  风力:3级
💧 湿度:45%
⏰ 更新时间:2024-01-15 14:30:00

📅 查询日期: 2024-01-15

天气预报:

🌈 天气查询结果

📍 上海 上海市

📅 未来几天天气预报:

今天 (星期一)
🌤️  白天:晴 | 夜间:多云
🌡️  温度:8°C ~ 18°C
💨 风向:东北风 3级 | 东风 2级

2024-01-16 (星期二)
🌤️  白天:多云 | 夜间:阴
🌡️  温度:10°C ~ 20°C
💨 风向:东风 2级 | 东南风 1级

📅 查询日期: 2024-01-15

🏗️ 项目结构

mcp-weather-server/
├── src/
│   └── index.ts          # 主服务器代码
├── build/                # 编译输出目录
├── package.json          # 项目配置
├── tsconfig.json         # TypeScript配置
└── README.md            # 项目文档

🔧 开发说明

核心组件

  1. 地理编码模块 (getCityCode)

    • 将城市名称转换为高德地图城市编码
    • 支持模糊匹配和智能识别
  2. 天气查询模块 (getWeatherInfo)

    • 调用高德天气API获取天气数据
    • 支持实时天气和预报天气两种模式
  3. 数据格式化模块

    • formatLiveWeather: 格式化实时天气数据
    • formatForecastWeather: 格式化预报天气数据

API接口说明

高德地理编码API

  • 接口地址: https://restapi.amap.com/v3/geocode/geo
  • 功能: 将地址转换为坐标和城市编码
  • 文档: 地理编码API文档

高德天气查询API

  • 接口地址: https://restapi.amap.com/v3/weather/weatherInfo
  • 功能: 根据城市编码获取天气信息
  • 文档: 天气查询API文档

⚠️ 注意事项

  1. API限制: 高德地图个人开发者账号每日调用限制为5000次
  2. 城市名称: 请使用标准的中国市级名称,如"北京市"而不是"北京"
  3. 网络环境: 确保服务器能够访问高德地图API服务
  4. 密钥安全: 请妥善保管API密钥,避免泄露

🐛 故障排除

常见错误

  1. "无法找到城市编码"

    • 检查城市名称拼写是否正确
    • 确认使用的是标准市级名称
  2. "API密钥无效"

    • 验证API密钥是否正确
    • 确认密钥对应的服务类型为"Web服务"
  3. "网络请求失败"

    • 检查网络连接
    • 确认防火墙设置允许访问高德API

📄 许可证

MIT License

🤝 贡献

欢迎提交Issue和Pull Request来改进这个项目!

📞 支持

如有问题,请通过以下方式联系:

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP weather forecast server backed by AMap from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-china-weather-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research