A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data. What makes it popular:
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.
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 adding new features, please make sure to include tests for them.
go install go.uber.org/mock/mockgen@latest
See the installation guide on go.uber.org/mock.
make generate-mocks
make run-tests
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
Please follow the contribution guidelines.
This MCP server is licensed under the MIT License.
{ "mcpServers": { "weather-mcp-server": { "command": "/path/to/weather-mcp-server", "args": [] } } }
Related projects feature coming soon
Will recommend related projects based on sub-categories