mcpField
W
Weather Forecast MCP Server

Weather Forecast MCP Server

Local
github.com/MKhan997733Media & Design0Updated 73w ago

About Weather Forecast MCP Server

Weather Forecast MCP Server gives AI assistants weather alerts and forecasts for US states and UK cities or towns. It combines National Weather Service data for the US with OpenWeather data for UK weather.

Key features

  1. 01Get active US state weather alerts
  2. 02Retrieve forecasts by coordinates
  3. 03Check current UK city weather
  4. 04Use government weather data for the US

Use cases

  1. 01Check alerts for a US state
  2. 02Get a forecast for a location's coordinates
  3. 03Look up current weather in a UK town

MCP support

The MCP server exposes tools for US state alerts, coordinate-based forecasts, and current UK weather. MCP-compatible assistants and clients can call them; UK weather services require an API key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"weather-forecast-mkhan997733": {
"command": "npx",
"args": [
"-y",
"mcp-server-weather-forecast"
],
"env": {
"API_KEY": "<API_KEY>"
}
}
}
}
Run commandnpx -y mcp-server-weather-forecast
Environment variables to set
API_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmmcp-server-weather-forecast

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Weather Forecast MCP Server

A Model Context Protocol (MCP) server that provides weather information and alerts for US states and UK cities/towns using the National Weather Service (NWS) API. This server enables AI assistants to fetch current weather forecasts and alerts through a standardized interface.

Features

  • Weather Alerts: Get active weather alerts for any US state or UK city/town
  • Weather Forecasts: Retrieve detailed weather forecasts using latitude and longitude coordinates
  • API Key Required: Requires an API key for UK weather services
  • Real-time Data: Access current weather information directly from official government sources
  • MCP Compatible: Works with any MCP-compatible AI assistant or client

Installation

From Source

Clone the repository and install dependencies:

git clone https://github.com/MKhan997733/mcp-server-weather-forecast.git
cd mcp-server-weather-forecast
npm install
npm run build

Configuration

Claude Desktop

Add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["mcp-server-weather-forecast"],
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}
Cursor IDE

Add the server to your MCP settings in Cursor:

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["mcp-server-weather-forecast"],
      "disabled": false,
      "autoApprove": [],
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}
Environment Variables

The following environment variable is required:

  • API_KEY: Your weather API key for accessing weather services

You can obtain an API key from OpenWeather

Usage

Once configured, you can ask your AI assistant weather-related questions such as:

  • "What are the current weather alerts for California?"
  • "Get me the weather forecast for New York City"
  • "Are there any severe weather warnings in Texas?"
  • "What's the forecast for coordinates 40.7128, -74.0060?"

Available Tools

get-alerts

Get weather alerts for a specific US state.

Parameters:

  • state (string, required): Two-letter US state code (e.g., "CA", "NY", "TX")

Example:

{
  "state": "CA"
}
get-forecast

Get weather forecast for a specific location using coordinates.

Parameters:

  • latitude (number, required): Latitude of the location (-90 to 90)
  • longitude (number, required): Longitude of the location (-180 to 180)

Example:

{
  "latitude": 37.7749,
  "longitude": -122.4194
}
current-weather-uk

Get current weather forecast for UK cities and towns.

Parameters:

  • city (string, required): Name of the UK city or town

Example:

{
  "city": "London"
}

API Details

This server uses the following APIs:

  • National Weather Service API: For US weather alerts and forecasts
  • OpenWeather API: For UK weather information and additional weather data

API Key: An API key is required for accessing weather services. You can obtain one from OpenWeather

Development

Prerequisites
  • Node.js 18+
  • npm or yarn
Running in Development
# Install dependencies
npm install

# Build the project
npm run build

# Run the server with API key
API_KEY=your-api-key-here node <absolute-path>/build/index.js

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.