Weather
Accurate weather forecasts via the AccuWeather API (free tier available).
MCP Weather Server
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:
export ACCUWEATHER_API_KEY=your_api_key_here
Then run the MCP Weather server directly with:
npx -y @timlukahorstmann/mcp-weather
Or, for HTTP/REST access via supergateway:
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):
{
"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 nameunits(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 namedays(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
.envor your shell)
Setup
-
Clone this repository:
git clone https://github.com/TimLukaHorstmann/mcp-weather.git cd mcp-weather -
Install dependencies:
npm install -
Get an AccuWeather API key:
- Register at AccuWeather API
- Create a new app and obtain an API key
-
Create a
.envfile with your API key:ACCUWEATHER_API_KEY=your_api_key_here -
Build the project:
npm run build
Usage with Claude Desktop
-
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:
{ "mcpServers": { "weather": { "command": "npx", "args": ["-y", "@timlukahorstmann/mcp-weather"], "env": { "ACCUWEATHER_API_KEY": "your_api_key_here" } } } } -
Restart Claude Desktop
-
In a new conversation, enable the MCP server by clicking the plug icon and selecting "weather"
-
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
sessionIdrequirement 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.
İlgili Sunucular
Gemini
Provides access to Google Gemini AI capabilities as tools.
Hugging Face
Access the Hugging Face Dataset Viewer API to query, explore, search, and analyze machine learning datasets from the Hugging Face Hub.
MCP Weather Server Demo
Fetches weather data for any city using the Open-Meteo API.
EdgeOne Geo Location
Provides geolocation data using EdgeOne Pages Functions.
LuckyCola MCP
An open MCP service providing a standardized interface compatible with various MCP clients.
HuggingFace Spaces
Server for using HuggingFace Spaces, supporting Images, Audio, Text and more. Claude Desktop mode for ease-of-use.
Grafana
Access Grafana resources like dashboards, datasources, Prometheus, Loki, and alerts.
CORTEX MCP Extensions
Provides direct access to CORTEX infrastructure for orchestration, monitoring, AI flow management, model routing, and Docker administration.
Gemini Cloud Assist
An MCP Server that connects to Gemini Cloud Assist APIs, enabling you to manage and troubleshoot your Google Cloud environment using natural language.
Terraform Cloud
Manage Terraform Cloud infrastructure using natural language via its API.