Skip to main content
Glama
g-adarshg098

MCP Weather Server

by g-adarshg098
README.md
# šŸŒ¤ļø MCP Weather Server

[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg?logo=python&logoColor=white)](https://www.python.org/)
[![Model Context Protocol](https://img.shields.io/badge/MCP-Protocol-orange.svg)](https://modelcontextprotocol.io/)
[![Built with uv](https://img.shields.io/badge/package%20manager-uv-purple.svg)](https://github.com/astral-sh/uv)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A lightweight and fast **Model Context Protocol (MCP)** server built in Python that equips AI assistants (like **Claude Desktop**) with real-time weather information using [wttr.in](https://wttr.in).

---

## ✨ Features

- ⚔ **Real-time Weather**: Fetch instant temperature and weather updates for any location worldwide.
- šŸ”Œ **Standard MCP Compliance**: Built with the official Python `mcp` SDK using standard `stdio` transport.
- šŸš€ **Blazing Fast Setup**: Managed with `uv` for near-instant dependency management.
- šŸ¤– **Seamless Claude Integration**: Easily connectable with Claude Desktop or any MCP-compatible AI client.

---

## šŸ› ļø Tools Exposed

| Tool Name | Parameters | Description | Example Output |
| :--- | :--- | :--- | :--- |
| `get_weather` | `location` *(string)* | Retrieves current temperature for the specified city/location | `+28°C` |

---

## šŸ“‹ Prerequisites

- **Python**: Version `3.12` or newer
- **uv**: Fast Python package installer and resolver ([Installation Guide](https://docs.astral.sh/uv/getting-started/installation/))
- **Claude Desktop** (Optional, for Claude Desktop integration)

---

## šŸš€ Quick Start

### 1. Clone the Repository

```bash
git clone https://github.com/g-adarshg098/MCP_SERVER.git
cd MCP_SERVER
```

### 2. Install Dependencies

Using `uv`:

```bash
uv sync
```

Or using standard `pip`:

```bash
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate

pip install -e .
```

### 3. Test Running the Server

Run directly with `uv`:

```bash
uv run mcp-weather.py
```

---

## šŸ–„ļø Claude Desktop Integration

To use this weather tool inside **Claude Desktop**, add the server configuration to your `claude_desktop_config.json`.

### Config File Location

- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

### Configuration

Add the following to your `mcpServers` object:

#### Windows (with `uv`)
```json
{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\Users\\adars\\OneDrive\\ADARSHG\\GENAI_2\\MCP_Server",
        "run",
        "mcp-weather.py"
      ]
    }
  }
}
```

> **Note**: Make sure to update the absolute path to match your project's directory location on your machine.

#### macOS / Linux (with `uv`)
```json
{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/MCP_Server",
        "run",
        "mcp-weather.py"
      ]
    }
  }
}
```

After modifying the configuration, **restart Claude Desktop**. You should see the šŸ”Ø hammer icon indicating available tools, including `get_weather`!

---

## šŸ“‚ Project Structure

```text
MCP_SERVER/
ā”œā”€ā”€ src/
│   └── mcp_server/
│       └── __init__.py
ā”œā”€ā”€ mcp-weather.py       # Weather MCP server implementation
ā”œā”€ā”€ pyproject.toml       # Project metadata and dependencies
ā”œā”€ā”€ uv.lock              # Lockfile for reproducible builds
ā”œā”€ā”€ .env.example         # Template for environment variables
ā”œā”€ā”€ .gitignore           # Git ignore rules
└── README.md            # Project documentation
```

---

## šŸ¤ Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/g-adarshg098/MCP_SERVER/issues).

---

## šŸ‘¤ Author

**Adarsh G**
- GitHub: [@g-adarshg098](https://github.com/g-adarshg098)
- Email: its.adarshg15@gmail.com

---

## šŸ“„ License

This project is licensed under the [MIT License](LICENSE).

TDQS

D1.8/5.0

Scored across 1 tool

Disambiguation5/5

With only a single tool, there is no possibility of confusion or overlap. The tool's purpose is clear from its name: get_weather.

Naming Consistency5/5

The only tool follows a clear verb_noun pattern (get_weather), which is consistent and predictable. There are no other tools to introduce naming conflicts.

Tool Count2/5

A weather-focused server with only one tool feels too sparse. Typical weather servers offer current conditions, forecasts, and alerts, so the single get_weather tool is underdeveloped for the apparent scope.

Completeness2/5

The one tool provides only a generic weather lookup, missing likely needed operations such as forecasts, historical weather, or alerts. This represents a significant gap for a weather server's expected capabilities.

Maintenance

ActivityMaintained
ResponsivenessNo issues