Get the FREE Ultimate OpenClaw Setup Guide →

weather

MCP server from CodeByWaqas/weather-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio codebywaqas-weather-mcp-server uv --directory /<absolute-path>/weather-mcp-server/src/resources run server.py \
  --env WEATHER_API_KEY="YOUR_API_KEY"

How to use

This Weather MCP Server provides real-time weather information by interfacing with the OpenWeatherMap API. It delivers metric-unit data including temperature, humidity, wind speed, sunrise and sunset times, and a descriptive weather summary. The server is designed to run via UV (uvx) in a Claude Desktop workflow, enabling you to ask the model for current conditions, forecasts, or location-based weather details and have responses grounded in up-to-date data from OpenWeatherMap. To use it, provide your OpenWeatherMap API key as an environment variable (WEATHER_API_KEY) and run the server through the configured UV environment. Once running, you can query weather information through Claude Desktop or any MCP client integrated with this server, and the responses will reflect the latest data for the requested location.

Common use cases include: requesting current temperature and conditions for a city, retrieving wind speed and humidity, and getting sunrise/sunset times for a given locale. The MCP server abstracts API calls, so you can focus on natural-language prompts while receiving structured, up-to-date weather details.

How to install

Prerequisites:

  • Python 3.12 or higher
  • OpenWeatherMap API key
  • Internet access to reach the OpenWeatherMap API

Option A: Installing via Smithery

  1. Install the MCP server automatically via Smithery: npx -y @smithery/cli install @CodeByWaqas/weather-mcp-server --client claude

Option B: Manual Installation

  1. Clone the repository: git clone https://github.com/CodeByWaqas/weather-mcp-server
  2. Create a virtual environment and activate it: python -m venv .venv source .venv/bin/activate # On Windows use: .\venv\Scripts\activate
  3. Install dependencies: pip install -e .
  4. Install additional MCP components needed for development (if not already present): uv add "mcp[cli]" python-dotenv requests httpx
  5. Create and configure the environment file for weather API access as described in the Configuration section (WEATHER_API_KEY).

Additional notes

Tips and notes:

  • Ensure Python 3.12+ is installed and the virtual environment is active when running the server.
  • Set WEATHER_API_KEY in the environment to authorize calls to OpenWeatherMap.
  • The UV command you configure should point to the server.py script within src/resources, as shown in the example configuration.
  • If you encounter connectivity issues, verify that the API key is valid and that there are no network restrictions blocking access to OpenWeatherMap.
  • For Claude Desktop integration, ensure the path in the mcpServers configuration matches your local setup and that the environment variable is provided where the client expects it.

Related MCP Servers

Sponsor this space

Reach thousands of developers