Skip to main content
Glama

Weather MCP

一个 FastMCP 服务器,从 Open-Meteo 获取天气数据,并通过 MCP Apps 渲染交互式天气仪表盘。

Weather MCP 仪表盘

功能

  • 按城市或地名搜索位置

  • 获取当前天气状况和最多 16 天的预报

  • 在摄氏度和华氏度之间切换

  • 显示天气描述和天气状况符号

  • 将位置和预报响应缓存五分钟

  • 在兼容的 MCP 主机中直接渲染仪表盘

Related MCP server: bridgemcp-server-weather

要求

  • Python 3.14+

  • uv

  • 支持 MCP Apps 的 MCP 主机,用于交互式仪表盘

设置

安装项目依赖:

uv sync

正常的非商业 Open-Meteo 使用无需天气 API 密钥。

运行服务器

通过默认的 stdio 传输方式运行服务器:

uv run python main.py

查看已注册的工具:

uv run fastmcp list main.py

预览仪表盘

FastMCP 包含用于应用工具的本地浏览器预览:

uv run fastmcp dev apps main.py

打开显示的本地 URL 并选择 weather_dashboard。该仪表盘支持搜索其他位置和切换温度单位。

MCP 工具

search_locations

查找匹配的位置,并返回其坐标、国家、地区和时区。

get_weather

获取某个位置的当前天气和每日预报。

参数:

  • location:城市或地名

  • forecast_days:预报天数,从 1 到 16

  • temperature_unit:celsius 或 fahrenheit

weather_dashboard

使用相同的天气参数打开交互式天气仪表盘。

项目结构

main.py                         MCP server entry point
src/tools.py                    MCP tool registration and response shaping
src/services/weather_service.py Open-Meteo client and response cache
src/formatting.py               UI-friendly forecast formatting
src/dashboard.py                Prefab MCP App UI

数据来源

天气数据由 Open-Meteo 提供,它整合了多个国家气象服务机构的预报。在商业部署之前,请查看 Open-Meteo 条款和许可。

Available Tools

3 tools
get_weatherC

Get current conditions and a daily forecast.

Inputs: location (required), forecast_days, temperature_unit. Returns: object

search_locationsC

Find weather locations matching a place name.

Inputs: query (required). Returns: result

weather_dashboardC

Show an interactive weather dashboard with location and unit controls.

Inputs: location (required), forecast_days, temperature_unit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct purpose: location search, weather data retrieval, and an interactive dashboard. No overlap or ambiguity in their functions.

    Naming Consistency4/5

    Two tools follow the verb_noun pattern (search_locations, get_weather), but weather_dashboard breaks the pattern by leading with a noun. This is a minor deviation that doesn't cause confusion.

    Tool Count4/5

    Three tools is lean but appropriately scoped for a weather server. It covers the essential workflows without unnecessary bloat.

    Completeness4/5

    The core workflow of searching locations and getting weather is covered. Missing advanced features like alerts or historical data, but these are not critical for a basic weather service.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time weather updates and city geocoding by integrating the Nominatim and Open-Meteo APIs. It enables users to retrieve current weather conditions for any location through natural language queries in MCP-compatible clients.
      ISC
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides weather data including current conditions, forecasts, and summaries via Open-Meteo with no API key required, enabling natural language queries through an MCP interface.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for worldwide weather data, using high-resolution GeoSphere Austria data for the Alpine region and Open-Meteo elsewhere. Provides current conditions, hourly forecasts, and daily outlooks with compact emoji-markdown output.
      4
      200 PyPI
      1
      MIT