Weather API MCP Server

by ezh0v

A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and parse real-time weather data. Requires setting the WeatherAPI key via the environment variable WEATHER_API_KEY (https://www.weatherapi.com/my/).

News & weatherstdioCommunity

Repository-wide counts · Cached 2025-10-30

Overview

The Weather API MCP Server MCP server is a publicly available project. Review the upstream repository for installation instructions, supported tools, compatibility, permissions, and current maintenance status.

Configuration

Configuration, transport, authentication, and runtime requirements vary by project. Open the repository before connecting and use the smallest set of credentials and permissions required.

Open the Weather API MCP Server repository to read the latest documentation.

KEEP EXPLORING

Compare source, connection, and authentication details before choosing an implementation.

View the complete category

Weather API MCP Server

TuanKiri

Community

A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data. Requires an API key from WeatherAPI (https://www.weatherapi.com/my/) set via the WEATHER_API_KEY environment variable.

🔥 Trends Hub

baranwang

Community

A one-stop aggregation service for trending topics across the web based on the Model Context Protocol (MCP). Supports over 20 high-quality data sources with real-time updates. Environment variables can be used to customize returned fields and add custom RSS feeds.

HotNews MCP Server

wopal-cn

Community

A Model Context Protocol (MCP) server that provides real-time hot trending topics from major Chinese social platforms and news sites. Uses the external API service api.vvhan.com for fetching hot topics data.

Google News Trends MCP

jmanek

Community

An MCP server that slurps data from Google News and Google Trends RSS endpoints, optionally distills it with LLM/NLP, and barfs out structured results.

FROM THE SOURCE

Repository README

Build-time snapshot · Retrieved 2026-10-05

View original
example output template

Weather API MCP Server

License Go Version Go Report Card Build Tests

Report Bug | Request Feature

A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.

demo example

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.