Skip to main content
Glama
leash06

Weather MCP Server

by leash06

天气 MCP 服务器

一个模型上下文协议 (MCP) 服务器,通过 OpenWeatherMap API 为 Claude 提供实时天气查询能力。

Claude 可以用它做什么?

  • 获取全球任何城市的当前天气

  • 获取任何城市的 5 天天气预报

Related MCP server: OpenWeatherMap MCP Server

工具

工具

描述

get_current_weather

返回城市的温度、湿度、风速和天气状况

get_forecast

返回城市的 5 天天气预报

如何运行

1. 克隆仓库

git clone https://github.com/leash06/weather-mcp-server.git cd weather-mcp-server

2. 安装依赖

npm install

3. 添加你的 API 密钥

从 openweathermap.org 获取免费密钥,并替换 index.js 中的 YOUR_API_KEY_HERE

4. 连接到 Claude Desktop

将以下内容添加到你的 claude_desktop_config.json 中: { "mcpServers": { "weather-server": { "command": "node", "args": ["/path/to/weather-mcp-server/index.js"] } } }

5. 重启 Claude Desktop 并询问:

"阿尔及尔的天气怎么样?"

构建技术

  • Node.js

  • Anthropic 的 MCP SDK

  • OpenWeatherMap API

作者

leash06 - github.com/leash06

Related MCP Connectors

Related MCP Servers