mcp-weather-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-weather-serverWhat's the current weather in London?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Weather Server
A Model Context Protocol (MCP) server that provides weather information and forecasts using the OpenWeatherMap API.
Features
π€οΈ Get current weather conditions for any city
π Get 5-day weather forecasts
π‘οΈ Temperature, humidity, wind speed, and atmospheric pressure
βοΈ Weather descriptions and conditions
π Works with cities worldwide
Related MCP server: OpenWeatherMap MCP Server
Tools Available
get_weather
Get current weather conditions for a specified location.
Parameters:
location(required): City name (e.g., "London", "Jakarta", "New York")
Example: "What's the weather in Jakarta?"
get_weather_forecast
Get a 5-day weather forecast for a specified location.
Parameters:
location(required): City namedays(optional): Number of days to forecast (1-5, default: 5)
Example: "What's the 5-day forecast for London?"
Prerequisites
Python 3.7+
OpenWeatherMap API key (free tier available)
Claude Desktop application
Installation
Clone the repository:
git clone https://github.com/your-username/mcp-weather-server.git cd mcp-weather-serverCreate a virtual environment:
python -m venv .venv .venv\Scripts\activate # On Windows # or source .venv/bin/activate # On macOS/LinuxInstall dependencies:
pip install -r requirements.txtGet an API key:
Sign up at OpenWeatherMap
Get your free API key
Set up environment variables:
Copy
.env.exampleto.envAdd your API key to the
.envfile:OPENWEATHER_API_KEY=your_api_key_here
Configuration
Claude Desktop Setup
Locate your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the weather server configuration:
{ "mcpServers": { "weather": { "command": "path/to/your/project/.venv/Scripts/python.exe", "args": ["path/to/your/project/minimal_weather_server.py"], "env": { "OPENWEATHER_API_KEY": "your_api_key_here" } } } }Restart Claude Desktop
Testing
Test the server independently:
python test_minimal.pyOr test specific functionality:
python debug_server.pyUsage Examples
Once configured with Claude Desktop, you can ask natural language questions:
"What's the weather in Jakarta?"
"Get me the current weather for London"
"What's the 5-day forecast for Tokyo?"
"How's the weather in Singapore today?"
"Show me the weather forecast for Bandung"
Project Structure
mcp-weather-server/
βββ minimal_weather_server.py # Main MCP server
βββ simple_weather_server.py # Alternative simple server
βββ weather_server.py # Original MCP library version
βββ test_minimal.py # Test script
βββ debug_server.py # Debug utilities
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
βββ .env # Environment variables (not in git)
βββ .gitignore # Git ignore rules
βββ README.md # This fileAPI Reference
This server uses the OpenWeatherMap API to fetch weather data.
Troubleshooting
Common Issues
"API key not found" error:
Ensure your
.envfile containsOPENWEATHER_API_KEY=your_actual_keyVerify the API key is valid and active
"Server disconnected" in Claude:
Check that file paths in the config are correct
Ensure Python executable path is accurate
Restart Claude Desktop after config changes
"Location not found" error:
Try using different city name variations
Include country name for ambiguous cities (e.g., "London, UK")
Debug Steps
Test the server independently:
python test_minimal.pyCheck server logs in Claude Desktop
Verify API key permissions at OpenWeatherMap
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
OpenWeatherMap for providing the weather API
Anthropic for Claude and the MCP specification
MCP community for protocol documentation and examples
Support
If you encounter any issues or have questions:
Check the troubleshooting section
Review OpenWeatherMap API docs
Open an issue on GitHub
Made with β€οΈ for the MCP community
Available Tools
2 toolsget_weatherC
Get current weather for a location
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | City name (e.g., 'London', 'New York') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries full burden. It fails to disclose behavioral traits like authentication, rate limits, or whether it returns cached data. Only states basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence of 6 words, highly concise and front-loaded. However, lacks any structuring like bullet points or sections.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a simple tool with one parameter and no output schema. Could be improved by mentioning what data is returned (e.g., temperature, conditions).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear parameter description. The tool description adds no additional meaning beyond the schema, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Get current weather for a location', specifying the verb and resource. The sibling get_weather_forecast implies distinction, but the description does not explicitly differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus the sibling tool or any alternatives. No usage context or exclusions provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_weather_forecastC
Get 5-day weather forecast for a location
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to forecast (1-5) | |
| location | Yes | City name (e.g., 'London', 'New York') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description lacks behavioral details such as data freshness, authentication needs, or rate limits. Only states basic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is concise and front-loaded with the main action. However, it is terse and could include return value hints without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema, description does not explain what the forecast contains (e.g., temperature, precipitation). Schema handles input but output remains underspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already documents both parameters with descriptions (100% coverage). Description adds no extra meaning beyond the schema for the location parameter and days range.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Get 5-day weather forecast for a location', specifying verb and resource. However, it does not explicitly differentiate from sibling tool 'get_weather', leaving ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like sibling 'get_weather'. Missing context for deployment scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
get_weather - First observed
get_weather_forecast
TDQS
Scored across 2 tools
Both tools are clearly distinct: one provides current weather, the other provides a 5-day forecast. There is no overlap or ambiguity.
Both tools follow a consistent 'get_weather' prefix pattern, with a clear modifier for the forecast variant. Naming is uniform and predictable.
With only 2 tools, the server is minimal but covers the core functionality of a weather service. It is slightly on the thin side but reasonable for a focused server.
The server covers current weather and forecast, which are the most common needs, but lacks additional features like historical data or weather alerts. It is somewhat incomplete for a full weather API.
Maintenance
Related MCP Connectors
Free, keyless real-time weather and 7-day forecasts for any city worldwide.
OpenWeather MCP β wraps the OpenWeatherMap API (openweathermap.org)
Global weather API: forecasts, historical data, marine, ski, astronomy and timezone.
Provide real-time and forecast weather information for locations in the United States using naturaβ¦
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides current weather conditions and 5-day forecasts for any location using the OpenWeatherMap API. Supports flexible location queries including city names, coordinates, and zip codes.MIT
- AlicenseNot gradedqualityDmaintenanceProvides access to real-time weather data, 5-day forecasts, and air quality information for any city using the OpenWeatherMap API.MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying real-time weather and 5-day forecasts for any city using the OpenWeatherMap API.5 npm4MIT
- AlicenseBqualityDmaintenanceProvides current weather data for any location using the OpenWeatherMap API.1GPL 3.0