天气 MCP 服务器
使用 Open-Meteo API 提供天气信息的模型上下文协议 (MCP) 服务器。
特征
- 获取指定城市的当前天气信息。
安装
Pip 安装和使用,可以使用 pip 安装此包:
该服务器设计为通过将其配置添加到cline_mcp_settings.json
文件来手动安装。
- 将以下条目添加到
cline_mcp_settings.json
文件中的mcpServers
对象:
- 保存
cline_mcp_settings.json
文件。
配置
此服务器不需要 API 密钥。它使用免费且开源的 Open-Meteo API。
用法
该服务器提供了几个工具: get_weather
, get_weather_by_datetime_range
和get_current_datetime
。
get_weather
检索给定城市的当前天气信息。
参数:
city
(字符串,必需):城市名称。
例子:
要获取台北的天气,您可以使用如下工具:
get_weather_by_datetime_range
检索开始日期和结束日期之间指定城市的天气信息。
参数:
city
(字符串,必需):城市名称。start_date
(字符串,必需):开始日期,格式为 YYYY-MM-DD(ISO 8601)。end_date
(字符串,必需):结束日期,格式为 YYYY-MM-DD(ISO 8601)。
例子:
要获取 2024 年 1 月 1 日至 2024 年 1 月 7 日期间伦敦的天气,您可以使用如下工具:
get_current_datetime
检索指定时区的当前时间。
参数:
timezone_name
(字符串,必需):IANA 时区名称(例如,“America/New_York”、“Europe/London”)。如果用户未提供时区,则使用 UTC 时区。
例子:
要获取纽约的当前时间,您可以使用如下工具:
对于开发人员
运行 Python 之前更改工作目录
或者,如果您希望 Python 不管从哪里运行都能找到您的包,您可以设置 PYTHONPATH:
This server cannot be installed
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.
模型上下文协议服务器使用 Open-Meteo API 检索指定城市的当前天气信息,无需 API 密钥。
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides AI agents with tools to retrieve weather alerts and detailed forecasts for US locations using the National Weather Service API.Last updated -280TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that provides comprehensive weather data querying capabilities based on the Caiyun Weather API, supporting real-time weather, forecasts, and alerts with multi-language support.Last updated -72TypeScript
- -security-license-qualityA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.Last updated -Python
- -security-license-qualityA simple server that implements the Model Context Protocol, allowing AI models like Claude to fetch real-time weather information for any location using the wttr.in API.Last updated -JavaScript