
A Model Context Protocol (MCP) server that provides weather data using the Open-Meteo API. This server allows AI assistants to retrieve current weather conditions and forecasts for any location on...
概览
A Model Context Protocol (MCP) server that provides weather data using the Open-Meteo API. This server allows AI assistants to retrieve current weather conditions and forecasts for any location on Earth. - : Get real-time temperature, wind speed, humidity, and weather conditions - : Retrieve hourly forecasts for up to 7 days - : Get a comprehensive summary including current conditions and daily min/max temperatures - : Works with any latitude/longitude coordinates worldwide - : Uses the free Open-Meteo API 1. Clone or download this repository 2. Install dependencies: You can run this MCP server using Docker: 1. Make sure you have Docker and Docker Compose installed 2. Run the server: 3. View logs: 4. Stop the server: 1. Build the Docker image: 2. Run the container: This server is also available on Docker Hub: Get current weather data for a specific location.
README
以下为原文 README 节选,完整内容请查看原文。
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather data using the Open-Meteo API. This server allows AI assistants to retrieve current weather conditions and forecasts for any location on Earth.
Features
- Current Weather: Get real-time temperature, wind speed, humidity, and weather conditions
- Weather Forecast: Retrieve hourly forecasts for up to 7 days
- Weather Summary: Get a comprehensive summary including current conditions and daily min/max temperatures
- Global Coverage: Works with any latitude/longitude coordinates worldwide
- No API Key Required: Uses the free Open-Meteo API
Installation
- Clone or download this repository
- Install dependencies:
npm install
Usage
Running the Server
Start the MCP server:
npm start
For development with auto-restart:
npm run dev
Using Docker
You can run this MCP server using Docker:
Using Docker Compose (Recommended)
- Make sure you have Docker and Docker Compose installed
- Run the server:
docker-compose up -d - View logs:
docker logs weather-mcp-server - Stop the server:
docker-compose down
Using Docker Directly
- Build the Docker image:
docker build -t weather-mcp-server . - Run the container:
docker run -d --name weather-mcp-server weather-mcp-server
Using the Docker Hub Image
This server is also available on Docker Hub:
docker pull jeremymorgan/weather-mcp-server
docker run -d --name weather-mcp-server jeremymorgan/weather-mcp-server
Available Tools
The server provides three main tools:
1. get_current_weather
Get current weather data for a specific location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the location
Example:
{
"name": "get_current_weather",
"arguments": {
"latitude": 52.52,
"longitude": 13.41
}
}
2. get_weather_forecast
Get hourly weather forecast for a specific location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the locationdays(number, optional): Number of days to forecast (default: 7)
Example:
{
"name": "get_weather_forecast",
"arguments": {
"latitude": 52.52,
"longitude": 13.41,
"days": 3
}
}
3. get_weather_summary
Get a summary of current weather and today’s forecast for a location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the location
Example:
{
"name": "get_weather_summary",
"arguments": {
"latitude": 52.52,
"longitude": 13.41
}
}
API Reference
安装
docker run -d --name weather-mcp-server weather-mcp-server