Tutorial: Using Claude Desktop with Weather MCP Tool to Access Real-Time Weather Data Worldwide
In today’s rapidly changing climate, having access to accurate and up-to-date weather information is more important than ever. Whether…
Tutorial: Using Claude Desktop with Weather MCP Tool to Access Real-Time Weather Data Worldwide
In today’s rapidly changing climate, having access to accurate and up-to-date weather information is more important than ever. Whether you’re planning a trip, preparing for outdoor activities, or monitoring air quality in your area, reliable weather data is essential for making informed decisions.
In this comprehensive tutorial, I’ll show you how to transform Claude Desktop into your personal weather assistant using the Weather MCP Tool. This integration allows Claude to access real-time weather conditions, forecasts, historical data, air quality information, and severe weather alerts from anywhere in the world through the OpenWeatherMap API.

By the end of this tutorial, you’ll be able to have natural conversations with Claude about weather conditions globally, compare weather across cities, analyze air quality metrics, and much more — all with the most current data available rather than Claude’s training data, which may be outdated.
What is Model Context Protocol (MCP)?
Before diving into the specifics of the Weather MCP Tool, it’s important to understand what MCP is and why it represents a significant advancement for AI assistants like Claude.
Model Context Protocol (MCP) is a system developed by Anthropic that enables large language models like Claude to connect with external tools and data sources. Unlike traditional AI conversations where the assistant can only work with information included in its training data or provided directly in the conversation, MCP allows Claude to:
- Make API calls to external services in real-time
- Process and analyze live data
- Present that information in a conversational, natural way
For weather data, this means Claude can check the current temperature in Tokyo, analyze air quality trends in Beijing, or tell you if it will rain tomorrow in London — all with up-to-date information rather than potentially outdated training data.
What is the Weather MCP Tool?
The Weather MCP Tool is a custom extension for Claude Desktop that connects Claude to global weather data via the OpenWeatherMap API. It enables Claude to access up-to-date information about weather conditions worldwide, including:
- Real-time weather conditions with temperature, humidity, wind, etc.
- Weather forecasts for up to 5 days
- Historical weather data for the past 5 days
- Air quality information and pollution levels
- Weather alerts and warnings
- Location search functionality
Why Use the Weather MCP Tool?
- Seamless workflow: Access weather data without switching between applications
- Informed decisions: Get comprehensive weather information directly in your Claude conversations
- Time efficiency: Eliminate the need to manually search for weather data online
- Custom analysis: Ask Claude to analyze trends or compare weather in different locations
- Context-aware insights: Claude can combine weather data with its knowledge to provide deeper analysis
- Natural interaction: Ask about weather in natural language instead of navigating complex weather apps
Prerequisites
Before you begin, make sure you have:
- Claude Desktop installed on your computer
- Python 3.10 or higher installed (Download Python)
- Basic familiarity with running Python scripts and terminal/command prompt
- An OpenWeatherMap API key (free tier available)
Setting Up the Weather MCP Tool
Follow these steps to get the Weather MCP Tool up and running with Claude Desktop:
Step 1: Clone or Download the Repository
Clone the repository from GitHub or download the ZIP file and extract it to a location on your computer.
git clone https://github.com/SaintDoresh/Weather-MCP-ClaudeDesktop.git
Step 2: Install Dependencies
Open a terminal or command prompt, navigate to the project directory, and install the required dependencies:
cd Weather-MCP-ClaudeDesktop
pip install -r requirements.txt
This will install:
- mcp (≥1.3.0): The Model Context Protocol library
- requests (≥2.28.0): HTTP library for API calls
- python-dateutil (≥2.8.2): Extensions to the standard datetime module
You should see output similar to this:
Collecting mcp>=1.3.0
Downloading mcp-1.4.1-py3-none-any.whl (32 kB)
Collecting requests>=2.28.0
Downloading requests-2.32.3-py3-none-any.whl (63 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.6/63.6 kB 1.2 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.2
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (225 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.0/225.0 kB 2.8 MB/s eta 0:00:00
...
Successfully installed mcp-1.4.1 python-dateutil-2.9.0.post0 requests-2.32.3 ...
Step 3: Get an OpenWeatherMap API Key
- Go to OpenWeatherMap and create a free account
- Navigate to your API keys section in your account dashboard
- Generate a new API key
Important Note: New API keys may take up to 24 hours to become fully active. If you encounter “Invalid API key” errors initially, wait for the activation period to complete.
Step 4: Set Up Environment Variables for API Key
For security best practices, we’ll use environment variables to store the API key:
- Create a file named
.envin the project directory - Add your API key to the file:
OPENWEATHER_API_KEY=your_api_key_here
- Add
.envto your.gitignorefile to prevent accidentally committing your API key:
# .gitignore
.env
Step 5: Configure Claude Desktop
Now it’s time to connect the Weather MCP Tool to Claude Desktop:
- Open Claude Desktop
- Click on the settings icon (gear) in the bottom left corner
- Navigate to the “Model Context Protocol” section
- Add a new MCP configuration with the following details:
{
"mcpServers": {
"weather-mcp": {
"command": "py",
"args": ["-3.13", "C:\\Path\\To\\Your\\Weather-MCP-ClaudeDesktop\\main.py"]
}
}
}
Note: Replace C:\\Path\\To\\Your\\Weather-MCP-ClaudeDesktop\\main.py with the actual path to the main.py file on your system. Make sure to use double backslashes (\) for Windows paths in the JSON.
Step 6: Start the MCP Server
There are two ways to start the server:
Option 1: Start manually from terminal/command prompt:
py -3.13 main.py
Option 2: Create a batch file (Windows) for easy starting:
Create a file named start-weather-mcp.bat with the following content:
@echo off
py -3.13 main.py
pause
Then you can start the server by double-clicking this batch file.
You should see output indicating that the server has started successfully:
INFO:root:OpenWeather API key loaded successfully
INFO: Started server process [12345]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000
Keep this terminal window open while using Claude Desktop.
Using the Weather MCP Tool with Claude
Now that you’ve set up the Weather MCP Tool, you can start asking Claude about weather data. Here are some examples of how to interact with the tool:
1. Getting Current Weather Conditions
You can ask Claude for the current weather in any location:
Try asking:
“What’s the current weather in New York?”
Claude will use the get_current_weather tool to fetch the latest weather information:
New York, US - Current Weather:
Temperature: 7.7°C (46°F), feels like 4.9°C (41°F)
Conditions: Misty
Humidity: 93%
Wind: 4.6 m/s (10.3 mph) from the southeast
Visibility: 9.7 km (6 miles)
Sunrise: 7:07 AM, Sunset: 7:02 PM
You can ask about any city worldwide, and Claude will provide comprehensive current conditions.
2. Weather Forecasts
Get forecasts for the coming days:
“Show me the 3-day forecast for London”
Claude will use the get_weather_forecast tool to provide detailed forecast information:
London 3-Day Forecast:
Day 1 (Today):
Morning: 1.4°C (34°F), Clear sky, 0% chance of precipitation
Afternoon: 3.8°C (39°F), Partly cloudy, 0% chance of precipitation
Evening: -0.2°C (32°F), Clear, 0% chance of precipitation
Day 2:
Morning: 0.5°C (33°F), Cloudy, 10% chance of precipitation
Afternoon: 4.2°C (40°F), Cloudy, 20% chance of precipitation
Evening: 1.8°C (35°F), Light rain, 40% chance of precipitation
Day 3:
Morning: 2.3°C (36°F), Light rain, 50% chance of precipitation
Afternoon: 5.1°C (41°F), Rain, 70% chance of precipitation
Evening: 3.4°C (38°F), Rain, 80% chance of precipitation
3. Air Quality Information
Get detailed air quality metrics:
“What’s the air quality like in Beijing today?”
Claude will use the get_air_quality tool to provide air quality data:
Beijing Air Quality Report:
Air Quality Index (AQI): 3 (Moderate)
Air Quality Level: Moderate
Pollutant Levels:
- PM2.5: 30.62 μg/m³ (Fine particles)
- PM10: 47.62 μg/m³ (Coarse particles)
- O3 (Ozone): 60.08 μg/m³
- NO2 (Nitrogen dioxide): 47.30 μg/m³
- SO2 (Sulfur dioxide): 47.68 μg/m³
- CO (Carbon monoxide): 667.57 μg/m³
Health Recommendations:
- Air quality is acceptable but may cause mild irritation for sensitive individuals
- Consider reducing prolonged outdoor exertion if you have respiratory conditions
4. Historical Weather Data
Look up weather data from the past 5 days:
“How was the weather in Paris on March 14th?”
Claude will use the get_historical_weather tool to retrieve past weather data:
Paris Weather on March 14, 2025:
Temperature: 20.3°C (68.5°F), felt like 19.8°C (67.6°F)
Conditions: Partly cloudy (Scattered clouds)
Cloud Cover: 45%
Humidity: 60%
Wind: 2.8 m/s (6.3 mph) from the southeast
Pressure: 1012 hPa
Sunrise: 06:30 AM
Sunset: 6:15 PM
5. Location Search
If you’re unsure about exact location names:
“Search for cities named Springfield”
Claude will use the search_location tool to find matching locations:
Found 5 locations named "Springfield":
1. Springfield, IL (United States)
Coordinates: 39.7817° N, 89.6501° W
2. Springfield, MO (United States)
Coordinates: 37.2090° N, 93.2923° W
3. Springfield, MA (United States)
Coordinates: 42.1015° N, 72.5898° W
4. Springfield, OH (United States)
Coordinates: 39.9242° N, 83.8088° W
5. Springfield, OR (United States)
Coordinates: 44.0462° N, 123.0220° W
6. Weather Alerts
Check for severe weather warnings:
“Are there any weather alerts for Miami right now?”
Claude will use the get_weather_alerts tool to check for active alerts:
Weather Alerts for Miami, FL:
1 active alert found:
Heat Advisory
Issued by: National Weather Service Miami
Timing: In effect from 12:00 PM until 8:00 PM today
Details: Heat index values between 105°F and 110°F (40.6°C and 43.3°C) expected
Recommendations:
- Drink plenty of fluids
- Stay in air-conditioned rooms when possible
- Stay out of the sun during peak hours (12 PM - 4 PM)
- Check on relatives and neighbors, especially elderly individuals
Advanced Use Cases
Comparative Analysis
Ask Claude to compare weather conditions across multiple locations:
“Compare the current weather in Tokyo, New York, and Paris”
Claude will gather data from multiple locations and present a comparative analysis:
Weather Comparison: Tokyo, New York, and Paris
Temperature:
- Tokyo: 5.4°C (42°F), feels like 0.1°C (32°F)
- New York: 7.7°C (46°F), feels like 4.9°C (41°F)
- Paris: 12.8°C (55°F), feels like 11.3°C (52°F)
Conditions:
- Tokyo: Moderate rain
- New York: Misty
- Paris: Partly cloudy
Humidity:
- Tokyo: 90%
- New York: 93%
- Paris: 68%
Wind:
- Tokyo: 10.3 m/s (23 mph), strong northerly winds
- New York: 4.6 m/s (10 mph), from southeast
- Paris: 3.1 m/s (7 mph), from southwest
Summary: Paris currently has the most pleasant weather with the warmest temperatures and partly cloudy skies. New York is experiencing misty conditions with high humidity, while Tokyo is dealing with moderate rain and strong winds.
Air Quality Comparison
Compare air quality between cities known for pollution issues:
“Show me a comparison of air quality in Beijing, Los Angeles, and Delhi”
Claude will collect and analyze air quality data from multiple locations:
Air Quality Comparison: Beijing, Los Angeles, and Delhi
Air Quality Index (AQI):
- Beijing: 3 (Moderate)
- Los Angeles: 2 (Fair)
- Delhi: 3 (Moderate)
PM2.5 (Fine particles) - μg/m³:
- Beijing: 30.62
- Los Angeles: 6.48
- Delhi: 32.70
PM10 (Coarse particles) - μg/m³:
- Beijing: 47.62
- Los Angeles: 10.37
- Delhi: 50.68
Ozone (O3) - μg/m³:
- Beijing: 60.08
- Los Angeles: 97.28
- Delhi: 32.19
Key takeaway: Los Angeles currently has the best overall air quality with significantly lower particulate matter, though its ozone levels are elevated. Beijing and Delhi have similar moderate air quality with comparable particulate matter levels.
Travel Planning
Use Claude to help with weather-based travel planning:
“I’m planning a trip to Italy next week. Which cities will have the best weather for sightseeing?”
Claude can analyze forecasts for multiple cities to provide recommendations:
Based on next week's forecast:
Rome:
- Average high: 22°C (72°F)
- Precipitation: 10% chance, mostly sunny
- Wind: Light breeze, 2-3 m/s
Florence:
- Average high: 20°C (68°F)
- Precipitation: 20% chance, partly cloudy
- Wind: Light breeze, 2-4 m/s
Venice:
- Average high: 18°C (64°F)
- Precipitation: 40% chance, occasional showers
- Wind: Moderate, 4-6 m/s
Naples:
- Average high: 23°C (73°F)
- Precipitation: 5% chance, sunny
- Wind: Light breeze, 2-3 m/s
Recommendation: Naples and Rome look to have the most favorable weather for sightseeing next week, with warm temperatures and minimal chance of rain. Florence is a good backup, while Venice might have some showers that could affect outdoor activities.
Historical Weather Analysis
Analyze weather patterns over time:
“How does today’s temperature in Chicago compare to historical averages for mid-March?”
Claude can combine current data with its knowledge of historical patterns:
Chicago's current temperature is 3.2°C (38°F).
Historical context for mid-March in Chicago:
- Average high: 7.8°C (46°F)
- Average low: -0.6°C (31°F)
- Record high: 29.4°C (85°F) set on March 15, 2012
- Record low: -20°C (-4°F) set on March 14, 1997
Today's temperature is about 4.6°C (8°F) below the historical average high for this time of year, suggesting cooler than normal conditions for mid-March in Chicago.
Troubleshooting
If you encounter issues with the Weather MCP Tool, try these solutions:
Tool Not Responding
- Ensure the MCP server is running (the terminal window should show activity)
- Verify the path in your Claude Desktop settings is correct and absolute
- Make sure Python 3.10+ is properly installed and in your system PATH
- Check that all dependencies are installed correctly
- Restart Claude Desktop and the MCP server
“Invalid API Key” Error
- Verify you’ve correctly added your API key to the
.envfile - Remember that new API keys may take up to 24 hours to activate
- Check if you’ve reached the API’s rate limits (free tier allows 60 calls/minute)
- Try generating a new API key if the issue persists
“Location Not Found” Errors
- Check for spelling errors in the location name
- Try adding the country code (e.g., “London, UK” instead of just “London”)
- Use the search_location tool to find the correct location name
- For smaller cities, try a nearby major city instead
Data Accuracy Issues
The OpenWeatherMap API occasionally has delays or inconsistencies:
- Be aware that data might be delayed by a few minutes for some regions
- For critical weather-related decisions, verify with official sources
- If data seems incorrect, try refreshing by asking for the same information again
Use Cases for Different User Types
For Casual Users
- Check daily weather before leaving home
- Plan weekend activities based on forecasts
- Monitor air quality if you have respiratory conditions
- Check for weather alerts during severe weather seasons
- Plan your wardrobe based on forecasted conditions
For Travelers
- Get weather forecasts for destination cities
- Compare weather across multiple potential destinations
- Check historical weather patterns to pack appropriately
- Monitor potential travel disruptions due to weather alerts
- Track air quality for destinations with known pollution issues
For Outdoor Enthusiasts
- Get detailed wind, humidity, and visibility information
- Check for conditions appropriate for specific activities (hiking, cycling, etc.)
- Monitor changing weather patterns throughout the day
- Get sunrise and sunset times for planning activities
- Check for potentially dangerous weather conditions
For Education and Research
- Compare weather patterns across different regions
- Analyze air quality components and their health implications
- Study historical weather data for pattern recognition
- Observe how weather systems move across regions
- Examine the relationship between climate factors
Current Weather Context (March 2025)
As we move into spring 2025 in the Northern Hemisphere, many regions are experiencing transitional weather patterns. The Weather MCP Tool can help track these changing conditions, which are particularly important during seasonal transitions when weather can be unpredictable.
Key climate patterns in March 2025 that the Weather MCP can help you monitor include:
- Early spring storms: Several regions in North America are experiencing intense storm systems with rapid temperature fluctuations
- Rising temperatures: Europe is seeing higher-than-average temperatures for March, with some regions reporting 3–5°C above historical averages
- Drought conditions: Parts of the western United States and southern Europe continue to face significant drought conditions
- Air quality concerns: Seasonal agricultural burning in Southeast Asia is causing increased particulate matter, which the air quality monitoring feature can track
- Severe weather events: The frequency of severe thunderstorms has increased in the central United States, making the weather alerts functionality particularly valuable
The ability to access real-time weather data during this transitional season helps ensure safety and proper planning, especially as climate change continues to alter traditional weather patterns.
Understanding OpenWeatherMap API Limits
The Weather MCP Tool utilizes the OpenWeatherMap API, which comes with certain limits depending on your subscription tier.
The free tier should be sufficient for personal use with the Weather MCP Tool. If you’re experiencing “too many requests” errors, you may need to wait a minute before making additional queries.
Case Study: Weather Planning for an Outdoor Event
To demonstrate the practical application of the Weather MCP Tool, here’s how it could be used for planning an outdoor event:
User query: “I’m planning an outdoor wedding in Central Park, New York on April 20th. Can you help me understand what weather to expect and if I should consider a backup plan?”
Claude can use multiple weather tools to provide a comprehensive analysis:
- Historical analysis: Claude examines past weather data for April 20th in New York over recent years
- Current forecast: Claude checks the 5-day forecast extending toward that date if within range
- Typical conditions: Claude combines its knowledge with real-time data for a complete picture
Response excerpt:
Based on historical data for April 20th in New York:
- Average high: 17°C (63°F)
- Average low: 7°C (45°F)
- Precipitation chance: 30%
- Past conditions have ranged from sunny and pleasant to occasional spring showers
For outdoor wedding planning:
1. Consider a backup indoor location or tent with sides that can be deployed
2. Schedule the most important moments (ceremony) during the statistical driest part of the day (typically late morning)
3. Monitor the forecast starting 10 days out, with increasing reliability 5 days before
4. The shoulder seasons in New York can be unpredictable - temperature swings of 10°C can occur within 24 hours
This comprehensive analysis helps the user make informed decisions for their important event.
Conclusion
The Weather MCP Tool transforms Claude Desktop into a powerful weather assistant, giving you instant access to global weather data without leaving your conversations. This integration streamlines how you obtain and analyze weather information, helping you make more informed decisions about daily activities, travel plans, and safety precautions.
As weather patterns become increasingly variable and unpredictable due to climate change, having access to real-time, location-specific weather data becomes even more valuable. Whether you’re checking today’s forecast, monitoring air quality, comparing conditions across cities, or analyzing historical weather patterns, this tool puts critical environmental information at your fingertips.
What makes the Weather MCP Tool particularly powerful is Claude’s ability to not just retrieve the data, but to interpret it in context, compare it meaningfully, and present it in a way that’s immediately useful for your specific needs. It bridges the gap between raw weather data and actionable insights.
By following this tutorial, you’ve enhanced Claude’s capabilities to make it an even more versatile assistant for daily life. The Weather MCP Tool is just one example of how Model Context Protocol is expanding the frontiers of what AI assistants can do by connecting them to real-time data sources and specialized tools.
Note: This tutorial assumes basic familiarity with command line operations and Python environments. The Weather MCP Tool is an open-source project and not affiliated with Anthropic or OpenWeatherMap.
메타데이터
- post_id
- a0b811fc5cdf
- slug
- tutorial-using-claude-desktop-with-weather-mcp-tool-to-access-real-time-weather-data-worldwide-a0b811fc5cdf
- url
- https://medium.com/@saintdoresh/tutorial-using-claude-desktop-with-weather-mcp-tool-to-access-real-time-weather-data-worldwide-a0b811fc5cdf
- canonical_url
- https://medium.com/@saintdoresh/tutorial-using-claude-desktop-with-weather-mcp-tool-to-access-real-time-weather-data-worldwide-a0b811fc5cdf
- author_url
- https://medium.com/@saintdoresh
- status
- ok
- fetched_at
- 2026-07-24 16:06:45