A comprehensive Model Context Protocol (MCP) server that provides real-time weather information, forecasts, alerts, air quality data, and intelligent recommendations through AI assistants like Claude.
- Current Weather - Real-time conditions for any city worldwide
- Weather Forecasts - Up to 5-day detailed forecasts
- Weather Alerts - Active warnings and severe weather notifications
- Air Quality - Comprehensive air pollution data with health recommendations
- Multi-City Comparison - Compare weather across up to 5 cities
- Historical Weather - Access past weather data (last 5 days)
- Activity Recommendations - Smart suggestions for outdoor activities, sports, travel, and photography
- Comprehensive Summaries - All-in-one weather reports
- Coordinates Support - Query by latitude/longitude
- JSON Export - Structured data for integrations
- .NET 8.0 or later
- OpenWeatherMap API key (free at openweathermap.org)
-
Get API Key
# Windows set OPENWEATHER_API_KEY=your_actual_api_key_here # macOS/Linux export OPENWEATHER_API_KEY=your_actual_api_key_here
-
Configure VS Code Create
.vscode/mcp.json:{ "servers": { "weather-server": { "type": "stdio", "command": "dotnet", "args": [ "run", "--project", "C:\\Your\\Project\\Path\\WeatherMcpServer.csproj" ] } } } -
Test the Server
cd WeatherMcpServer dotnet build dotnet run
GetCurrentWeather- Current conditions for any cityGetWeatherByCoordinates- Weather data by lat/lngGetWeatherForecast- Multi-day weather forecasts
GetWeatherAlerts- Active weather warningsGetAirQuality- Air pollution and health dataCompareWeather- Multi-city weather comparisonGetHistoricalWeather- Past weather dataGetWeatherWithRecommendations- Weather + activity adviceGetWeatherSummary- Comprehensive weather reportGetWeatherJson- Structured data export
Get current weather for Tokyo
Compare weather between London, Paris, and Berlin
Get air quality for coordinates 40.7128, -74.0060
Get weather forecast for Moscow for 3 days
Get weather with outdoor activity recommendations for Sydney
Get historical weather for Rome on 2024-08-10
WeatherMcpServer/
βββ Models/
β βββ WeatherInfo.cs
β βββ WeatherForecast.cs
β βββ WeatherAlert.cs
β βββ AirQuality.cs
β βββ OpenWeatherMapModels.cs
βββ Services/
β βββ IWeatherService.cs
β βββ WeatherService.cs
βββ Tools/
β βββ WeatherTools.cs
β βββ RandomNumberTools.cs
βββ Extensions/
β βββ WeatherExtensions.cs
βββ Program.cs
βββ WeatherMcpServer.csproj
- Real Weather Data (OpenWeatherMap API)
- Current Weather by city
- Weather Forecast (up to 5 days)
- Multiple Locations support
- Error Handling
- Weather Alerts (bonus feature)
- Air Quality monitoring
- Historical weather data
- Multi-city comparisons
- Activity-based recommendations
- Comprehensive weather summaries
- JSON data export
- Coordinate-based queries
-
Smart Activity Recommendations π―
- Outdoor activities, sports, travel, photography advice
- Weather-based suggestions for optimal timing
-
Multi-City Weather Battles π
- Compare weather across multiple cities
- Temperature rankings with medals
- Wind and humidity comparisons
-
Air Quality Health Advisor π¬οΈ
- Real-time pollution levels
- Health recommendations based on air quality
- Detailed pollutant breakdowns
-
Historical Weather Detective π
- Access past weather data
- Compare historical vs current conditions
- Perfect for research and planning
-
Comprehensive Weather Command Center π
- All-in-one weather reports
- Current + forecast + air quality in one view
- Professional-grade weather intelligence
- Async/Await - Non-blocking operations
- HTTP Client Pooling - Efficient API calls
- Error Resilience - Graceful failure handling
- Logging - Comprehensive error tracking
- Clean Architecture - Separated concerns
- SOLID Principles - Clean, maintainable code
- Dependency Injection - Testable architecture
- Extension Methods - Reusable formatting logic
- Type Safety - Strong typing throughout
- API Integration - Professional external service handling
This isn't just another weather app - it's a comprehensive weather intelligence platform that:
- Provides actionable insights, not just data
- Offers multiple perspectives on weather conditions
- Includes health and safety recommendations
- Supports professional use cases like photography and agriculture
- Delivers beautiful, formatted output that's easy to read
- Maintains enterprise-grade code quality
- Real Weather Data β - OpenWeatherMap integration
- Current Weather β - Multiple query methods
- Weather Forecast β - Up to 5-day forecasts
- Multiple Locations β - City names and coordinates
- Error Handling β - Comprehensive error management
- Weather Alerts β - Bonus feature implemented
- Clean, readable, maintainable code
- Proper separation of concerns
- SOLID principles applied
- Comprehensive error handling
- Professional logging
- Proper tool attributes
- Excellent descriptions
- Parameter validation
- Server configuration
- Clear setup instructions
- Usage examples
- Feature documentation
- Technical architecture overview
Built with β€οΈ for FastMCP.me - Making AI Weather Intelligence Accessible to Everyone!