Supports containerized deployment of the WeatherMCP server through Docker, including instructions for building images and running containers with environment variables.
Enables configuration of the WeatherMCP server through .env files, allowing users to set API keys and other configuration options.
Provides a Python-based MCP server implementation with instructions for installation and execution using Python libraries.
🌤️ WeatherMCP - Professional Weather MCP Server
A production-ready Model Context Protocol (MCP) server for weather data using OpenWeatherMap API.
✨ Features
- Current Weather: Get weather by city name or coordinates
- Temperature Units: Support for Celsius, Fahrenheit, and Kelvin
- Weather Summaries: Concise summaries with motivational messages
- API Status: Built-in connectivity testing and troubleshooting
- Error Handling: Comprehensive error handling with helpful messages
- STDIO Transport: Compatible with Smithery and other MCP clients
- Docker Support: Containerized deployment ready
🚀 Quick Start
1. Get OpenWeatherMap API Key
- Visit OpenWeatherMap API
- Sign up for a free account
- Get your API key from the dashboard
- Wait up to 10 minutes for activation
2. Configure API Key
Option A: Use .env file (Recommended)
Create a .env
file in the project directory:
Option B: Set Environment Variable
Windows (Command Prompt):
Windows (PowerShell):
Mac/Linux (Terminal):
3. Install Dependencies
4. Run the Server
🛠️ Configuration Options
Environment Variable | Description | Default |
---|---|---|
OPENWEATHER_API_KEY | OpenWeatherMap API key (required) | None |
DEFAULT_UNITS | Default temperature units | celsius |
WEATHER_API_TIMEOUT | API timeout in seconds | 10 |
📡 Available Tools
1. get_current_weather
Get current weather for a city.
Parameters:
city
(string, required): City namecountry_code
(string, optional): ISO 3166 country code (e.g., 'GB', 'US')units
(string, optional): Temperature units - celsius, fahrenheit, or kelvin
Example:
2. get_weather_by_coordinates
Get current weather by geographic coordinates.
Parameters:
latitude
(float, required): Latitude (-90 to 90)longitude
(float, required): Longitude (-180 to 180)units
(string, optional): Temperature units
Example:
3. get_weather_summary
Get a concise weather summary with motivational message.
Parameters:
city
(string, required): City name
Example:
4. check_api_status
Check OpenWeatherMap API connectivity and configuration.
Parameters: None
📚 Available Resources
config://weather-api
Returns API configuration, supported features, and setup instructions.
data://supported-cities
Returns list of popular cities for testing with usage examples.
🐳 Docker Deployment
Build Image
Run Container
🔧 Troubleshooting
Common Issues
"Module not found" error:
"API key not set" error:
"Failed to connect" error:
API Status Codes
200
: Success401
: Invalid API key404
: City not found429
: Rate limit exceeded500
: Server error
Rate Limits
- Free Tier: 60 calls/minute, 1,000,000 calls/month
- Paid Tiers: Higher limits available
📋 Testing
Use the built-in check_api_status
tool to verify your setup:
🌍 Supported Cities
The server supports all major cities worldwide. For best results:
- Include country code for accuracy
- Use English city names
- Check spelling if city not found
- Use ISO 3166-1 alpha-2 country codes (GB, US, JP, etc.)
📄 License
This project is open source and available under the MIT License.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📞 Support
For issues and questions:
- Check the troubleshooting section
- Use the
check_api_status
tool - Verify your API key is active
- Check OpenWeatherMap service status "# mcp"
This server cannot be installed
A production-ready Model Context Protocol server that provides weather data from OpenWeatherMap API, allowing users to query current weather by city name or coordinates with support for different temperature units.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.Last updated -4PythonApache 2.0
Juhe Weather MCP Serverofficial
-security-license-qualityProvides a Model Context Protocol server that enables large language models to query and retrieve real-time weather forecasts for cities and regions across China.Last updated -Python- AsecurityFlicenseAqualityA Model Context Protocol server that provides comprehensive weather data querying capabilities based on the Caiyun Weather API, supporting real-time weather, forecasts, and alerts with multi-language support.Last updated -72TypeScript
- -security-license-qualityA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.Last updated -Python