Skip to main content
Glama
MCP Weather Server

MCP Weather Server

by liusicheng

MCP Weather Server

A weather query MCP server based on FastMCP, providing current weather, future forecasts, Celsius/Fahrenheit conversion, popular city resources, and travel weather advice prompts.

The project includes two entry points:

  • server.py: Local stdio mode, suitable for local MCP clients like Claude Desktop, Cursor, and Cherry Studio.

  • server_remote.py: Streamable HTTP mode, suitable for deployment to remote hosting platforms like ModelScope.

Features

  • get_weather(city: str): Query current weather for a specified city.

  • get_forecast(city: str, days: int = 3): Query future weather forecast for a specified city, default is 3 days.

  • temperature_convert(value: float, from_unit: str): Convert between Celsius and Fahrenheit.

  • weather://cities: Returns a resource list of common cities.

  • travel_advisor(destination: str, date: str): Generate a travel weather advice prompt.

Weather data is provided by wttr.in, no additional API tokens required.

Related MCP server: weather-mcp-server

Requirements

  • Python >= 3.12

  • It is recommended to use uv for dependency management

Install Dependencies

uv sync

If you are not using uv, you can also install dependencies in a virtual environment:

pip install "mcp[cli]>=1.27.0" "httpx>=0.28.1"

Local Execution

stdio mode:

uv run python server.py

MCP client configuration example:

{
  "mcpServers": {
    "weather-server": {
      "command": "uv",
      "args": ["run", "python", "server.py"]
    }
  }
}

Remote Execution

Streamable HTTP mode:

uv run python server_remote.py

Default listening on:

http://0.0.0.0:8000/mcp/

Remote MCP client configuration example:

{
  "mcpServers": {
    "weather-server": {
      "url": "http://127.0.0.1:8000/mcp/"
    }
  }
}

ModelScope Deployment Instructions

When creating or deploying an MCP Server on ModelScope, you can enter the GitHub repository address of this project and use the remote entry file:

python server_remote.py

The service will start in Streamable HTTP mode, listening on 0.0.0.0:8000, with the MCP endpoint at:

/mcp/

If the platform supports custom startup commands, it is recommended to use:

uv run python server_remote.py

Or use it after installing dependencies in the platform environment beforehand:

python server_remote.py

Project Structure

.
├── README.md
├── pyproject.toml
├── server.py
├── server_remote.py
└── uv.lock

License

If you need to release it as open source, please add a License file according to your actual situation.

Available Tools

3 tools
get_forecastB

获取指定城市未来几天的天气预报。

参数:
    city: 城市名称(英文)
    days: 预报天数,默认 3 天,最多 3 天

Inputs: city (required), days.

get_weatherA

获取指定城市的当前天气信息。

参数:
    city: 城市名称(英文),如 Beijing、Tokyo、London

Inputs: city (required).

temperature_convertA

摄氏度与华氏度互相转换。

参数:
    value: 温度数值
    from_unit: 原始单位,C 表示摄氏度,F 表示华氏度

Inputs: value (required), from_unit (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_forecast for future days, get_weather for current conditions, and temperature_convert for unit conversion. No overlap exists.

    Naming Consistency4/5

    All tools use snake_case, but two follow verb_noun pattern (get_forecast, get_weather) while one uses noun_verb (temperature_convert), a minor inconsistency.

    Tool Count4/5

    3 tools is slightly below average for a weather server, but still reasonable for core functionality (current, forecast, conversion). The count feels lean but not insufficient.

    Completeness4/5

    Covers basic current weather and forecast, plus a unit converter. Missing features like alerts or historical data, but the essential weather information needs are met.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides real-time weather data, hourly forecasts, and daily summaries using the free Open-Meteo API with no API key required. It enables users to search for weather conditions by specific coordinates or city names across multiple measurement units.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Real-time weather query MCP server providing current weather for cities via wttr.in, with support for listing built-in city mappings and server metadata.
      MIT