Skip to main content
Glama

met-mcp

MET Norway (Yr) の天気予報を提供する MCP サーバーです。学習プロジェクトとして作られました。

利用方法は次の3つです。

  • npm: met-mcp — stdio 経由でローカル実行します。

  • リモート: https://met-mcp.met-mcp-worker.workers.dev/mcp — Cloudflare Workers 上の Streamable HTTP です。claude.ai のコネクタとして追加できます。

  • MCP レジストリ: io.github.trondbjoroy/met-mcp

ツール

  • geocode_location(name, latitude, longitude) — 地名から座標を検索します。MET にはジオコーディング API がないため、無料の Open-Meteo ジオコーダーを使用します。

  • get_forecast(latitude, longitude, hours) — MET Locationforecast 2.0 による1時間ごとの予報。世界中で動作しますが、北欧で最も正確です。

  • get_nowcast(latitude, longitude) — レーダーによる今後2時間の降水予報。北欧のみ。

  • get_weather_alerts(latitude?, longitude?) — ノルウェー政府公認の危険警報 (MetAlerts)。座標を省略するとノルウェー全国の警報を取得できます。

  • get_sun_events(latitude, longitude, date, utc_offset) — 日の出、日の入り、太陽南中時刻。世界的に対応。

  • get_ocean_forecast(latitude, longitude, hours) — ノルウェー沿岸の波の高さと海水温。

  • find_weather_stations(latitude, longitude, count) — 最寄りの公式気象観測所 (Frost) を検索します。

  • get_historical_weather(station_id, from, to, elements) — Frost アーカイブの日単位・過去の観測値。中にはとてつもなく古い観測所もあります。

Frost の2つのツールには、https://frost.met.no/auth/requestCredentials.html で入手できる無料のクライアント ID が必要で、それを FROST_CLIENT_ID 環境変数 (または worker の場合は Cloudflare シークレット) として設定します。他のツールには何も必要ありません。

ツール定義は src/tools.ts にあり、stdio サーバーと worker で共有されます。

Related MCP server: OpenWeatherMap MCP Server

ビルドとテスト

npm install
npm run build
npm test

このテストは、stdio 標準入出力経由でサーバーを起動し、両方のツールを実際の API に対して呼び出します。

Claude Code での使用

claude mcp add met-weather -- node C:\Users\trond\met-mcp\dist\index.js

その後、Claude に「バーゲンの明日の天気は?」と聞いてみます。

MET の利用規約

  • 連絡先を記載した識別可能な User-Agent を送信してください。MET_USER_AGENT 環境変数で設定します (例: met-mcp/0.1.0 you@example.com)。

  • 座標は小数第4位までにしてください。サーバーが自動的に丸めます。

  • データのライセンスは NLOD / CC BY 4.0 です。データを表示する際は MET Norway のクレジットを指示してください。

リモート版

worker/ には Cloudflare Workers へのデプロイが含まれています。createMcpHandler (MCP SDK v2) と MCP Streamable HTTP で、同じ2つのツールを提供します。開発は npm run dev、リリースは npm run deploy (いずれも worker/ から)。

仕組み

  • src/index.ts がサーバー全体です。stdio 経由で MCP を処理します。つまり stdin/stdout で JSON-RPC を行います。

  • 各ツールは Zod で入力スキーマを宣言します。MCP クライアント (Claude) がスキーマを読み取り、引数を検証します。

  • ツールの結果は content ブロックです。このサーバーは JSON をテキストとして、LLM が必要とするものだけに絞って返します。素の METAP レスポンスにはタイムステップが約90あり、フィールドもずっと多くなります。

  • console.log で stdout には絶対に出力しないでください。プロトコルストリームが壊れます。ログは stderr に出力します。

Available Tools

8 tools
find_weather_stationsFind weather stationsAInspect

Find the nearest official weather stations (Frost). Use the station id (e.g. SN50540) with get_historical_weather.

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

geocode_locationGeocode a place nameCInspect

Find latitude and longitude for a place name. Use the coordinates with the other tools.

Inputs: name (required), count.

get_forecastGet weather forecastAInspect

Get an hourly weather forecast from MET Norway (Yr) for a coordinate. Works worldwide, best coverage in the Nordics.

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

get_historical_weatherGet historical weatherAInspect

Daily historical observations from a weather station (Frost archive, some stations go back over 100 years). Find station ids with find_weather_stations.

Inputs: to (required), from (required), station_id (required), elements.

get_nowcastGet precipitation nowcastAInspect

Minute-by-minute precipitation for the next 2 hours, radar-based. Nordic region only. Answers 'do I need an umbrella right now?'

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

get_ocean_forecastGet ocean forecastCInspect

Wave height, wave direction, and sea temperature. Covers the Norwegian coast and nearby seas.

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

get_sun_eventsGet sunrise and sunsetBInspect

Sunrise, sunset, and solar noon for a coordinate and date. Works worldwide.

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

get_weather_alertsGet weather alertsAInspect

Official danger warnings (wind, flood, ice, forest fire...) from MET Norway. Covers Norway and its waters. Omit coordinates to get all current alerts. Alert text is in Norwegian.

Inputs: latitude, longitude.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a distinct weather data need: geocoding, hourly forecasts, nowcasting, alerts, solar events, ocean conditions, station lookup, and historical observations. The only potentially overlapping pair (get_forecast vs get_nowcast) is clearly separated by forecast horizon and description.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern, with get_ as the dominant prefix and find_/geocode_ as clear exceptions that still follow the same grammatical structure. This makes the tool surface highly predictable.

    Tool Count5/5

    Eight tools is well-scoped for a weather data server: each tool handles a specific data type or lookup step without redundancy. The count is large enough to cover the domain but small enough to avoid overwhelming an agent.

    Completeness5/5

    The tool set covers the full observation-to-forecast lifecycle: geocoding to obtain coordinates, station discovery for historical data, current conditions, short-term nowcast, forecast, alerts, ocean conditions, and solar events. No critical gaps are apparent for the stated weather domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides LLM-friendly weather tools and Norwegian place name resolution via MCP, enabling weather forecasts, air quality, marine conditions, and activity planning.
      1
      MIT
    • 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
      Not graded
      quality
      C
      maintenance
      Enables access to MET Norway weather data including global forecasts, Nordic nowcast, sunrise/sunset times, air quality, and ocean forecasts via natural language queries.
      59 npm
      MIT