
Weather MCP Server
io.github.isdaniel由 GitHub 账号 isdaniel 发布v0.6.1更新于 Oct 24, 2026
providing weather information, air quality data, and timezone utilities using the Open-Meteo API.
概览
本地 MCP 服务器,借助免费的 Open-Meteo API 让助手查询实时与预报天气、空气质量和时区,无需 API 密钥。
- 可以做什么
- 查询城市当前天气,包括温度、风况、降水、紫外线指数、能见度以及日出日落时间;也可按日期范围获取逐小时天气及趋势和提醒,并提供对应的原始 JSON 详情工具。获取城市空气质量,包含污染物浓度、等级、健康建议以及与 WHO 和 EPA 标准的对比,或返回结构化 JSON 数据。查询任意 IANA 时区的当前时间、时区偏移与夏令时信息,并在两个时区之间转换时间。
- 适用场景
- 适合让助手回答全球城市的天气、预报、空气质量或时区问题,而无需注册天气服务。适用于 Claude Desktop、Cline 等桌面 MCP 客户端,也可作为 HTTP 服务器用于网页集成。
- 运行要求
- 作为本地 Python 进程运行,从 PyPI 安装 mcp_weather_server 后用 python -m mcp_weather_server 启动;Node.js 仅用于可选的 Smithery 安装器。SSE 或 streamable-http 模式还需 starlette 和 uvicorn,或使用已发布的 Docker 镜像。无需 API 密钥或账号,但需要能访问 Open-Meteo 接口的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Weather MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[LightNow] [PyPI - Downloads] [PyPI - Version] [PyPI Downloads] [Docker Pulls]
[图片]Weather MCP Server
mcp-name: io.github.isdaniel/mcp_weather_server
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API. This server supports multiple transport modes: standard stdio, HTTP Server-Sent Events (SSE), and the new Streamable HTTP protocol for web-based integration.
Features
Weather & Air Quality
- Get current weather information with comprehensive metrics:
- Temperature, humidity, dew point
- Wind speed, direction, and gusts
- Precipitation (rain/snow) and probability
- Atmospheric pressure and cloud cover
- UV index and visibility
- "Feels like" temperature
- Sunrise and sunset times (local time at the location)
- Get weather data for a date range with hourly details and daily sunrise/sunset times
- Get air quality information including:
- PM2.5 and PM10 particulate matter
- Ozone, nitrogen dioxide, carbon monoxide
- Sulfur dioxide, ammonia, dust
- Aerosol optical depth
- Health advisories and recommendations
Time & Timezone
- Get current date/time in any timezone
- Convert time between timezones
- Get timezone information
Transport Modes
- Multiple transport modes:
- stdio - Standard MCP for desktop clients (Claude Desktop, etc.)
- SSE - Server-Sent Events for web applications
- streamable-http - Modern MCP Streamable HTTP protocol with stateful/stateless options
- RESTful API endpoints via Starlette integration
Installation
Installing via Smithery
To install Weather MCP Server automatically via Smithery:
Standard Installation (for MCP clients like Claude Desktop)
This package can be installed using pip:
Manual Configuration for MCP Clients
This server is designed to be installed manually by adding its configuration to the cline_mcp_settings.json file.
- Add the following entry to the
mcpServersobject in yourcline_mcp_settings.jsonfile:
- Save the
cline_mcp_settings.jsonfile.
HTTP Server Installation (for web applications)
For HTTP SSE or Streamable HTTP support, you'll need additional dependencies:
Server Modes
This MCP server supports stdio, SSE, and streamable-http modes in a single unified server:
Mode Comparison
1. Standard MCP Mode (Default)
The standard mode communicates via stdio and is compatible with MCP clients like Claude Desktop.
2. HTTP SSE Mode (Web Applications)
The SSE mode runs an HTTP server that provides MCP functionality via Server-Sent Events, making it accessible to web applications.
SSE Endpoints:
GET /sse- SSE endpoint for MCP communicationPOST /messages/- Message endpoint for sending MCP requests
3. Streamable HTTP Mode (Modern MCP Protocol)
The streamable-http mode implements the new MCP Streamable HTTP protocol with a single /mcp endpoint. This mode supports both stateful (default) and stateless operations.
Streamable HTTP Features:
- Stateful mode (default): Maintains session state across requests using session IDs
- Stateless mode: Creates fresh transport per request with no session tracking
- Single endpoint: All MCP communication happens through
/mcp - Modern protocol: Implements the latest MCP Streamable HTTP specification
Streamable HTTP Endpoint:
POST /mcp- Single endpoint for all MCP communication (initialize, tools/list, tools/call, etc.)
Command Line Options:
Example SSE Usage:
Example Streamable HTTP Usage:
Configuration
This server does not require an API key. It uses the Open-Meteo API, which is free and open-source.
Usage
This server provides several tools for weather and time-related operations:
Available Tools
Weather Tools
get_current_weather- Get current weather for a city with comprehensive metricsget_weather_by_datetime_range- Get weather data for a date range with hourly detailsget_weather_details- Get detailed weather information as structured JSON data
Air Quality Tools
get_air_quality- Get air quality information with pollutant levels and health adviceget_air_quality_details- Get detailed air quality data as structured JSON
Time & Timezone Tools
get_current_datetime- Get current time in any timezoneget_timezone_info- Get timezone informationconvert_time- Convert time between timezones
Tool Details
get_current_weather
Retrieves comprehensive current weather information for a given city with enhanced metrics.
Parameters:
city(string, required): The name of the city (English names only)
Returns: Detailed weather data including:
- Temperature and "feels like" temperature
- Humidity, dew point
- Wind speed, direction (as compass direction), and gusts
- Precipitation details (rain/snow) and probability
- Atmospheric pressure and cloud cover
- UV index with warning levels
- Visibility
Example Response:
get_weather_by_datetime_range
Retrieves hourly weather information with comprehensive metrics for a specified city between start and end dates.
Parameters:
city(string, required): The name of the city (English names only)start_date(string, required): Start date in format YYYY-MM-DD (ISO 8601)end_date(string, required): End date in format YYYY-MM-DD (ISO 8601)
Returns: Comprehensive weather analysis including:
- Hourly weather data with all enhanced metrics
- Temperature trends (highs, lows, averages)
- Precipitation patterns and probabilities
- Wind conditions assessment
- UV index trends
- Weather warnings and recommendations
Example Response:
get_weather_details
Get detailed weather information for a specified city as structured JSON data for programmatic use.
Parameters:
city(string, required): The name of the city (English names only)
Returns: Raw JSON data with all weather metrics suitable for processing and analysis
get_air_quality
Get current air quality information for a specified city with pollutant levels and health advisories.
Parameters:
city(string, required): The name of the city (English names only)variables(array, optional): Specific pollutants to retrieve. Options:pm10- Particulate matter ≤10μmpm2_5- Particulate matter ≤2.5μmcarbon_monoxide- CO levelsnitrogen_dioxide- NO2 levelsozone- O3 levelssulphur_dioxide- SO2 levelsammonia- NH3 levelsdust- Dust particle levelsaerosol_optical_depth- Atmospheric turbidity
Returns: Comprehensive air quality report including:
- Current pollutant levels with units
- Air quality classification (Good/Moderate/Unhealthy/Hazardous)
- Health recommendations for general population
- Specific warnings for sensitive groups
- Comparison with WHO and EPA standards
Example Response:
get_air_quality_details
Get detailed air quality information as structured JSON data for programmatic analysis.
Parameters:
city(string, required): The name of the city (English names only)variables(array, optional): Specific pollutants to retrieve (same options asget_air_quality)
Returns: Raw JSON data with complete air quality metrics and hourly data
get_current_datetime
Retrieves the current time in a specified timezone.
Parameters:
timezone_name(string, required): IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use UTC if no timezone provided.
Returns: Current date and time in the specified timezone
Example:
get_timezone_info
Get information about a specific timezone.
Parameters:
timezone_name(string, required): IANA timezone name
Returns: Timezone details including offset and DST information
convert_time
Convert time from one timezone to another.
Parameters:
time_str(string, required): Time to convert (ISO format)from_timezone(string, required): Source timezoneto_timezone(string, required): Target timezone
Returns: Converted time in target timezone
MCP Client Usage Examples
Using with Claude Desktop or MCP Clients
Web Integration (SSE Mode)
When running in SSE mode, you can integrate the weather server with web applications:
HTML/JavaScript Example
Docker Deployment
The project is available as a Docker image on Docker Hub and includes configurations for easy deployment.
Quick Start with Docker Hub
Pull and run the latest image directly from Docker Hub:
Available Docker Images
- Latest:
dog830228/mcp_weather_server:latest - Versioned:
dog830228/mcp_weather_server:<version>(e.g.,0.5.0)
Images are automatically built and published when new versions are released.
Building from Source
If you want to build the Docker image yourself:
Standard Build
Streamable HTTP Build
Development
Project Structure
Running for Development
Standard MCP Mode (stdio)
SSE Server Mode
Streamable HTTP Mode
Adding New Tools
To add new weather or time-related tools:
- Create a new tool handler in the appropriate file under
tools/ - Inherit from the
ToolHandlerbase class - Implement the required methods (
get_name,get_description,call) - Register the tool in
server.py
Dependencies
Core Dependencies
mcp>=1.0.0- Model Context Protocol implementationhttpx>=0.28.1- HTTP client for API requestspython-dateutil>=2.8.2- Date/time parsing utilities
SSE Server Dependencies
starlette- ASGI web frameworkuvicorn- ASGI server
Development Dependencies
pytest- Testing framework
API Data Sources
This server uses free and open-source APIs:
Weather Data: Open-Meteo Weather API
- Free and open-source
- No API key required
- Provides accurate weather forecasts
- Supports global locations
- Historical and current weather data
- Comprehensive metrics (wind, precipitation, UV, visibility)
Air Quality Data:
- Free and open-source
- No API key required
- Real-time air quality data
- Multiple pollutant measurements (PM2.5, PM10, O3, NO2, CO, SO2)
- Global coverage
- Health-based air quality indices
Troubleshooting
Common Issues
1. City not found
- Ensure city names are in English
- Try using the full city name or include country (e.g., "Paris, France")
- Check spelling of city names
2. HTTP Server not accessible (SSE or Streamable HTTP)
- Verify the server is running with the correct mode:
- SSE:
python -m mcp_weather_server --mode sse - Streamable HTTP:
python -m mcp_weather_server --mode streamable-http
- SSE:
- Check firewall settings for the specified port
- Ensure all dependencies are installed:
pip install starlette uvicorn - Verify the correct endpoint:
- SSE:
http://localhost:8080/sseandhttp://localhost:8080/messages/ - Streamable HTTP:
http://localhost:8080/mcp
- SSE:
3. MCP Client connection issues
- Verify Python path in MCP client configuration
- Check that
mcp_weather_serverpackage is installed - Ensure Python environment has required dependencies
4. Date format errors
- Use ISO 8601 format for dates: YYYY-MM-DD
- Ensure start_date is before end_date
- Check that dates are not too far in the future
Error Responses
The server returns structured error messages:
来源:README.md,提交 a26ad58
工具
0版本历史
1- v0.6.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分