AI Weather MCP Server

AI Weather MCP Server

Combines real-time weather data with LLM-powered reasoning to deliver intelligent weather insights like clothing recommendations and travel advice.

Category
Visit Server

README

๐ŸŒฆ๏ธ AI Weather MCP Server

<p align="center">

Python MCP FastMCP Docker Tests License

</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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured