Get the FREE Ultimate OpenClaw Setup Guide →

go-weather

weather mcp server in Go (modelcontextprotocol.io SDK)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio frsfahd-go-weather-mcp-server go run .

How to use

This MCP server provides weather data by querying the National Weather Service API (api.weather.gov). Once running, clients can request weather information through the MCP protocol endpoints exposed by the server to retrieve current conditions, short-term forecasts, and other forecast-related data. The server is designed to be lightweight and idiomatic for Go, making use of the standard library and minimal dependencies. You can integrate it into your MCP ecosystem to pull weather data as needed for automation, dashboards, or alerting workflows.

To use, start the server with the configured command and then make MCP requests to the server-name (weather) using the MCP protocol. The server handles communication with api.weather.gov and formats responses according to the MCP data model, including forecast periods and observables such as temperature, wind, and precipitation probabilities. If you need to customize the endpoint base, the server can be configured to point at api.weather.gov or a local mirror via environment variables (if supported by this build).

How to install

Prerequisites:

  • Go installed (1.18+ recommended)
  • Internet access to fetch dependencies
  • Git (optional, for cloning the repository)

Basic installation steps:

  1. Clone or download the repository containing the weather MCP server.
  2. Navigate to the project directory.
  3. Fetch modules and build/run the server:
# If you have go modules enabled and the project is a module
go mod download

# Run the MCP server (from the project root, assuming main package is in the current directory)
go run .

Notes:

  • Ensure your environment permits outbound HTTPS requests to api.weather.gov.
  • If the repository provides a different entry point or module path, adjust the go run command accordingly (e.g., go run ./cmd/weather).
  • For production deployment, consider building a binary and running it directly, or wrapping the server in a process manager.

Additional notes

Environment variables and configuration tips:

  • WEATHER_API_BASE (optional): Override the base URL for the weather API if you’re using a mirror or a test/staging endpoint. Example: WEATHER_API_BASE=https://api.weather.gov
  • If the server exposes rate-limit or retry settings, tune them to avoid hitting api.weather.gov limits.
  • Check logs for connectivity issues with api.weather.gov and verify network proxies if applicable.
  • Ensure that the MCP client and server agree on the MCP protocol version used by this server to avoid compatibility issues.

Common issues:

  • Go module proxy or network restrictions preventing dependency fetches.
  • DNS resolution failures to api.weather.gov.
  • Port or firewall rules blocking MCP traffic to or from the server.

Diagnostics:

  • Run with verbose logging if available (e.g., APP_LOG_LEVEL=debug) to obtain request/response traces.
  • Validate that the server is reachable from MCP clients and that the expected MCP endpoints exist.

Related MCP Servers

Sponsor this space

Reach thousands of developers