MCP_Server_Project

SelahattinNazli/MCP_Server_Project

3.2

If you are the rightful owner of MCP_Server_Project and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Weather Server is a Model Context Protocol server that provides real-time weather forecasts and alerts using data from the US National Weather Service API.

Tools
2
Resources
0
Prompts
0

MCP Weather Server

A Model Context Protocol (MCP) server that provides real-time weather forecasts and alerts from the US National Weather Service API.

Features

Available Tools:

  • get_alerts(state) - Get active weather alerts for any US state
  • get_forecast(latitude, longitude) - Get detailed 5-day weather forecast for specific coordinates

Installation

Prerequisites

Install UV package manager:

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/mcp-weather-server
cd mcp-weather-server
  1. Install dependencies:
uv sync

Or manually:

uv add mcp httpx

Usage

Running Locally

Test the server:

uv run weather.py

The server will run in stdio mode and wait for MCP client connections.

Connecting to Claude Desktop

  1. Open Claude Desktop config file:

    macOS:

   code ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows:

   code $env:AppData\Claude\claude_desktop_config.json
  1. Add the weather server:
   {
     "mcpServers": {
       "weather": {
         "command": "uv",
         "args": [
           "--directory",
           "/ABSOLUTE/PATH/TO/mcp-weather-server",
           "run",
           "weather.py"
         ]
       }
     }
   }

Important: Replace /ABSOLUTE/PATH/TO/mcp-weather-server with your actual path.

  1. Restart Claude Desktop

    You should now see the weather tools (🔌 icon) in Claude Desktop.

Connecting to Cursor IDE

  1. Open Cursor Settings → MCP
  2. Add the following configuration:
   {
     "mcpServers": {
       "weather": {
         "command": "uv",
         "args": [
           "--directory",
           "/ABSOLUTE/PATH/TO/mcp-weather-server",
           "run",
           "weather.py"
         ]
       }
     }
   }
  1. Restart Cursor

Example Queries

Try asking Claude or Cursor:

  • "What are the weather alerts in California?"
  • "Get me the forecast for New York City (latitude 40.7128, longitude -74.0060)"
  • "Are there any severe weather warnings in Texas?"

Requirements

  • Python 3.12+
  • httpx
  • mcp

License

MIT

Contributing

Pull requests are welcome! For major changes, please open an issue first.