Weather API MCP Server

Weather API MCP Server

By TuanKiri GitHub

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:

go golang
Overview

What is Weather API MCP Server?

Weather API MCP Server is a lightweight Model Context Protocol (MCP) server that allows AI assistants like Claude to access and interpret real-time weather data.

How to use Weather API MCP Server?

To use the MCP server with Claude Desktop, you need to add it to your Claude configuration with your API key from weatherapi. You can also build it from source using Go.

Key features of Weather API MCP Server?

  • Retrieves current weather data for specified cities.
  • Easy integration with AI assistants like Claude.
  • Built with Go for performance and efficiency.

Use cases of Weather API MCP Server?

  1. Providing real-time weather updates in AI applications.
  2. Enhancing user interactions with weather-related queries in chatbots.
  3. Integrating weather data into various applications for better user experience.

FAQ from Weather API MCP Server?

  • How do I get my API key?

You can obtain your API key by creating an account at weatherapi.

  • Is the server easy to set up?

Yes! The setup process is straightforward, and you can follow the provided instructions in the documentation.

  • What programming language is used?

The server is built using Go.

Content
example output template

Weather API MCP Server

License Go Version Go Report Card Build

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",
      "args": [],
      "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

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.

No tools information available.
Gateway
Gateway by centralmind

Universal MCP-Server for your Databases optimized for LLMs and AI-Agents.

api golang
View Details