Weather MCP Server
天气 MCP 服务器
使用 Open-Meteo API 提供天气信息的模型上下文协议 (MCP) 服务器。
特征
获取指定城市的当前天气信息。
Related MCP server: MCP Weather Server
安装
Pip 安装和使用,可以使用 pip 安装此包:
pip install mcp_weather_server该服务器设计为通过将其配置添加到cline_mcp_settings.json文件来手动安装。
将以下条目添加到
cline_mcp_settings.json文件中的mcpServers对象:
{
"mcpServers": {
"weather": {
"command": "python",
"args": [
"-m",
"mcp_weather_server"
],
"disabled": false,
"autoApprove": []
}
}
}保存
cline_mcp_settings.json文件。
配置
此服务器不需要 API 密钥。它使用免费且开源的 Open-Meteo API。
用法
该服务器提供了几个工具: get_weather , get_weather_by_datetime_range和get_current_datetime 。
get_weather
检索给定城市的当前天气信息。
参数:
city(字符串,必需):城市名称。
例子:
要获取台北的天气,您可以使用如下工具:
<use_mcp_tool>
<server_name>weather</server_name>
<tool_name>get_weather</tool_name>
<arguments>
{
"city": "Taipei"
}
</arguments>
</use_mcp_tool>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 日期间伦敦的天气,您可以使用如下工具:
<use_mcp_tool>
<server_name>weather</server_name>
<tool_name>get_weather_by_datetime_range</tool_name>
<arguments>
{
"city": "London",
"start_date": "2024-01-01",
"end_date": "2024-01-07"
}
</arguments>
</use_mcp_tool>get_current_datetime
检索指定时区的当前时间。
参数:
timezone_name(字符串,必需):IANA 时区名称(例如,“America/New_York”、“Europe/London”)。如果用户未提供时区,则使用 UTC 时区。
例子:
要获取纽约的当前时间,您可以使用如下工具:
<use_mcp_tool>
<server_name>weather</server_name>
<tool_name>get_current_datetime</tool_name>
<arguments>
{
"timezone_name": "America/New_York"
}
</arguments>
</use_mcp_tool>对于开发人员
运行 Python 之前更改工作目录
python -m mcp_weather_server或者,如果您希望 Python 不管从哪里运行都能找到您的包,您可以设置 PYTHONPATH:
set PYTHONPATH=C:\xxx\mcp_weather_server\src
python -m mcp_weather_serverMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.1
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides real-time weather data and forecasts for any city.111ISC
- Flicense-qualityDmaintenanceA Model Context Protocol server that enables natural language weather queries for global cities, integrating with OpenWeather API to provide real-time weather information in an easy-to-read format.1
- AlicenseBqualityDmaintenanceA simple Model Context Protocol server that provides real-time weather data to AI agents like GitHub Copilot, allowing users to get current weather information for any city through natural language queries.23197MIT
Related MCP Connectors
Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/isdaniel/mcp_weather_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server