Skip to main content
Glama
IntuzAnshP

Weather MCP Server

by IntuzAnshP

Weather MCP Server

A complete, clean, and modular Model Context Protocol (MCP) server for fetching weather data, forecasts, air quality, and alerts. This server is built using Python and uses the OpenWeatherMap API.

Features

  • Current Weather: Get real-time weather conditions for any location.

  • Forecasts: Access multi-day (up to 5 days) and hourly weather forecasts.

  • Air Quality: Retrieve Air Quality Index (AQI) and detailed pollutant data.

  • Alerts: Check for severe weather alerts (requires OpenWeatherMap OneCall 3.0 API subscription).

Related MCP server: OpenWeatherMap MCP Server

Project Structure

weather-mcp-server/
├── server.py              # Main MCP server entry point
├── tools/                 # Tool implementations (weather, forecast, air_quality, alerts)
├── services/              # API and business logic (geocoding, openweathermap endpoints)
├── utils/                 # Utilities and constants
├── requirements.txt       # Project dependencies
├── .env.example           # Example environment variables
└── README.md              # Project documentation

Setup & Installation

1. Install Dependencies

It is recommended to use a virtual environment.

cd weather-mcp-server
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt

2. Configure Environment Variables

Get a free API key from OpenWeatherMap.

Copy the example environment file:

cp .env.example .env

Edit .env and replace your_api_key_here with your actual OpenWeatherMap API key.

Running the Server

Development Mode (Testing)

You can run the server directly or use the MCP CLI to inspect it:

# Optional: Install mcp cli if you want to use the inspector
npm install -g @modelcontextprotocol/inspector

# Run with inspector
npx @modelcontextprotocol/inspector python server.py

Connecting to Claude Desktop

To connect this server to Claude Desktop, you need to configure Claude's mcp.json config file.

  1. Locate your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. Add the following to your mcpServers configuration (adjust the absolute path to your project):

{
  "mcpServers": {
    "weather": {
      "command": "/absolute/path/to/your/venv/bin/python",
      "args": [
        "/absolute/path/to/weather-mcp-server/server.py"
      ],
      "env": {
        "OPENWEATHER_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
      }
    }
  }
}
  1. Restart Claude Desktop. The new weather tools should now be available for Claude to use!

Tools Provided

  • get_current_weather(location, units)

  • get_weather_forecast(location, days, units)

  • get_hourly_forecast(location, hours, units)

  • get_air_quality(location)

  • get_weather_alerts(location)

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides weather data integration using the OpenWeatherMap API, enabling users to fetch current weather conditions, hourly and daily forecasts, weather alerts, and geocoding services for any location worldwide.
    91
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time weather data and forecasts for locations worldwide using the OpenWeatherMap API. It enables AI assistants to retrieve current conditions, temperature, and forecasts through a simple tool-based interface.
    MIT

Latest Blog Posts

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/IntuzAnshP/Weather-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server