weather
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data. Discuss on Hacker News:
claude mcp add --transport stdio ezh0v-weather-mcp-server weather-mcp-server \ --env WEATHER_API_KEY="your-api-key"
How to use
Weather MCP Server is a lightweight MCP server that exposes real-time weather data accessible to AI assistants via MCP tools. The server focuses on fetching current weather information for a specified city through its current_weather tool. Once running, Claude-like assistants can query the weather data by invoking the MCP tool named current_weather with required parameters such as city. The server is designed to be used in both local and remote (URL-based) modes, enabling seamless integration with Claude Desktop or other MCP-enabled clients. To use locally, configure the mcpServers section with the path to the weather-mcp-server binary and provide your WeatherAPI key as an environment variable. In remote mode, point to the server’s SSE endpoint if you’re exposing it over HTTP.
The primary tool exposed by this MCP server is current_weather, which accepts a city name as input and returns the current weather conditions for that city. This makes it straightforward to retrieve up-to-date weather information in real-time for any supported location, enabling AI assistants to answer questions like “What’s the weather in London?” with accurate data.
How to install
Prerequisites:
- Go installed for building from source (optional if using prebuilt binary)
- WeatherAPI account and API key
- Docker (optional, for containerized deployment)
From Source:
- Clone the repository: git clone https://github.com/ezh0v/weather-mcp-server.git cd weather-mcp-server
- Build the binary: go build -o weather-mcp-server ./cmd/weather-mcp-server
- Run the server (local mode): WEATHER_API_KEY=your-api-key ./weather-mcp-server
- Verify the server starts and is reachable (default port depends on the codebase).
Docker (containerized):
- Build the Docker image: docker build -t weather-mcp-server .
- Run the container with your API key: docker run -e WEATHER_API_KEY=your-api-key -d --name weather-mcp-server -p 8000:8000 weather-mcp-server
- Access the server via the mapped port (e.g., http://localhost:8000).
Optional remote mode ( Claude Desktop integration):
- In Claude Desktop, you can configure the mcpServers entry with a URL for remote mode if you’re exposing the MCP server via SSE.
Additional notes
Tips and considerations:
- Ensure WEATHER_API_KEY is kept secure and not exposed in logs or public repos. Use environment isolation where possible.
- If you see authentication errors, double-check the WeatherAPI key and its permissions.
- In remote mode, verify that the server’s URL is reachable from the Claude Desktop client and that the SSE endpoint is correctly configured.
- The server exposes at least the current_weather tool; if you extend functionality, update clients to use the new tool names and input parameters.
- When running in Docker, map the internal port correctly and consider using a volume for configuration if needed.
Related MCP Servers
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
github-brain
An experimental GitHub MCP server with local database.
mcp-tts
MCP Server for Text to Speech
tasker
An MCP server for Android's Tasker automation app.
chromedp
MCP server for browser automation using chromedp
WebwithMCP
基于 FastAPI + 原生前端的智能助手 Web 应用,支持实时对话、MCP 工具调用与对话历史管理。开箱即用,易于扩展,适合 AI 工具集成与智能对话场景。