Skip to main content
Glama

mcp-weather

全球天气 MCP 服务器。它将地名转换为坐标,然后通过 stdio 为 Cursor 等 MCP 客户端返回当前天气状况。

仓库:github.com/deep3036/mcp-weather

功能

该服务器注册了一个工具:

工具

输入

输出

get-current-weather

location(城市或地名,至少 2 个字符)

当前温度、体感温度、湿度、降水量、风速、天气状况、昼夜、时区和坐标

location 示例:Delhi、Greater Noida、Mumbai、London。

地理编码使用 Open-Meteo Geocoding。预报数据使用 Open-Meteo Forecast。这两种 API 在此用途下均无需密钥。

如果多个地点与名称匹配,则使用第一个地理编码结果。

Related MCP server: Weather MCP

环境要求

  • Node.js 20 或更高版本

  • npm

安装

npm install

运行

开发模式(通过 tsx 运行 TypeScript):

npm run dev

生产模式:

npm run build
npm start

该进程通过 stdin/stdout 进行 MCP 通信。日志输出到 stderr。请勿将其作为普通 Web 应用运行。

Cursor MCP 配置

将客户端指向此项目目录:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["tsx", "src/index.ts"],
      "cwd": "D:\\mcp\\weather-mcp"
    }
  }
}

构建后,可以使用 node 和 dist/index.js 代替 tsx。

项目结构

路径

作用

src/index.ts

MCP 服务器、工具及 Open-Meteo 调用

tsconfig.json

TypeScript(ES2022、NodeNext,src 到 dist)

package.json

脚本:dev、build、start

许可证

ISC

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to get current weather information for any city using the Open-Meteo API. Provides detailed meteorological data including temperature, precipitation, day/night status, and hourly forecasts through natural language queries.
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to get real-time weather information for any city in the world. Provides current temperature and weather conditions through a simple city name query.
    MIT
  • 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.
    4 npm
    MIT