local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Enables secure storage and loading of the OpenWeatherMap API key through environment variables, keeping sensitive data out of the codebase.
Offers a comprehensive tutorial on setting up and using the Weather MCP Tool with Claude Desktop, published on the Medium platform.
Requires Python 3.10+ as the runtime environment for the MCP server that processes weather data requests.
Weather MCP Tool for Claude Desktop
An MCP (Model Context Protocol) tool that provides real-time weather data, forecasts, and historical weather information using the OpenWeatherMap API, specifically designed for Claude Desktop.
Tutorial
For a detailed guide on setting up and using this tool, check out our comprehensive Medium tutorial: Tutorial: Using Claude Desktop with Weather MCP Tool to Access Real-Time Weather Data Worldwide
Features
- Real-time weather conditions for any location
- Weather forecasts (up to 5 days)
- Historical weather data (last 5 days)
- Air quality information
- Weather alerts and warnings
- Location search functionality
Setup
- Ensure you have Python 3.10 or higher installed
- Install dependencies:
- Get an API key from OpenWeatherMap (free tier available)
- Note: New API keys may take up to 24 hours to activate
- Set up environment variables for API key (recommended method):
- Create a
.env
file in the project directory - Add your API key to the file:
Copy- Add
.env
to your.gitignore
file to prevent committing sensitive data
- Create a
- Update
main.py
to use the environment variable:Copy
Integration with Claude Desktop
- Configure your MCP settings in Claude Desktop by adding the following to your MCP configuration:
- Replace the path with the full path to your main.py file
- Run the server using:
- Keep the server running while using Claude Desktop
Available Tools
1. get_current_weather
Get real-time weather conditions for a location:
2. get_weather_forecast
Get weather forecast for a location:
3. get_air_quality
Get air quality data for a location:
4. get_historical_weather
Get historical weather data for a specific date:
5. search_location
Search for locations by name:
6. get_weather_alerts
Get weather alerts for a location:
Sample Queries
You can ask Claude Desktop questions like:
- "What's the current weather in New York?"
- "Show me the 5-day forecast for London"
- "What's the air quality like in Beijing today?"
- "How was the weather in Paris on March 14th?"
- "Search for locations named 'Tokyo'"
- "Are there any weather alerts for Miami?"
- "Compare the current weather in Chicago, Miami, and Seattle"
- "Show me a comparison of air quality in Beijing, Los Angeles, and Delhi"
Error Handling
All tools include proper error handling and will return an error message if something goes wrong:
Troubleshooting
If the MCP server is not working in Claude Desktop:
- Make sure the server is running - you should see output when you start the script
- Verify the path in your settings is correct and absolute
- Make sure Python 3.10+ is in your system PATH
- Check that all dependencies are installed
- Try restarting Claude Desktop
- Check logs for any error messages
Common API Issues
- API Key Activation: New OpenWeatherMap API keys may take up to 24 hours to activate
- Invalid API Key Error: If you get a 401 error, verify your API key is correct and active
- Rate Limiting: Free tier allows up to 60 calls per minute, which might be exceeded during heavy usage
Rate Limits
This tool uses the OpenWeatherMap API which has rate limits. The free tier allows up to 60 calls per minute, which should be sufficient for personal use. Please be aware that very frequent requests may be throttled by the API.
License
MIT License
This server cannot be installed
Provides real-time weather data, forecasts, and historical weather information from OpenWeatherMap API for Claude Desktop, enabling natural language queries about current conditions, forecasts, air quality, and weather alerts worldwide.