by ezh0v
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:
# Add to your Claude Code skills
git clone https://github.com/ezh0v/weather-mcp-server<strong>Report Bug</strong> | <strong>Request Feature</strong>
</div>A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.
<div align="center"> <img alt="demo example" src="assets/weather.gif" width="480"> </div>To use your MCP server with Claude Desktop, add it to your Claude configuration:
{
"mcpServers": {
"weather-mcp-server": {
"command": "/path/to/weather-mcp-server",
"env": {
"WEATHER_API_KEY": "your-api-key"
}
}
}
}
You can get an API key from your personal account on WeatherAPI.
{
"mcpServers": {
"weather-mcp-server": {
"url": "http://host:port/sse"
}
}
}
You can use go to build the binary in the cmd/github-mcp-server directory.
go build -o weather-mcp-server ./cmd/weather-mcp-server
docker build -t weather-mcp-server .
docker run -e WEATHER_API_KEY=your-api-key -d --name weather-mcp-server -p 8000:8000 weather-mcp-server
Replace your-api-key with your actual WeatherAPI API key.
current_weather - Gets the current weather for a city
city: The name of the city (string, required)The project is organized into several key directories:
├── cmd
│ └── weather-mcp-server
├── internal
│ └── server
│ ├── handlers # MCP handlers
│ ├── services # Business logic layer
│ │ ├── core # Core application logic
│ │ └── mock # Mock services for testing
│ ├── tools # MCP tools
│ └── view # Templates for displaying messages
└── pkg
If you're ...