Skip to content
Back to search

weather-mcp-server

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:

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ezh0v--weather-mcp-server/badge.svg)](/listings/ezh0v--weather-mcp-server)

HTML

<a href="/listings/ezh0v--weather-mcp-server"><img src="/api/listings/ezh0v--weather-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

To use your MCP server with Claude Desktop, add it to your Claude configuration:

1. Local mode

{
  "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](https://www.weatherapi.com/my/).

2. Remote mode

{
  "mcpServers": {
    "weather-mcp-server": {
      "url": "http://host:port/sse"
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 135 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <img alt="example output template" src="assets/weather.svg">
  3. <h1>Weather API MCP Server</h1>
  4. [![License](https://img.shields.io/badge/license-MIT-red.svg)](LICENSE)
  5. [![Go Version](https://img.shields.io/github/go-mod/go-version/ezh0v/weather-mcp-server)](go.mod)
  6. [![Go Report Card](https://goreportcard.com/badge/github.com/ezh0v/weather-mcp-server?cache)](https://goreportcard.com/report/github.com/ezh0v/weather-mcp-server)
  7. [![Build](https://github.com/ezh0v/weather-mcp-server/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/ezh0v/weather-mcp-server/actions?workflow=Build)
  8. [![Tests](https://github.com/ezh0v/weather-mcp-server/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/ezh0v/weather-mcp-server/actions?workflow=Test)
  9. <strong>[Report Bug](https://github.com/ezh0v/weather-mcp-server/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml)</strong> | <strong>[Request Feature](https://github.com/ezh0v/weather-mcp-server/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml)</strong>
  10. </div>
  11. A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.
  12. <div align="center">
  13. <img alt="demo example" src="assets/weather.gif" width="480">
  14. </div>
  15. ## Installing on Claude Desktop
  16. To use your MCP server with Claude Desktop, add it to your Claude configuration:
  17. #### 1. Local mode
  18. ```json
  19. {
  20. "mcpServers": {
  21. "weather-mcp-server": {
  22. "command": "/path/to/weather-mcp-server",
  23. "env": {
  24. "WEATHER_API_KEY": "your-api-key"
  25. }
  26. }
  27. }
  28. }
  29. ```
  30. You can get an API key from your personal account on [WeatherAPI](https://www.weatherapi.com/my/).
  31. #### 2. Remote mode
  32. ```json
  33. {
  34. "mcpServers": {
  35. "weather-mcp-server": {
  36. "url": "http://host:port/sse"
  37. }
  38. }
  39. }
  40. ```
  41. ## Build from source
  42. You can use `go` to build the binary in the `cmd/github-mcp-server` directory.
  43. ```shell
  44. go build -o weather-mcp-server ./cmd/weather-mcp-server
  45. ```
  46. ## Using MCP with Docker Containers
  47. #### 1. Build the Docker Image:
  48. ```shell
  49. docker build -t weather-mcp-server .
  50. ```
  51. #### 2. Run the Docker Container:
  52. ```shell
  53. docker run -e WEATHER_API_KEY=your-api-key -d --name weather-mcp-server -p 8000:8000 weather-mcp-server
  54. ```
  55. Replace `your-api-key` with your actual [WeatherAPI](https://www.weatherapi.com/my/) API key.
  56. ## Tools
  57. - **current_weather** - Gets the current weather for a city
  58. - `city`: The name of the city (string, required)
  59. ## Project Structure
  60. The project is organized into several key directories:
  61. ```shell
  62. ├── cmd
  63. │ └── weather-mcp-server
  64. ├── internal
  65. │ └── server
  66. │ ├── handlers # MCP handlers
  67. │ ├── services # Business logic layer
  68. │ │ ├── core # Core application logic
  69. │ │ └── mock # Mock services for testing
  70. │ ├── tools # MCP tools
  71. │ └── view # Templates for displaying messages
  72. └── pkg
  73. ```
  74. ## Testing
  75. If you're adding new features, please make sure to include tests for them.
  76. #### 1. Install the mockgen tool:
  77. ```shell
  78. go install go.uber.org/mock/mockgen@latest
  79. ```
  80. See the installation guide on [go.uber.org/mock](https://github.com/uber-go/mock?tab=readme-ov-file#installation).
  81. #### 2. Use the following command to generate mock files:
  82. ```shell
  83. make generate-mocks
  84. ```
  85. #### 3. To run unit tests:
  86. ```shell
  87. make run-tests
  88. ```
  89. ## Contributing
  90. Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
  91. Please follow the [contribution guidelines](.github/CONTRIBUTING.md).
  92. ## License
  93. This MCP server is licensed under the [MIT License](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.