MCP Weather Server

MCP Weather Server

Provides weather forecasts to LLMs via the Model Context Protocol.

27
Stars
9
Forks
27
Watchers
0
Issues
MCP Weather Server enables large language models to access real-time, accurate weather forecasts by interfacing with the AccuWeather API. It offers both hourly and daily weather data, supporting metric and imperial units, and can be seamlessly integrated with MCP-compatible clients like Claude Desktop or supergateway. The server provides tools for retrieving weather based on location and settings, with robust configuration options. It is designed for straightforward deployment using Node.js and environment-configured API keys.

Key Features

Provides hourly weather forecasts for the next 12 hours
Delivers daily forecasts for up to 15 days
Supports both metric (°C) and imperial (°F) units
Integrates with AccuWeather API for real-time data
Seamless compatibility with MCP clients like Claude Desktop
Offers REST/HTTP and stdio interfaces
Flexible configuration via environment variables or .env files
Command line and npx-based deployment
Two distinct tools: weather-get_hourly and weather-get_daily
Displays detailed weather parameters including conditions and precipitation

Use Cases

Allowing AI assistants to answer weather-related user queries
Enabling chatbots to generate daily or hourly weather updates
Integrating up-to-date weather data into virtual agents or smart devices
Supplying localized weather information within LLM-driven workflows
Building context-aware prompts that include current or forecasted weather
Support for weather-based automation in AI applications
Generating weather alerts or notifications in assistant apps
Enhancing advisory systems with accurate weather context
Assisting travel or event planners with weather-informed decisions
Providing accessible weather data for research or educational AI models

README

MCP Weather Server

npm version license node version issues weekly downloads Trust Score

A Model Context Protocol (MCP) server that provides hourly and daily weather forecasts using the AccuWeather API.


Quick Start

You need an AccuWeather API key (free tier available).
Sign up here and create an app to get your key.

Export your API key as an environment variable:

bash
export ACCUWEATHER_API_KEY=your_api_key_here

Then run the MCP Weather server directly with:

bash
npx -y @timlukahorstmann/mcp-weather

Or, for HTTP/REST access via supergateway:

bash
npx -y supergateway --stdio "npx -y @timlukahorstmann/mcp-weather" \
  --port 4004 \
  --baseUrl http://127.0.0.1:4004 \
  --ssePath /messages \
  --messagePath /message \
  --cors "*" \
  --env ACCUWEATHER_API_KEY="$ACCUWEATHER_API_KEY"

MCP Server Config Example

For integration with Claude Desktop or other MCP-compatible clients, add this to your config (e.g. claude_desktop_config.json):

json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "@timlukahorstmann/mcp-weather"],
      "env": {
        "ACCUWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Overview

This MCP server allows large language models (like Claude) to access real-time weather data. When integrated with an LLM, it enables the model to:

  • Fetch accurate, up-to-date weather forecasts
  • Provide hourly weather data for the next 12 hours
  • Access daily weather forecasts for up to 15 days
  • Display data in both metric (°C) and imperial (°F) units
  • View temperature, conditions, precipitation information, and other weather details

Available Tools

Hourly Weather Forecast

  • Tool name: weather-get_hourly
  • Provides hourly forecasts for the next 12 hours
  • Parameters:
    • location (required): City or location name
    • units (optional): "metric" (Celsius, default) or "imperial" (Fahrenheit)

Daily Weather Forecast

  • Tool name: weather-get_daily
  • Provides daily forecasts for up to 15 days
  • Parameters:
    • location (required): City or location name
    • days (optional): Number of forecast days (1, 5, 10, or 15; default is 5)
    • units (optional): "metric" (Celsius, default) or "imperial" (Fahrenheit)

Prerequisites

  • Node.js ≥18
  • An AccuWeather API key (set via .env or your shell)

Setup

  1. Clone this repository:

    bash
    git clone https://github.com/TimLukaHorstmann/mcp-weather.git
    cd mcp-weather
    
  2. Install dependencies:

    bash
    npm install
    
  3. Get an AccuWeather API key:

  4. Create a .env file with your API key:

    ACCUWEATHER_API_KEY=your_api_key_here
    
  5. Build the project:

    bash
    npm run build
    

Usage with Claude Desktop

  1. Configure Claude Desktop to use this MCP server:

    • Open Claude Desktop
    • Go to Settings > Developer > Edit Config
    • Add the following to your claude_desktop_config.json:
    json
    {
      "mcpServers": {
        "weather": {
          "command": "npx",
          "args": ["-y", "@timlukahorstmann/mcp-weather"],
          "env": {
            "ACCUWEATHER_API_KEY": "your_api_key_here"
          }
        }
      }
    }
    
  2. Restart Claude Desktop

  3. In a new conversation, enable the MCP server by clicking the plug icon and selecting "weather"

  4. Now you can ask Claude for weather forecasts, such as:

    • "What's the hourly weather forecast for New York City?"
    • "Give me the 5-day forecast for London."
    • "What will the weather be like in Tokyo this week in Fahrenheit?"
    • "Will it rain in San Francisco tomorrow?"

Development

  • Install dev dependencies: npm install
  • Lint your code: npm run lint
  • Build: npm run build
  • Run tests: npm test
  • Start in dev mode: npm run dev

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Future Enhancements

We're always looking to improve the MCP Weather Server. Here are some features we're considering for future releases:

  • Extended Hourly Forecasts: Beyond 12 hours, e.g., 24 or 48 hours.
  • Weather Alerts: Integration with AccuWeather's severe weather alerts API.
  • Location Autocomplete: Improved location searching with autocomplete suggestions.
  • Historical Weather Data: Access to past weather conditions.

If you have ideas for other features, feel free to open an issue!

Changelog

0.4.0

  • Removed sessionId requirement from all tools as it was not used for anything internally
  • This simplifies integrations and reduces confusion for LLM usage

0.3.0 and earlier

  • Initial releases with basic functionality

License

This project is licensed under the MIT License - see the LICENSE file for details.

Star History

Star History Chart

Repository Owner

Repository Details

Language TypeScript
Default Branch main
Size 1,124 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
83.36%
JavaScript
16.64%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • MCP Simple Timeserver

    MCP Simple Timeserver

    Provides local and UTC time to AI models via the Model Context Protocol.

    MCP Simple Timeserver provides current local time, timezone, and UTC information to AI models such as Claude by serving as a Model Context Protocol (MCP) tool. It offers two main endpoints: one for retrieving the user's local time and timezone, and another for fetching the current UTC time from an NTP server. The project supports both local and web server deployments and can be integrated into the Claude desktop app to enhance temporal awareness for LLMs.

    • 25
    • MCP
    • andybrandt/mcp-simple-timeserver
  • Weblate MCP Server

    Weblate MCP Server

    Seamlessly connect AI assistants to Weblate for translation management via the Model Context Protocol.

    Weblate MCP Server enables AI assistants and clients to directly manage Weblate translation projects through the Model Context Protocol (MCP). It integrates with the Weblate REST API, allowing natural language interaction for project and translation management. The tool offers multiple transport options including HTTP, SSE, and STDIO, and is optimized for large language model workflows. Full support for project, component, and translation operations is provided, with a focus on type safety and flexible environment configuration.

    • 9
    • MCP
    • mmntm/weblate-mcp
  • Climatiq MCP Server

    Climatiq MCP Server

    MCP server providing AI assistants with real-time carbon emissions calculations via Climatiq API.

    Climatiq MCP Server implements the Model Context Protocol to bridge AI assistants with the Climatiq API for precise carbon emissions calculations. It exposes a set of tools for various emissions scenarios, including electricity use, travel, freight, and more. The server generates resource URIs for detailed emission reports and provides natural language explanations on climate impact. Configuration is streamlined via environment variables, CLI tools, or files, supporting easy integration with platforms like Claude Desktop.

    • 6
    • MCP
    • jagan-shanmugam/climatiq-mcp-server
  • Dappier MCP Server

    Dappier MCP Server

    Real-time web search and premium data access for AI agents via Model Context Protocol.

    Dappier MCP Server enables fast, real-time web search and access to premium data sources, including news, financial markets, sports, and weather, for AI agents using the Model Context Protocol (MCP). It integrates seamlessly with tools like Claude Desktop and Cursor, allowing users to enhance their AI workflows with up-to-date, trusted information. Simple installation and configuration are provided for multiple platforms, leveraging API keys for secure access. The solution supports deployment via Smithery and direct installation with 'uv', facilitating rapid setup for developers.

    • 35
    • MCP
    • DappierAI/dappier-mcp
  • Stape MCP Server

    Stape MCP Server

    An MCP server implementation for integrating Stape with AI model context protocols.

    Stape MCP Server provides an implementation of the Model Context Protocol server tailored for the Stape platform. It enables secure and standardized access to model context capabilities, allowing integration with tools such as Claude Desktop and Cursor AI. Users can easily configure and authenticate MCP connections using provided configuration samples, while managing context and credentials securely. The server is open source and maintained by the Stape Team under the Apache 2.0 license.

    • 4
    • MCP
    • stape-io/stape-mcp-server
  • Make MCP Server (legacy)

    Make MCP Server (legacy)

    Enable AI assistants to utilize Make automation workflows as callable tools.

    Make MCP Server (legacy) provides a Model Context Protocol (MCP) server that connects AI assistants with Make scenarios configured for on-demand execution. It parses and exposes scenario parameters, allowing AI systems to invoke automation workflows and receive structured JSON outputs. The server supports secure integration through API keys and facilitates seamless communication between AI and Make's automation platform.

    • 142
    • MCP
    • integromat/make-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results