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_serverAvailable Tools
8 toolsconvert_timeB
Convert time from one timezone to another.
| Name | Required | Description | Default |
|---|---|---|---|
| datetime_str | Yes | DateTime string in ISO format (e.g., '2024-01-15T14:30:00') or 'now' for current time | |
| from_timezone | Yes | Source timezone (IANA timezone name) | |
| to_timezone | Yes | Target timezone (IANA timezone name) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description gives minimal behavioral info. It does not disclose return values, error handling, or edge cases like DST or invalid timezones.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words, effectively communicating the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Missing key context like return format and error handling, given no output schema. The description is too brief for a conversion tool that may need to clarify behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all parameters. The description adds no additional meaning beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool converts time between timezones, which is a specific verb+resource. It distinguishes from sibling tools like get_current_datetime and get_timezone_info.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly state when to use this tool vs alternatives. Context from siblings implies usage, but no clear when-not-to-use or alternative mentions are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_air_qualityA
Get air quality information for a specified city including PM2.5, PM10, ozone, nitrogen dioxide, carbon monoxide, and other pollutants. Provides health advisories based on current air quality levels.
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The name of the city to fetch air quality information for, PLEASE NOTE English name only, if the parameter city isn't English please translate to English before invoking this function. | |
| variables | No | Air quality variables to retrieve. If not specified, defaults to pm10, pm2_5, ozone, nitrogen_dioxide, and carbon_monoxide. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden. It lists the pollutants returned and mentions health advisories, but does not disclose any behavioral traits such as data freshness, units, potential errors, or rate limits. It is adequate but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the purpose, and contains no unnecessary words. Every sentence adds value and is well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple parameter set (2 params) and no output schema, the description is fairly complete. It explains available variables and default behavior. It could be improved by mentioning the output format or example usage, but it is sufficient for a basic retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage with descriptions for both parameters. The description adds crucial context: for the 'city' parameter, it instructs to translate non-English names to English, and for 'variables', it specifies the defaults. This goes beyond the schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: getting air quality information for a specified city, including specific pollutants and health advisories. It distinguishes itself from sibling tools like 'get_air_quality_details' and weather/time tools by focusing on air quality data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear context for when to use the tool (to get air quality info) but does not explicitly state when not to use it or how it differs from the sibling 'get_air_quality_details'. No exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_air_quality_detailsB
Get detailed air quality information for a specified city as structured JSON data. This tool provides raw air quality data for programmatic analysis and processing.
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The name of the city to fetch air quality information for, PLEASE NOTE English name only, if the parameter city isn't English please translate to English before invoking this function. | |
| variables | No | Air quality variables to retrieve |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only says it provides raw data. Does not disclose any behavioral traits such as rate limits, authentication requirements, or data freshness. For a read-only tool this is minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with a clear statement of purpose and usage context. Some whitespace formatting but no unnecessary content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only two parameters and no output schema, the description covers the basic purpose and output format. However, it could specify data freshness or whether it returns current or historical data.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. The description does not add significant meaning beyond schema, aside from reinforcing the 'English name only' hint already present in the city parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'Get' and resource 'detailed air quality information' with output format 'structured JSON data'. Distinguishes from sibling 'get_air_quality' which likely provides simpler data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Indicates it provides raw data for programmatic use, but does not explicitly differentiate from 'get_air_quality' or specify when to use this tool over others.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_current_datetimeA
Get current time in specified timezone.
| Name | Required | Description | Default |
|---|---|---|---|
| timezone_name | Yes | IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use UTC timezone if no timezone provided by the user. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It states the tool returns the current time, but does not specify that it relies on server time, that it's read-only, or any other behavioral traits. For a simple read operation, this is adequate but minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that immediately conveys the tool's purpose. No redundant information, and it is front-loaded with the primary action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema), the description is largely complete. It could benefit from a slight elaboration to differentiate from sibling tools, but it sufficiently covers the core functionality.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description does not add meaning beyond the schema, which already provides an example and fallback instruction. The tool description itself is too brief to enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets the current time in a specified timezone. However, it doesn't differentiate from sibling tools like 'convert_time' or 'get_timezone_info', which could be used for related purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for obtaining current time in a timezone but provides no explicit guidance on when to use this tool versus alternatives like 'get_timezone_info' or 'convert_time'. No exclusion criteria are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_current_weatherA
Get current weather information for a specified city. It extracts the current hour's temperature and weather code, maps the weather code to a human-readable description, and returns a formatted summary.
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The name of the city to fetch weather information for, PLEASE NOTE English name only, if the parameter city isn't English please translate to English before invoking this function. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes the processing steps (extracting current hour's temperature, mapping weather code) and the return format. Without annotations, this provides adequate behavioral transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three lines, front-loaded with the core purpose, no waste. Efficiently communicates functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool without output schema, the description covers the essential behavior and output format. Lacks details on error handling or unavailable cities, but acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool description itself does not discuss the city parameter; the input schema's parameter description already provides full guidance (including translation note). Baseline 3 due to 100% schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it gets current weather for a city and describes the output (temperature, weather code, summary). Differentiates from sibling tools like get_weather_details or get_weather_byDateTimeRange.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies use for current weather but does not explicitly state when to use versus alternatives or provide exclusions (e.g., historical data, forecasts).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_timezone_infoA
Get information about a specific timezone including current time and UTC offset.
| Name | Required | Description | Default |
|---|---|---|---|
| timezone_name | Yes | IANA timezone name (e.g., 'America/New_York', 'Europe/London') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It mentions return of current time and offset, but doesn't discuss error handling, behavior on invalid timezone names, or any other side effects. Adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, efficient, no redundant content. Could be slightly more informative without increasing length, but remains appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a single parameter and no output schema, the description fully explains purpose and return content. However, specifying output format (e.g., JSON fields) would enhance completeness. Overall, sufficient for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage and a single parameter already described, the description adds minimal value beyond restating 'including current time and UTC offset'. It does not elaborate on parameter format or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets information about a specific timezone including current time and UTC offset. It uses a specific verb 'Get' and resource 'timezone info', distinguishing it from sibling tools like convert_time or get_current_datetime.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when timezone info is needed, but lacks explicit when-to-use, when-not-to-use, or references to alternatives. No guidance on when to prefer this over sibling tools like convert_time.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_byDateTimeRangeB
Get weather information for a specified city between start and end dates.
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The name of the city to fetch weather information for, PLEASE NOTE English name only, if the parameter city isn't English please translate to English before invoking this function. | |
| start_date | Yes | Start date in format YYYY-MM-DD, please follow ISO 8601 format | |
| end_date | Yes | End date in format YYYY-MM-DD , please follow ISO 8601 format |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full behavioral burden but only states the basic function. No disclosure of traits like data source, update frequency, error handling, or what happens if dates span gaps. Minimal value beyond the name.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence of 11 words that is efficient and front-loads the purpose. Every word earns its place; no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity of a date-range weather tool with no output schema, the description is minimally adequate. However, it could mention the return format (e.g., temperature, conditions) or that it covers the full range. Lacks completeness but not severely.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description does not add meaning beyond the schema; it merely restates the overall purpose. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (Get), the resource (weather information), and the scope (for a specified city between start and end dates). It distinguishes itself from siblings like get_current_weather and get_weather_details by specifying a date range.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives (e.g., get_current_weather for current conditions, get_weather_details for more detail). The description does not provide when-not-to-use or mention any prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_detailsB
Get detailed weather information for a specified city as structured JSON data. This tool provides raw weather data for programmatic analysis and processing.
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | The name of the city to fetch weather information for, PLEASE NOTE English name only, if the parameter city isn't English please translate to English before invoking this function. | |
| include_forecast | No | Whether to include forecast data (next 24 hours) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description alone must convey behavior. It indicates the output is structured JSON and intended for analysis, but does not disclose specifics like data fields, potential errors, or rate limits. The lack of behavioral details leaves the agent with incomplete expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with only two sentences, front-loading the core purpose. Every sentence serves a clear purpose without redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with two well-documented parameters and no output schema, the description is complete enough for basic usage. It would benefit from mentioning output structure (e.g., JSON fields) but is not critically lacking given the schema's thoroughness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides complete descriptions for both parameters (city and include_forecast) with 100% coverage. The description adds no additional semantic value beyond what the schema already offers, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool provides detailed weather information as structured JSON data, using specific verbs ('get', 'provides') and specifying the resource (weather data). However, it does not explicitly distinguish itself from sibling tools like 'get_current_weather', which may also return weather data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'get_current_weather' or 'get_weather_byDateTimeRange'. The description implies it is for programmatic analysis but does not state exclusions or context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.0- Added
get_air_quality - Added
get_air_quality_details
7 tool updates
- Added
convert_time - Changed
get_current_datetime2 fields changed- removed
Input schema / properties / timezone_name / titleRemoved value: -"Timezone Name" - removed
Input schema / titleRemoved value: -"get_current_datetimeArguments"
- Changed
get_current_weather2 fields changed- removed
Input schema / properties / city / titleRemoved value: -"City" - removed
Input schema / titleRemoved value: -"get_current_weatherArguments"
- Added
get_timezone_info - Removed
get_weather_by_datetime_range - Added
get_weather_byDateTimeRange - Added
get_weather_details
3 tool updates
- First observed
get_current_datetime - First observed
get_current_weather - First observed
get_weather_by_datetime_range
TDQS
Scored across 8 tools
Some tools have overlapping purposes, such as get_current_weather vs get_weather_details and get_air_quality vs get_air_quality_details, which differ only in output format. Time-related tools (convert_time, get_current_datetime, get_timezone_info) also overlap in functionality, potentially confusing an agent.
Most tools follow a `get_<resource>` pattern in snake_case, but `get_weather_byDateTimeRange` mixes casing (DateTime) and deviates from the pure snake_case convention. This inconsistency partially undermines naming predictability.
With 8 tools covering weather, air quality, and time operations, the count is appropriate for the server's scope. It is neither too sparse nor overly large, though some tools could be consolidated.
The tool set covers current weather, weather over a date range, air quality (both summary and details), and time-related features. Missing forecast-specific tools are partially addressed by the date range tool, making it fairly complete for a weather/time server.
Maintenance
Related MCP Connectors
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Open-Meteo tabanlı anahtarsız hava durumu tahmin MCP sunucusu.
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA 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.19 npmISC
- FlicenseNot gradedqualityDmaintenanceA 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.212 npm97MIT