Omarigato/WeatherMcpServer
If you are the rightful owner of WeatherMcpServer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Model Context Protocol (MCP) server is a framework for creating and managing protocol servers using C# and publishing them as NuGet packages.
Real Weather MCP Server 🌤️
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.
🌟 Features
Core Weather Functionality ✅
- 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
Advanced Features 🚀
- 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
🛠️ Setup Instructions
Prerequisites
- .NET 8.0 or later
- OpenWeatherMap API key (free at openweathermap.org)
Environment Setup
-
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
🎯 Available Tools
Basic Weather Tools
GetCurrentWeather- Current conditions for any cityGetWeatherByCoordinates- Weather data by lat/lngGetWeatherForecast- Multi-day weather forecasts
Advanced Tools
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
📖 Usage Examples
Basic Weather Query
Get current weather for Tokyo
Advanced Queries
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
🏗️ Project Structure
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
🧪 Testing Checklist
Core Requirements ✅
- Real Weather Data (OpenWeatherMap API)
- Current Weather by city
- Weather Forecast (up to 5 days)
- Multiple Locations support
- Error Handling
- Weather Alerts (bonus feature)
Advanced Features ✅
- Air Quality monitoring
- Historical weather data
- Multi-city comparisons
- Activity-based recommendations
- Comprehensive weather summaries
- JSON data export
- Coordinate-based queries
🎨 Cool Features That Make People Say "Wow!"
-
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
🚀 Performance Features
- Async/Await - Non-blocking operations
- HTTP Client Pooling - Efficient API calls
- Error Resilience - Graceful failure handling
- Logging - Comprehensive error tracking
- Clean Architecture - Separated concerns
📊 Technical Excellence
- 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
🌟 What Makes This Special
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
📝 Assignment Completion
Requirements Met ✅
- 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
Code Quality ✅
- Clean, readable, maintainable code
- Proper separation of concerns
- SOLID principles applied
- Comprehensive error handling
- Professional logging
MCP Integration ✅
- Proper tool attributes
- Excellent descriptions
- Parameter validation
- Server configuration
Documentation ✅
- Clear setup instructions
- Usage examples
- Feature documentation
- Technical architecture overview
Built with ❤️ for FastMCP.me - Making AI Weather Intelligence Accessible to Everyone!