天气与地理位置服务

一个基于Cloudflare Workers的天气和地理位置服务,提供天气预报、历史天气估计、地理位置解析、天气模型指导和雪崩公告等功能。

  • by colinnuk
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 colinnuk/AlpineConditions-MCP

使用说明

Alpine条件MCP

专为Cloudflare Workers设计的用于alpineconditions.com天气和地理定位工具的HTTP MCP服务器。

这现在能做什么

  • get_weather_forecast

    • 输入: latitude, longitude,可选 models
    • 从以下位置加载预测数据 https://apigateway.alpineconditions.com/weatherforecastapi/weatherForecast
    • 返回结构化预测JSON,其中包含:
      • overviewByModel (高级统计数据)
      • sixHourlyByModel (6小时分块总结,便于LLM解释)
    • 包括用于LLM的紧凑模型上下文(used 简洁明了 selectedModelNotes)
    • 使用 get_weather_model_guidance 有关全位置模型指导的详细信息
  • get_historical_weather_estimate

    • 输入: latitude, longitude
    • 从加载历史估计数据 https://apigateway.alpineconditions.com/weatherforecastapi/historicalestimate
    • 返回结构化估计JSON,其中包含:
      • overview (最近历史窗口的高级统计数据)
      • sixHourly (历史时间线上6小时的分块总结)
  • get_location_name_from_geolocation

    • 用途 https://apigateway.alpineconditions.com/geolocation
    • 通过以下方式解析人类可读的位置 https://apigateway.alpineconditions.com/weatherforecastapi/location
  • get_weather_model_guidance

    • 输入: latitude, longitude
    • 返回特定位置的模型指南,包括:
      • Alpine Conditions Blend是否可用
      • 该地点有哪些高分辨率型号
      • 特定型号的使用指南
  • get_avalanche_bulletin

    • 输入: latitude, longitude
    • 从加载雪崩公告数据 https://apigateway.alpineconditions.com/avalancheapi
    • 在内部按坐标解析区域ID,然后加载最新的区域公告
    • 返回结构化公告JSON,包括区域元数据、危险评级、问题和地形/旅行建议

公共链接

设置

npm install
npm run build

在本地运行(Worker-dev服务器)

npm run dev

MCP端点: http://127.0.0.1:8787/mcp

部署(Cloudflare Workers)

npm run deploy

构建MCP捆绑包

npm run build:mcpb

这创造了 alpineconditions.mcpb 在存储库根目录中导入到Claude Desktop。

生产测试套件

npm run test:prod

这将对以下对象运行实时集成测试 https://www.alpineconditions.com.

配置

  • ALPINECONDITIONS_BASE_URL (可选)
    • 违约: https://apigateway.alpineconditions.com
    • 适用于本地测试或替代环境。
    • 在Cloudflare Workers中,将其设置为Worker环境变量。

备注

此服务器有意在下使用自包含的API客户端 src/services 并且不依赖于来自其他存储库的前端应用程序模块。