Skip to main content
Glama
MCP Weather Server

MCP Weather Server

by damerakd

MCP Weather Server

This repository provides a simple Model Context Protocol (MCP) server written in Python that exposes weather data as tools. It is packaged so it can be published to GitHub and (optionally) to PyPI.

The server is built on the official mcp Python SDK and uses the free Open‑Meteo APIs (no API key required).

Features

  • MCP-compliant server using FastMCP

  • Two tools:

    • get_current_weather – current conditions for a city

    • get_daily_forecast – daily forecast for a city for the next N days

  • Runs locally in Python (stdio transport by default)

Installation

From the project root:

pip install -e .

Or, using uv:

uv sync

Running the MCP server locally

You can run the server directly via the console script:

python -m mcp_weather_server.server

Or, if installed as a package:

mcp-weather-server

By default it uses the stdio transport, which works with MCP-compatible clients (e.g. IDE integrations or LLM apps that support MCP).

Connecting with MCP Inspector (optional)

To experiment via HTTP instead of stdio, you can set the transport to streamable-http inside server.py and then run:

uv run --with mcp python -m mcp_weather_server.server

Then start the MCP Inspector:

npx -y @modelcontextprotocol/inspector

and connect to http://localhost:8000/mcp.

Git conventions

  • Commit messages must follow Conventional Commits (e.g. feat: add daily forecast tool, fix(server): handle API errors).

  • A Cursor rule at .cursor/rules/git-conventional-commits.mdc documents the allowed types and format.

Available Tools

2 tools
get_current_weatherA

Get current weather conditions for a city.

Args: city: City name, e.g. "Berlin". country: Optional country filter, e.g. "DE" or "Germany".

Returns: A JSON object with location info and current weather (temperature, wind speed, etc.).

Inputs: city (required), country. Returns: result

get_daily_forecastB

Get a simple daily weather forecast for the next N days for a city.

Args: city: City name, e.g. "Berlin". country: Optional country filter, e.g. "DE" or "Germany". days: Number of days to include (1–7).

Returns: A JSON object with location info and an array of daily forecasts.

Inputs: city (required), country, days. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: get_current_weather retrieves current conditions, while get_daily_forecast provides future predictions. There is no overlap in functionality, and an agent can easily differentiate between immediate weather data and multi-day forecasts.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive names (current_weather, daily_forecast). The naming is uniform and predictable across the toolset, making it easy for agents to understand and use them.

    Tool Count2/5

    With only 2 tools, the server feels under-scoped for a weather domain. A typical weather API would include more operations such as historical data, alerts, or hourly forecasts. This minimal set limits agent capabilities and may require workarounds for common weather-related tasks.

    Completeness2/5

    The toolset is severely incomplete for a weather server. It lacks essential operations like historical weather data, severe weather alerts, air quality information, and hourly forecasts. Agents will face significant gaps when trying to perform comprehensive weather analysis or respond to diverse user queries.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server that provides current weather for any city using Open-Meteo APIs. It exposes a single tool 'get_weather' returning temperature, humidity, wind, and other weather data.
      1
      12 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server providing weather data via the Open-Meteo API, including geocoding, current conditions, daily and hourly forecasts, and city lookup. No API key required, with support for multiple units and transport types.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Python MCP server that provides current weather conditions and multi-day forecasts for cities worldwide using the Open-Meteo API. It exposes tools to get current weather and forecasts without requiring an API key.
      -