KNMI Weather MCP

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • The MCP server uses .ENV for managing environment variables, particularly for storing the KNMI API key.

  • The MCP server utilizes NumPy for numerical operations in processing weather data.

  • The MCP server uses pandas for data manipulation and analysis of weather information.

KNMI 天气 MCP

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

特征

  • 获取荷兰任何地点的天气数据
  • 自动查找最近的 KNMI 气象站
  • 提供实时测量,包括:
    • 温度
    • 湿度
    • 风速和风向
    • 沉淀
    • 能见度
    • 气压
  • 天气状况的自然语言解释
  • 位置搜索功能
  • 详细日志记录

先决条件

  • 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 身份验证问题
  • 网络问题
  • 数据解析错误
  • 缺少测量值

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

FastMCP 服务器提供来自 KNMI 气象站的实时天气数据,允许用户通过自然语言查询访问荷兰任何地点的温度、湿度、风速和其他天气指标。

  1. Features
    1. Prerequisites
      1. Installation
        1. Running the Server
          1. Using Claude AI
          2. Manual Running
        2. Available Tools
          1. 1. what_is_the_weather_like_in
          2. 2. get_location_weather
          3. 3. search_location
          4. 4. get_nearest_station
        3. Logging
          1. Data Sources
            1. Error Handling
              ID: xanerdcjsm