Integrations
Provides hourly weather forecasts using the AccuWeather API, allowing access to real-time weather data including temperature, conditions, and other weather details for any location.
MCP 天气服务器
使用 AccuWeather API 提供每小时天气预报的模型上下文协议 (MCP) 服务器。
快速入门
您需要一个 AccuWeather API 密钥(提供免费套餐)。
在此注册并创建一个应用程序来获取您的密钥。
将您的 API 密钥导出为环境变量:
然后直接运行 MCP Weather 服务器:
或者,通过超级网关进行 HTTP/REST 访问:
MCP 服务器配置示例
为了与 Claude Desktop 或其他 MCP 兼容客户端集成,请将其添加到您的配置中(例如claude_desktop_config.json
):
概述
该 MCP 服务器允许大型语言模型(例如 Claude)访问实时天气数据。与 LLM 集成后,该服务器可使模型实现以下功能:
- 获取准确、最新的天气预报
- 提供任何地点的每小时天气数据
- 获取温度、状况和其他天气详情
先决条件
- Node.js ≥18
- AccuWeather API 密钥(通过
.env
或您的 shell 设置)
设置
- 克隆此存储库:Copy
- 安装依赖项:Copy
- 获取 AccuWeather API 密钥:
- 在AccuWeather API注册
- 创建新应用并获取 API 密钥
- 使用您的 API 密钥创建一个
.env
文件:Copy - 构建项目:Copy
与 Claude Desktop 一起使用
- 配置 Claude Desktop 以使用此 MCP 服务器:
- 打开 Claude 桌面
- 前往“设置”>“开发者”>“编辑配置”
- 将以下内容添加到您的
claude_desktop_config.json
中:
Copy - 重启Claude桌面
- 在新对话中,单击插头图标并选择“天气”以启用 MCP 服务器
- 现在你可以向克劳德询问天气预报,例如:
- “纽约市的天气预报怎么样?”
- “明天伦敦会下雨吗?”
- “今天下午东京会有多热?”
发展
- 安装开发依赖项:
npm install
- 检查你的代码:
npm run lint
- 构建:
npm run build
- 运行测试:
npm test
- 以开发模式启动:
npm run dev
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
未来的增强功能
我们始终致力于改进 MCP 天气服务器。以下是我们计划在未来版本中推出的一些功能:
- **每日预报:**选择检索未来几天的摘要。
- **延长每小时预报:**超过 12 小时,例如 24 或 48 小时。
- **更多配置选项:**例如,通过输入首选单位(摄氏度/华氏度)。
如果您对其他功能有想法,请随时提出问题!
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
MCP天气
Related MCP Servers
- -securityFlicense-qualityAn MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.Last updated -Python
- AsecurityFlicenseAqualityMCP server that provides Korean weather information using grid coordinates and the Korea Meteorological Administration API, allowing users to query current weather conditions and forecasts for specific locations in Korea.Last updated -23Python
- -securityFlicense-qualityA Model Control Protocol (MCP) based service that allows users to query weather forecasts by coordinates and receive weather alerts for U.S. states.Last updated -1Python
- PythonMIT License