Weather MCP Server
Click on "Install 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., "@Weather MCP ServerWhat's the current weather in San Francisco?"
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.
๐ฆ๏ธ 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!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA 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.Last updated
- Flicense-qualityDmaintenanceA 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.Last updated
- Flicense-qualityDmaintenanceA 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.Last updated19
- FlicenseAqualityCmaintenanceA production-grade MCP server that provides real-time weather data and demonstrates the complete MCP protocol surface including tools, resources, prompts, and structured output.Last updated22
Related MCP Connectors
OpenWeather MCP โ wraps the OpenWeatherMap API (openweathermap.org)
Open-Meteo MCP โ weather forecast + historical reanalysis + sister APIs
350+ production-ready APIs through one MCP server โ weather, geocoding, validation, financial data.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PrasadMankar1309/Weather-MCP-Tool-for-the-Claude-Integration'
If you have feedback or need assistance with the MCP directory API, please join our Discord server