Weather MCP Server

Weather MCP Server

Provides real-time weather forecasts and alerts by fetching data from the National Weather Service API, allowing Claude to answer weather-related questions with up-to-date information.

Category
Visit Server

README

Weather MCP Server

This project implements a Model Context Protocol (MCP) server that provides real-time weather forecasts and alerts. It is built using the Python MCP SDK and the National Weather Service (NWS) API. The server fetches data (forecasts, alerts, observations, etc.) from the NWS API and exposes them as MCP tools that AI assistants (e.g. Claude) can call. In short, it allows you to ask Claude questions like “What are the weather alerts in CA?” or “What’s the forecast for 37.77, -122.42?”, and the server will return up-to-date information.

Prerequisites

  • Python 3.11 or higher. The Python MCP SDK requires a recent Python version.
  • uv package manager. This lightweight tool manages Python dependencies and can run scripts. (Install it via curl -LsSf https://astral.sh/uv/install.sh | sh on macOS/Linux or using PowerShell on Windows, or via pipx install uv.)
  • MCP Python SDK and HTTP library. We'll install these with uv below.

Setup / Installation

  1. Clone the repository (or download the code):

    git clone https://github.com/Danii2020/weather-mcp.git
    cd weather
    
  2. Install dependencies with uv. In the project directory, run:

    uv add mcp[cli] httpx
    

    This installs the Python MCP SDK (mcp[cli]) and an HTTP client (httpx) used by the server.

  3. (Optional) If your project includes a pyproject.toml or other dependencies, you can install them similarly. But the above command covers the core libraries needed.

Running the Server

Start the weather MCP server by running:

uv run weather.py

This will launch the server (using uv to manage the environment). The terminal will print status messages. Keep this process running to serve requests.

Note: If you run into issues, make sure you have activated the correct Python environment and that uv is in your PATH.

Configuring Claude for Desktop

To let Claude for Desktop use this weather server, you must add it as an MCP server in Claude’s config.

  • Platform support: Claude Desktop is available for macOS and Windows only (Linux is not supported).

  • Config file location: Find or create the file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Open claude_desktop_config.json in a text editor. Add an entry under "mcpServers" for the weather tool. For example:

    {
      "mcpServers": {
        "weather": {
          "command": "/full/path/to/uv",
          "args": ["run", "weather.py"],
          "cwd": "/full/path/to/weather"
        }
      }
    }
    
    • Replace /full/path/to/uv with the absolute path of the uv executable. You can find this by running which uv on macOS or Linux, or where uv on Windows.
    • Replace /full/path/to/weather with the full path to the weather project directory on your machine.
  • Save the file and restart Claude for Desktop. In Claude, open the Developer settings and ensure the “weather” server appears under available MCP servers. You can now select it in your conversation.

Usage Examples

Once the server is running and Claude is configured, you can ask Claude to use the weather tools. For example:

  • Weather Alerts: Ask “What are the current weather alerts in CA?” (the server’s get_alerts tool will fetch alerts from NWS).
  • Forecast: Ask “What’s the 5-day forecast for latitude 47.6, longitude -122.3?” (the server’s get_forecast tool will retrieve the forecast).

Claude will display the results returned by the server. You can experiment with different state codes or coordinates as needed.

Video Tutorial

For a step-by-step walkthrough, watch the author’s YouTube tutorial “Learn MCP from Scratch and Build an MCP Server with Python!” at https://youtu.be/Pu5Q2dDwR9w. The video shows how to set up uv, code the server, and connect it to Claude Desktop.

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

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