Weather MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π¦οΈ Weather MCP Server for Claude Integration
A production-ready Model Context Protocol (MCP) server built using the official Python MCP SDK that provides real-time weather information, forecasts, air quality, and weather alerts through the OpenWeatherMap API.
π Overview
This project demonstrates how to build a local MCP Server using the official Python MCP SDK. The server exposes multiple weather-related tools that can be consumed by any MCP-compatible client such as Claude Code, MCP Inspector, or other MCP hosts.
The server communicates with the OpenWeatherMap API and returns structured weather information through the MCP protocol.
β¨ Features
π€οΈ Current Weather
π 5-Day Weather Forecast
πͺοΈ Weather Alerts
π«οΈ Air Quality Index
π MCP Resources
π¬ MCP Prompt Templates
π Structured Logging
β οΈ Robust Error Handling
π Standard I/O (STDIO) Transport
ποΈ Clean Layered Architecture
ποΈ Architecture
User
β
βΌ
Claude Desktop
Claude Code
MCP Inspector
β
βΌ
MCP Protocol (STDIO)
β
βΌ
Weather MCP Server
β
ββββββββββββββββΌβββββββββββββββ
βΌ βΌ βΌ
Tools Resources Prompts
β
βΌ
OpenWeatherMap REST API
β
βΌ
Weather Informationπ Project Structure
weather-mcp/
β
βββ server.py
βββ config.py
βββ requirements.txt
βββ README.md
βββ .env.example
β
βββ models/
β βββ weather_model.py
β βββ forecast_model.py
β
βββ services/
β βββ parser.py
β βββ weather_api.py
β
βββ tools/
β βββ current_weather.py
β βββ forecast.py
β βββ alerts.py
β βββ air_quality.py
β
βββ prompts/
β βββ README.md
β
βββ resources/
β βββ README.md
β
βββ tests/
β βββ test_weather_parsing.py
β
βββ utils/
βββ logger.py
βββ helpers.py
βββ exceptions.pyβοΈ Installation
Clone the repository
git clone https://github.com/PrasadMankar1309/Weather-MCP-Tool-for-the-Claude-Integration.git
cd Weather-MCP-Tool-for-the-Claude-IntegrationCreate a virtual environment
python -m venv .venvActivate it
Windows
.venv\Scripts\activateLinux / macOS
source .venv/bin/activateInstall dependencies
pip install -r requirements.txtπ Configuration
Create a .env file in the project root.
OPENWEATHER_API_KEY=your_api_key_here
OPENWEATHER_BASE_URL=https://api.openweathermap.org/data/2.5
REQUEST_TIMEOUT_SECONDS=10
LOG_LEVEL=INFOYou can obtain a free API key from:
https://openweathermap.org/api
βΆοΈ Running the MCP Server
python server.pyThe server communicates using the STDIO transport and is intended to be launched by an MCP-compatible client.
π Claude Desktop Integration
Example configuration:
{
"mcpServers": {
"weather": {
"command": "python",
"args": [
"C:/path/to/server.py"
]
}
}
}Restart Claude Desktop after updating the configuration.
π Testing with MCP Inspector
Launch the MCP Inspector:
npx @modelcontextprotocol/inspectorAdd a new STDIO server:
Command
pythonArgument
server.pyIf configured correctly, the Inspector will display:
Tools
Resources
Prompts
π οΈ Available MCP Tools
Tool | Description |
Current Weather | Retrieves current weather for a city |
Forecast | Retrieves weather forecast |
Weather Alerts | Displays active weather alerts |
Air Quality | Retrieves AQI information |
π MCP Resources
Resource | Description |
weather://supported-cities | Supported cities |
weather://api-docs | API information |
weather://prompt-examples | Example prompts |
π¬ MCP Prompt Templates
Travel Weather Report
Farmer Weather Report
Weather Summary
π‘ Example Prompts
What's the weather in Pune?Forecast for MumbaiWeather alerts in DelhiAir quality in Londonπ MCP Workflow
User Prompt
β
βΌ
Claude Desktop / Claude Code
β
βΌ
MCP Client
β
βΌ
Weather MCP Server
β
βΌ
OpenWeatherMap API
β
βΌ
JSON Response
β
βΌ
Claude Responseβ οΈ Error Handling
The server gracefully handles:
Invalid city names
Missing API keys
Network failures
Request timeouts
API errors
π Future Improvements
Hourly Forecast
Weather Maps
Geolocation Support
Historical Weather
Severe Weather Notifications
Multi-language Support
Docker Deployment
Streamable HTTP Transport
π§ͺ Technologies Used
Python 3.10
Model Context Protocol (MCP)
Official Python MCP SDK
OpenWeatherMap API
Dataclasses
Logging
dotenv
π€ Contributing
Contributions are welcome!
Fork the repository
Create a feature branch
Commit your changes
Open a Pull Request
π License
This project is licensed under the MIT License.
π¨βπ» Author
Prasad Mankar
β If you found this project useful, consider giving it a star!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
MCP server for weather with reasoning β umbrella advice, outdoor checks, city comparisons.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants and LLMs to access real-time weather data and forecasts by connecting to the OpenWeatherMap API.-
- FlicenseNot gradedqualityDmaintenanceA Docker-based MCP server that provides current weather information for cities worldwide. Enables AI assistants like Claude to fetch temperature, weather conditions, and humidity data through a standardized interface.-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server built with the mcp-framework to provide weather-related tools and data to AI clients. It enables integration of weather capabilities and custom tools into the MCP ecosystem for use with platforms like Claude Desktop.-
- AlicenseAqualityDmaintenanceA production-grade MCP server that provides real-time weather data and demonstrates the complete MCP protocol surface including tools, resources, prompts, and structured output.22MIT