Sponsored by Deepsite.site

Weather Forecast MCP Server

Created By
MKhan9977336 months ago
Content

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
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server