Skip to main content
Glama
itachiuchihadev

weather-mcp-server

README.md
# Weather MCP Server

A Model Context Protocol (MCP) server that provides weather forecasts and geocoding lookup using the free, keyless Open-Meteo APIs. This server enables LLMs (like Claude, Gemini, and GPT) to query real-time weather information and multi-day forecasts for any city or location in the world.

## Features

- **Get Current Weather:** Detailed current conditions including condition description, temperature, apparent temperature (feels like), humidity, wind speed, and precipitation details.
- **Multi-day Weather Forecast:** Standard 1-7 day forecast with conditions, daily min/max temperatures, and total expected precipitation.
- **Keyless & Free:** Powered by the open-source [Open-Meteo](https://open-meteo.com/) APIs, requiring no API keys or subscription signups.
- **Fuzzy Geocoding:** Automatically resolves location names (e.g., "Paris", "New York", "London") to geographic coordinates and timezones.

---

## Installation & Usage

You can run this server directly from npm using `npx`, or install it globally.

### Method 1: Using `npx` (Recommended)

To run the server without installation:

```bash
npx -y weather-mcp-server
```

### Method 2: Global Installation

Install the package globally:

```bash
npm install -g weather-mcp-server
```

Then run it:

```bash
weather-mcp-server
```

---

## Configuration for MCP Clients

### 1. Claude Desktop

To add the Weather MCP Server to Claude Desktop, edit your `claude_desktop_config.json` file.

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

Add the server to the `mcpServers` list:

```json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": [
        "-y",
        "weather-mcp-server"
      ]
    }
  }
}
```

### 2. Cursor

Cursor supports custom MCP servers directly from the GUI:

1. Open **Cursor Settings** (`Ctrl + ,` or `Cmd + ,`).
2. Go to **Features** -> **MCP**.
3. Click **+ Add New MCP Server**.
4. Fill in:
   - **Name:** `Weather`
   - **Type:** `command`
   - **Command:** `npx -y weather-mcp-server`
5. Click **Save**.

---

## Tool Documentation

This server exposes a single tool called `get_weather`.

### `get_weather`

Gets the current weather and daily forecast for a given location.

**Arguments:**
- `location` (string, required): The city, region, or location name (e.g. `"Tokyo"`, `"Paris"`, `"Chicago, IL"`).
- `days` (number, optional, default: `3`): Number of forecast days to return (integer between `1` and `7`).

**Example Request:**
```json
{
  "name": "get_weather",
  "arguments": {
    "location": "Paris",
    "days": 3
  }
}
```

---

## Development & Building

If you want to run the server locally from the source code, follow these steps:

1. Clone or download the repository.
2. Install dependencies:
   ```bash
   npm install
   ```
3. Build the TypeScript code:
   ```bash
   npm run build
   ```
4. Run locally:
   ```bash
   npm start
   ```

To link and test the local version in Claude Desktop, point the configuration directly to the local path:

```json
{
  "mcpServers": {
    "weather-local": {
      "command": "node",
      "args": [
        "C:/path/to/your/project/dist/index.js"
      ]
    }
  }
}
```

## License

ISC License. Feel free to use and adapt this server.

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap. Every tool (the only tool) has a clearly distinct purpose.

Naming Consistency5/5

The single tool name 'get_weather' follows a consistent verb_noun pattern, which is a standard and clear convention. There are no other tools to create inconsistency.

Tool Count2/5

The server has exactly one tool, which feels too thin for the apparent scope of a weather service. While the tool covers current and forecast data, a typical weather server might offer additional operations like alerts or historical data.

Completeness4/5

The single tool covers the core weather use case of current conditions and 1-7 day forecast. Minor gaps exist—such as weather alerts, historical data, or multi-location retrieval—but they are not essential to the primary purpose.

Maintenance

ActivityStale
ResponsivenessNo issues