A Model Context Protocol (MCP) server written in Go that provides weather information and forecasts using the free Open-Meteo API.
- Get Weather by Coordinates: Retrieve current weather and forecasts using latitude and longitude.
- Get Weather by City: Search for weather by city name using built-in geocoding.
- Customizable Units: Support for various units for temperature, wind speed, and precipitation.
- Detailed Forecasts: Includes hourly (24h) and daily forecasts.
Get current weather and forecast for a specific location using coordinates.
latitude(required): Latitude of the location.longitude(required): Longitude of the location.location_name(optional): Descriptive name for the location.temperature_unit(optional):celsiusorfahrenheit.wind_speed_unit(optional):kmh,ms,mph,kn.precipitation_unit(optional):mmorinch.
Get weather for a city by name using geocoding.
city(required): Name of the city.country_code(optional): 2-letter country code to narrow down search.temperature_unit(optional):celsiusorfahrenheit.wind_speed_unit(optional):kmh,ms,mph,kn.precipitation_unit(optional):mmorinch.
- Go 1.24.0 or later (based on
go.mod).
Clone the repository and build the binary:
go build -o goweathermcp main.goTo use this server with Claude Desktop, add the following to your claude_desktop_config.json:
{
"mcpServers": {
"goweather": {
"command": "/path/to/goweathermcp/goweathermcp",
"args": ["-temp-unit", "fahrenheit", "-wind-unit", "mph", "-precip-unit", "inch"]
}
}
}Replace /path/to/goweathermcp/goweathermcp with the actual absolute path to your built binary. You can omit args if you prefer the defaults (celsius, kmh, mm).
To run the server in development mode:
go run main.goThe server uses stdio for communication, so running it directly will wait for MCP JSON-RPC commands.
To create a new release:
- Tag the commit:
git tag -a v1.0.0 -m "First release" - Push the tag:
git push origin v1.0.0The GitHub Action will automatically build and publish the release using GoReleaser.
This project is licensed under the MIT License - see the LICENSE file for details.
- Weather data provided by Open-Meteo.
- Built using the mcp-go library.