https://github.com/tuankiri/weather-mcp-server
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:
https://github.com/tuankiri/weather-mcp-server
go golang mcp mcp-server sse stdio
Last synced: 6 months ago
JSON representation
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:
- Host: GitHub
- URL: https://github.com/tuankiri/weather-mcp-server
- Owner: TuanKiri
- License: mit
- Created: 2025-04-07T12:22:42.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-04-12T07:29:35.000Z (6 months ago)
- Last Synced: 2025-04-12T09:47:58.969Z (6 months ago)
- Topics: go, golang, mcp, mcp-server, sse, stdio
- Language: Go
- Homepage: https://news.ycombinator.com/item?id=43614582
- Size: 106 KB
- Stars: 184
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
![]()
Weather API MCP Server
[](LICENSE)
[](go.mod)
[](https://goreportcard.com/report/github.com/TuanKiri/weather-mcp-server)
[](https://github.com/TuanKiri/weather-mcp-server/actions?workflow=Build)[Report Bug](https://github.com/TuanKiri/weather-mcp-server/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml) | [Request Feature](https://github.com/TuanKiri/weather-mcp-server/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml)
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.
![]()
## Installing on Claude Desktop
To use your MCP server with Claude Desktop, add it to your Claude configuration:
#### 1. Local mode
```json
{
"mcpServers": {
"weather-mcp-server": {
"command": "/path/to/weather-mcp-server",
"args": [],
"env": {
"WEATHER_API_KEY": "your-api-key"
}
}
}
}
```You can get an API key from your personal account on [WeatherAPI](https://www.weatherapi.com/my/).
#### 2. Remote mode
```json
{
"mcpServers": {
"weather-mcp-server": {
"url": "http://host:port/sse"
}
}
}
```## Build from source
You can use `go` to build the binary in the `cmd/github-mcp-server` directory.
```shell
go build -o weather-mcp-server ./cmd/weather-mcp-server
```## Using MCP with Docker Containers
#### 1. Build the Docker image:
```shell
docker build -t weather-mcp-server .
```#### 2. Run the Docker Container:
```shell
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](https://www.weatherapi.com/my/) API key.
## Tools
- **current_weather** - Gets the current weather for a city
- `city`: The name of the city (string, required)
## Project Structure
The project is organized into several key directories:
```shell
├── 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
```## Contributing
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
Please follow the [contribution guidelines](.github/CONTRIBUTING.md).
## License
This MCP server is licensed under the [MIT License](LICENSE).