Skip to main content
Glama
weather-mcp

weather-mcp

by vijaypss

天气 API + UI + MCP 服务器

本项目包含:

  • UI:输入城市名称并获取当前天气

  • HTTP API:GET /api/weather?city=...

  • 摘要 API:GET /api/summary?city=...(可选 Claude;若不可用则回退至本地摘要)

  • MCP 服务器:通过 stdio 提供 get_weather 工具

天气数据使用 Open‑Meteo(免费,无需 API 密钥)。

运行 UI + API

npm install
npm run dev

打开 http://localhost:5175。

可选:“Claude API”摘要

Claude 并非完全免费;你需要一个 API 密钥。本项目支持以下任一方式:

  • ANTHROPIC_API_KEY(直接使用 Anthropic API),或

  • OPENROUTER_API_KEY(OpenRouter,通过 OPENROUTER_MODEL 使用 Anthropic Claude 模型)

如果未设置密钥,/api/summary 和 UI 中的“总结”按钮将回退至本地摘要。

运行 MCP 服务器 (stdio)

npm install
npm run mcp

然后配置你的 MCP 客户端以启动:

  • 命令:npm

  • 参数:["run","mcp"]

  • 工作目录:此文件夹

工具名称:

  • get_weather,输入参数为 { "city": "Pune" }

"# MCP_example"

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides current weather information for any city worldwide using the free Open-Meteo API, enabling users to query temperature, wind speed, humidity, and weather conditions through natural language.
    3 npm
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides weather information using Open-Meteo API without requiring an API key. Supports weather queries by city name or coordinates with customizable temperature units.
    -