open-meteo-mcp
Enables users to get weather forecasts, snow conditions, air quality, and location search via the Open-Meteo API, with guided prompts for ski trips and outdoor activities.
README
[!WARNING] This repository has been consolidated into the swiss-mcp mono-repo. New development happens in
packages/open-meteo-mcp/. This repo is kept for historical reference only.
Open Meteo MCP Server
A Model Context Protocol (MCP) server providing weather and snow condition tools via the Open-Meteo API.
Version 3.3.0 - Full type safety, automated quality checks, 90% test coverage!
Features
Core Capabilities
- Geocoding: Search locations by name instead of coordinates
- Weather Forecasts: Get current weather and multi-day forecasts for any location
- Snow Conditions: Get snow depth, snowfall, and mountain weather data
- Air Quality: Monitor AQI, pollutants, UV index, and pollen levels
- MCP Resources: Weather codes, ski resort coordinates, AQI reference, Swiss locations
- MCP Prompts: Guided workflows for ski trips, outdoor activities, and travel planning
- Free API: No API key required - powered by Open-Meteo's free weather API
- MCP Integration: Seamlessly integrates with MCP-compatible clients like Claude Desktop
Quality & Reliability (Phase 8 Complete)
- Type Safety: 0 mypy errors, full type annotations across codebase
- Code Quality: 100% ruff formatting and linting compliant
- Error Handling: Standardized error handling decorators across all tools (Phase 8)
- Automated Checks: Pre-commit hooks enforce quality on every commit
- Test Coverage: 248+ tests passing, 90%+ code coverage
- Production Ready: Fully tested, documented, and ready for deployment
Tools
search_location
Search for locations by name to get coordinates (NEW in v2.1).
Parameters:
name(required): Location name to searchcount(optional): Number of results (1-100, default: 10)language(optional): Language for results (default: "en")country(optional): Country code filter (e.g., "CH" for Switzerland)
Example: search_location(name="Zurich") → Returns coordinates, elevation, timezone
get_weather
Get weather forecast for a location with temperature, precipitation, humidity, and more.
Parameters:
latitude(required): Latitude in decimal degreeslongitude(required): Longitude in decimal degreesforecast_days(optional): Number of forecast days (1-16, default: 7)include_hourly(optional): Include hourly forecasts (default: true)timezone(optional): Timezone for timestamps (default: "auto")
Enhanced in v2.1: Now includes precipitation probability, apparent temperature, UV index, cloud cover, visibility, wind gusts
get_snow_conditions
Get snow conditions and forecasts for mountain locations.
Parameters:
latitude(required): Latitude in decimal degreeslongitude(required): Longitude in decimal degreesforecast_days(optional): Number of forecast days (1-16, default: 7)include_hourly(optional): Include hourly data (default: true)timezone(optional): Timezone for timestamps (default: "Europe/Zurich")
Enhanced in v2.1: Now includes wind chill, cloud cover, precipitation probability
get_air_quality
Get air quality forecast including AQI, pollutants, UV index, and pollen (NEW in v2.1).
Parameters:
latitude(required): Latitude in decimal degreeslongitude(required): Longitude in decimal degreesforecast_days(optional): Number of forecast days (1-5, default: 5)include_pollen(optional): Include pollen data (default: true, Europe only)
Returns: European/US AQI, PM10, PM2.5, O3, NO2, SO2, CO, UV index, pollen counts
Resources
The server provides MCP resources for reference data:
weather-codes
WMO weather code reference with descriptions, categories, and travel impact.
- URI:
weather://codes - Format: JSON
- Content: 28 weather codes with interpretations
...existing code...
swiss-locations
Popular Swiss locations with coordinates (NEW in v2.1).
- URI:
weather://swiss-locations - Format: JSON
- Content: Cities, mountains, passes, and lakes
aqi-reference
Air Quality Index interpretation guide (NEW in v2.1).
- URI:
weather://aqi-reference - Format: JSON
- Content: European/US AQI scales, UV index, pollen levels, health recommendations
weather-parameters
Available weather and snow parameters from Open-Meteo API.
- URI:
weather://parameters - Format: JSON
- Content: Hourly/daily parameters with units and categories
Prompts
The server provides MCP prompts to guide LLM workflows:
ski-trip-weather
Guide for checking snow conditions and weather for ski trips.
- Arguments: resort, dates
- Workflow: Resort lookup → Snow conditions → Weather → Assessment
plan-outdoor-activity
Weather-aware outdoor activity planning workflow.
- Arguments: activity, location, timeframe
- Workflow: Activity sensitivity → Weather check → Suitability assessment
weather-aware-travel
Integration pattern for combining weather with journey planning.
- Arguments: destination, travel_dates, trip_type
- Workflow: Destination weather → Packing advice → Activity suggestions
Technology Stack
- Python 3.11+
- FastMCP - MCP server framework
- httpx - Async HTTP client
- Pydantic - Data validation
- structlog - Structured logging
- uv - Fast Python package manager
Prerequisites
- Python 3.11 or higher
- uv package manager
Installation
Install uv (if not already installed)
Windows (PowerShell):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Install Dependencies
uv sync
This will install all required dependencies including FastMCP, httpx, pydantic, and testing tools.
Running Locally
Stdio Mode (for Claude Desktop)
uv run python -m open_meteo_mcp.server
Testing with MCP Inspector
npx @modelcontextprotocol/inspector uv run python -m open_meteo_mcp.server
MCP Integration
Claude Desktop Configuration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"open-meteo": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourUsername\\path\\to\\open-meteo-mcp",
"run",
"python",
"-m",
"open_meteo_mcp.server"
]
}
}
}
Note: Update the --directory path to match your local installation.
Development
Running Tests
# Run all tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest tests/ --cov=open_meteo_mcp --cov-report=html
# Run specific test file
uv run pytest tests/test_models.py -v
Project Structure
open-meteo-mcp/
├── src/
│ └── open_meteo_mcp/
│ ├── __init__.py
│ ├── server.py # FastMCP server with tools, resources, prompts
│ ├── client.py # Open-Meteo API client
│ ├── models.py # Pydantic models
│ ├── helpers.py # Utility functions
│ └── data/ # JSON resource files
│ ├── weather-codes.json
...existing code...
│ └── weather-parameters.json
├── tests/
│ ├── test_models.py
│ ├── test_client.py
│ └── test_helpers.py
├── pyproject.toml # Project configuration
└── .fastmcp/
└── config.yaml # FastMCP Cloud deployment config
Deployment
FastMCP Cloud
Deploy to FastMCP Cloud for remote access:
# Login to FastMCP Cloud
fastmcp login
# Deploy the server
fastmcp deploy
# Check deployment status
fastmcp status open-meteo-mcp
The server will be available at https://open-meteo-mcp.fastmcp.cloud
Example Usage
Once connected via MCP, you can ask:
Geocoding (NEW):
- "Find coordinates for Zurich"
- "Where is the Matterhorn?"
- "Search for Interlaken"
Weather Queries:
- "What's the weather in Bern, Switzerland?"
- "Show me the 7-day forecast for Zurich"
- "What's the UV index tomorrow?"
- "Chance of rain this weekend?"
Air Quality (NEW):
- "What's the air quality in Zurich?"
- "Pollen forecast for Bern?"
- "Is it safe to exercise outdoors today?"
Snow Conditions:
- "What are the snow conditions in Zermatt?"
- "Will it snow in the Alps this week?"
- "Wind conditions at Verbier?"
Ski Trip Planning (uses prompts + resources):
- "Plan a ski trip to Verbier this weekend"
- "Compare snow conditions across St. Moritz, Davos, and Zermatt"
Outdoor Activities (uses prompts):
- "I want to hike the Eiger Trail next week, what's the weather?"
- "Best days for cycling around Lake Geneva this week?"
- "Can I go hiking tomorrow? I have allergies" (checks weather + pollen)
Weather Codes
The API returns WMO weather codes. See docs/WEATHER_CODES.md for the complete reference.
Migration from Java
This is version 2.0 of the Open Meteo MCP server, migrated from Java/Spring Boot to Python/FastMCP for:
- Faster development and iteration
- Easier deployment with FastMCP Cloud
- Better integration with the MCP ecosystem
- Simpler codebase and dependencies
The Java version (v1.x) is archived in the java-v1 branch.
License
MIT License
Credits
Weather data provided by Open-Meteo - Free Open-Source Weather API.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。