Skip to main content
Glama
KNMI Weather MCP

KNMI Weather MCP

by wolkwork

KNMI 天气 MCP

FastMCP 服务器提供来自荷兰皇家气象局 (KNMI) 气象站的实时气象数据。该应用程序可从距离荷兰境内任意地点最近的气象站获取最近 10 分钟的测量数据。

特征

  • 获取荷兰任何地点的天气数据

  • 自动查找最近的 KNMI 气象站

  • 提供实时测量,包括:

    • 温度

    • 湿度

    • 风速和风向

    • 沉淀

    • 能见度

    • 气压

  • 天气状况的自然语言解释

  • 位置搜索功能

  • 详细日志记录

Related MCP server: mcp-server-weather-cuhksz

先决条件

  • Python 3.10 或更高版本

  • KNMI API 密钥(从KNMI 数据平台获取)

  • uv包管理器

安装

  1. 克隆存储库:

    git clone <repository-url>
    cd knmi-mcp
  2. 在项目根目录中创建一个.env文件:

    KNMI_API_KEY=your_api_key_here

运行服务器

使用 Claude AI

要将此应用程序与 Claude AI 一起使用,请在项目文件夹中运行以下命令:

uv run fastmcp install src/knmi_weather_mcp/server.py

这会将以下配置添加到您的 Claude 配置文件(通常位于~/Library/Application Support/Claude/claude_desktop_config.json ):

{
    "KNMI Weather": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "--with",
        "httpx",
        "--with",
        "netCDF4",
        "--with",
        "numpy",
        "--with",
        "pandas",
        "--with",
        "pydantic",
        "--with",
        "python-dotenv",
        "--with",
        "xarray",
        "fastmcp",
        "run",
        "/Users/<username>/<git location>/knmi-mcp/src/knmi_weather_mcp/server.py"
      ]
    }
}

注意:如果您看到如下错误:

spawn uv ENOENT

将uv命令替换为uv命令的完整路径。在 *nix 系统上,可以使用命令which uv找到。

手动运行

对于开发或独立使用:

uv run fastmcp run src/knmi_weather_mcp/server.py

可用工具

1. 天气怎么样

获取荷兰任何地点当前天气状况的自然语言解释。

例子:

await what_is_the_weather_like_in("Amsterdam")

2. 获取位置天气

获取某个地点的原始天气数据。

例子:

await get_location_weather("Rotterdam")

3. 搜索位置

搜索荷兰的地点。

例子:

await search_location("Utrecht")

4. 获取最近车站

查找距离给定坐标最近的 KNMI 气象站。

例子:

await get_nearest_station(52.3676, 4.9041)

日志记录

应用程序日志存储在logs/knmi_weather.log文件中,提供有关以下内容的详细信息:

  • API 请求和响应

  • 气象数据处理

  • 错误消息

  • 调试信息

数据源

该应用程序使用 KNMI 数据平台 API 从“Actuele10mindataKNMIstations”数据集中获取数据,该数据集提供荷兰所有 KNMI 气象站的 10 分钟间隔测量数据。

错误处理

该应用程序包括强大的错误处理功能:

  • 无效位置

  • API 身份验证问题

  • 网络问题

  • 数据解析错误

  • 缺少测量值

Available Tools

4 tools
get_location_weatherC

Get current weather data for a location

Inputs: location (required).

get_nearest_stationB
Find the nearest KNMI weather station to given coordinates

Args:
    latitude: Latitude in degrees
    longitude: Longitude in degrees

Inputs: latitude (required), longitude (required).

search_locationC
Search for locations in the Netherlands

Args:
    query: Search term for location

Inputs: query (required).

what_is_the_weather_like_inB
Get and interpret weather data for a location in the Netherlands

Args:
    location: City or place name in the Netherlands
Returns:
    A natural language interpretation of the current weather conditions

Inputs: location (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 4 tools

    Disambiguation4/5

    Tools are mostly distinct: search_location and get_nearest_station are clearly supporting, but get_location_weather and what_is_the_weather_like_in both provide current weather, albeit in different formats (data vs. natural language). This overlap could cause misselection.

    Naming Consistency3/5

    Three tools follow verb_noun pattern (get_location_weather, get_nearest_station, search_location), but what_is_the_weather_like_in deviates entirely into a conversational question, breaking consistency.

    Tool Count5/5

    With 4 tools, the server is well-scoped for a focused weather service covering location search, station lookup, and current conditions. Each tool serves a clear purpose without being excessive.

    Completeness3/5

    The tool set covers location search and current weather but lacks forecast, historical data, or station metadata. The domain of weather for the Netherlands has notable gaps that could hinder some agent tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    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