Weather API MCP Server
ezh0v/weather-mcp-server · 247 stars · Go · MIT
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:
Install
The repo has no one-line install. Follow its README.
Files
Weather API MCP Server
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
{
"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.
2. Remote mode
{
"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.
go build -o weather-mcp-server ./cmd/weather-mcp-server
Using MCP with Docker Containers
1. Build the Docker Image:
docker build -t weather-mcp-server .
2. Run the Docker Container:
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.
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:
├── 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
Testing
If you're adding new features, please make sure to include tests for them.
1. Install the mockgen tool:
go install go.uber.org/mock/mockgen@latest
See the installation guide on go.uber.org/mock.
2. Use the following command to generate mock files:
make generate-mocks
3. To run unit tests:
make run-tests
Contributing
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
Please follow the contribution guidelines.
License
This MCP server is licensed under the MIT License.
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 247
- License
- MIT
- Language
- Go
- Last push
- 2026-03-01
- Forks
- 21
- Topics
- go, golang, mcp, mcp-server, sse, stdio
- 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
- 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
- 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
- 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
- 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k