AI Weather MCP Server
Combines real-time weather data with LLM-powered reasoning to deliver intelligent weather insights like clothing recommendations and travel advice.
README
๐ฆ๏ธ AI Weather MCP Server
<p align="center">
</p>
A production-grade Model Context Protocol (MCP) server that combines real-time weather data with LLM-powered reasoning to deliver intelligent weather insights instead of raw numbers.
Built to demonstrate production backend engineering, clean architecture, MCP development, external API integration, asynchronous programming, Dockerization, testing, and AI reasoning.
โจ Features
๐ค Weather Tools
- Current Weather
- Weather Forecast
- Air Quality
- UV Index
- Sunrise & Sunset
๐ค AI Tools
- Clothing Recommendation
- Weather Summary
- Travel Advice
- Outdoor Activity Recommendation
- AI Weather Advisory
The guiding principle is:
Weather APIs provide facts. The LLM provides reasoning.
The model never invents weather information.
๐ Architecture
MCP Client
โ
โผ
MCP Tools
โ
โผ
Services
โ
โผ
Clients
โโโ Weather APIs
โโโ LLM Provider
Each layer has a single responsibility.
๐ Project Structure
src/weather_mcp/
โโโ server.py
โโโ config.py
โโโ logging_config.py
โโโ exceptions.py
โโโ models/
โโโ clients/
โโโ services/
โโโ tools/
๐ง Design Decisions
Two Weather Providers
The project combines OpenWeatherMap with Open-Meteo.
OpenWeatherMap supplies current weather, forecast and air-quality data.
Open-Meteo is used for UV Index because it remains free without requiring a paid One Call subscription.
AI Weather Advisory
get_weather_alerts() intentionally produces an AI-generated advisory.
It is not an official government weather warning.
Instead, the LLM reasons over forecast information to identify potentially concerning conditions such as:
- Heavy rain
- Strong winds
- High temperatures
- Thunderstorms
Swappable LLM
The LLM layer is isolated.
Changing from Groq to OpenAI only requires configuration rather than application changes.
โ๏ธ Installation
git clone <repository-url>
cd weather-mcp-server
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
๐ Configuration
Copy:
cp .env.example .env
Configure your API keys.
| Variable | Description |
|---|---|
| WEATHER_API_KEY | OpenWeatherMap key |
| LLM_API_KEY | Groq/OpenAI key |
| LLM_PROVIDER | groq/openai |
| LLM_MODEL | Model name |
โถ Running
python3 -m weather_mcp.server
๐ณ Docker
docker build -t weather-mcp-server .
docker run -i --env-file .env weather-mcp-server
Pull the pre-built image directly:
```bash docker pull amankhan1009/weather-mcp-server:latest docker run -i --env-file .env amankhan1009/weather-mcp-server:latest ```
Or build it yourself:
```bash docker build -t weather-mcp-server . docker run -i --env-file .env weather-mcp-server ```
๐งช Testing
pytest
The suite uses mocked external services for deterministic tests.
๐ MCP Clients
Compatible with:
- Claude Desktop
- MCP Inspector
- Any MCP-compatible client
๐ Future Improvements
- Official severe weather alerts
- Additional LLM providers
- Response caching
- Streaming responses
- Structured JSON outputs
๐จโ๐ป Author
Md Aman Alam
LinkedIn: Md Aman Alam
If you found this project useful, consider giving it a โญ on GitHub.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.