@cyanheads/open-meteo-mcp-server

中文文档
0.6.0发布于 2026/11/10Apache-2.0ES Module近 30 天下载 2001

Geocode places, fetch global weather forecasts, historical climate, marine conditions, air quality, and terrain elevation via MCP. STDIO or Streamable HTTP.

原始使用文档
文档目录26 节
  1. Overview
  2. Tools
  3. Capability reference
  4. openmeteo_search_locations tool
  5. openmeteo_get_forecast tool
  6. openmeteo_get_historical tool
  7. openmeteo_get_marine tool
  8. openmeteo_get_air_quality tool
  9. openmeteo_get_elevation tool
  10. openmeteo_get_ensemble tool
  11. openmeteo_get_flood tool
  12. openmeteo_get_climate tool
  13. openmeteo_dataframe_describe tool
  14. openmeteo_dataframe_query tool
  15. openmeteo_dataframe_drop tool
  16. Features
  17. Getting started
  18. Configuration
  19. Running the server
  20. Local development
  21. Docker
  22. Project structure
  23. Development guide
  24. Attribution
  25. Contributing
  26. License

@cyanheads/open-meteo-mcp-server

Geocode places, fetch global weather forecasts, historical climate, marine conditions, air quality, and terrain elevation via MCP. STDIO or Streamable HTTP.

12 Tools

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework


Overview

Global weather from Open-Meteo: forecasts, history back to 1940, marine conditions, air quality, probabilistic ensembles, river discharge, and climate projections. Look up any place by name, pull hourly and daily variables, and run SQL over large results. No API key required.

Tools

ToolDescription
openmeteo_search_locationsResolve a place name to ranked coordinates with country, region, timezone, and population
openmeteo_get_forecastCurrent conditions and hourly/daily forecast up to 16 days, with up to 92 past days, from best match or chosen models side by side
openmeteo_get_historicalHourly/daily history from the reanalysis archive, 1940 to present
openmeteo_get_marineWave, swell, and sea-surface conditions: current, up to 8 forecast days, or an archive range, in metric or imperial units
openmeteo_get_air_qualityModeled CAMS pollutants, pollen, and AQI: current, up to 7 forecast days, or an archive range
openmeteo_get_elevationCopernicus DEM terrain elevation: up to 1,000 coordinate pairs, the first 100 sampled per call with the rest reported for resubmission
openmeteo_get_ensemblePer-member ensemble forecast (up to 64 members, up to 35 days) for exceedance and uncertainty
openmeteo_get_floodGloFAS river discharge: a ~6-month forecast or a date range (accepted from 1984-01-01; discharge begins 1997-01-01), from seamless or chosen v4 models
openmeteo_get_climateBias-corrected daily CMIP6 projections, 1950–2050, across up to 7 models
openmeteo_dataframe_describeList the tables and columns staged on a DataCanvas
openmeteo_dataframe_queryRun a read-only SQL SELECT against staged tables
openmeteo_dataframe_dropRemove one staged table or view from a DataCanvas (opt-in)

The server also publishes an agent skill, open-meteo-guide (skill://open-meteo-guide/SKILL.md, source in skills/open-meteo-guide/): which tool answers which question, plus the gates for exceedance odds, frost, comparisons to a normal, climate shifts, surf spots, river cells, and AQI timing.

Capability reference

openmeteo_search_locations tool

  • A bare place name ("Paris", not "Paris, France"), with optional country (ISO 3166-1 alpha-2: two letters, any case, never a country name) and language (default en); count 1–10, default 5
  • Each result carries coordinates, an IANA timezone, country / country_code, admin1 / admin2, population, and feature_code; no match fails as no_results
  • A notice flags a top match with null or sub-100,000 population, which often means a historic exonym ("Bangalore", "Calcutta")
  • A native-script query that misses under en is retried once in the language its script implies; effective_language names it when the retry succeeds (上海 → zh), and results come back localized

openmeteo_get_forecast tool

  • At least one of current_variables, hourly_variables, or daily_variables (up to 50 each), each also accepted as one comma-joined string and under Open-Meteo's own keys current, hourly, daily; forecast_days 1–16 (default 7), past_days 0–92 (default 0)
  • cell_selection (land, sea, nearest) picks the grid cell that answers: omitted, Open-Meteo answers from a land cell, so a point offshore reads on-shore conditions. Set sea for a point on the water (wind for sailing, surf, or offshore wind); a point on land keeps the default. The response latitude / longitude name the cell that answered
  • Per-timestamp hourly / daily records with hourly_units / daily_units; current_variables adds a current object from 15-minute data (interval 900) plus current_units
  • Omitting models reads Open-Meteo best_match; models compares deterministic models (e.g. ncep_gfs_seamless, ecmwf_ifs025, dwd_icon_seamless; older spellings like gfs_seamless still resolve). With 2+ models each hourly and daily column carries a model-name suffix, and models is echoed. current_variables takes at most one model (current_multi_model)
  • A regional model with no data at the point is dropped from a multi-model response: the notice names it, or, when one model is left with unsuffixed columns, says the values cannot be attributed to a model; when every requested model misses, the call fails as coverage_gap
  • Prefer past_days over openmeteo_get_historical for the last week, where the archive's ERA5 components lag

openmeteo_get_historical tool

  • start_date and end_date required (YYYY-MM-DD, from 1940-01-01), plus at least one of hourly_variables / daily_variables, named as on the forecast tool (a list or one comma-joined string, also under hourly / daily)
  • cell_selection (land, sea, nearest) works as on the forecast tool: omitted, a land cell answers, so a point offshore reads on-shore conditions; sea moves it onto the water
  • Omitting models reads Best Match (IFS HRES + ERA5 + ERA5-Land, source varies by date); up to 8 models pin a source. The ERA5 family runs about a week behind, ecmwf_ifs has no delay, and cerra covers Europe only
  • Output echoes models and the returned date_range; with 2+ models each column carries a model-name suffix. A model with no data at the point (cerra outside Europe) is dropped from a multi-model response; the notice names it, or, when one model is left with unsuffixed columns (era5,cerra), says the values cannot be attributed to a model

openmeteo_get_marine tool

  • One window per call: forecast_days 1–8 (upstream default 7) with past_days 0–92, or a start_date / end_date archive range back to at least 2022. Mixing them fails as forecast_window_conflict, a lone date as date_range_incomplete, and a date outside the range upstream accepts as date_out_of_range
  • At least one of current_variables, hourly_variables, or daily_variables (wave height, period, and direction, swell, sea-surface temperature); sheltered water returns near-zero waves, a point well inland returns nulls (named in the notice), a land point near the coast is answered from a nearby sea cell with real values and no notice (check the response's latitude / longitude is the water you meant), and ocean_current_velocity is null off the open ocean
  • current_variables takes the hourly names and adds a current object from 15-minute data (interval 900) plus current_units, alongside either window; a daily name there fails as variable_wrong_cadence
  • length_unit (metric / imperial) sets every height, sea_level_height_msl included, in m or ft; wind_speed_unit (kmh, mph, ms, kn) sets ocean_current_velocity; temperature_unit (celsius / fahrenheit) sets sea_surface_temperature. Open-Meteo converts the values, and the *_units maps label them (mph reads mp/h)

openmeteo_get_air_quality tool

  • One window per call: forecast_days 1–7 (upstream default 5) with past_days 0–92, or a start_date / end_date archive range from August 2022 (us_aqi starts a day later). Same forecast_window_conflict, date_range_incomplete, and date_out_of_range rejections as the marine tool
  • At least one of current_variables (a current object, interval 3600) or hourly_variables: PM2.5, PM10, NO2, SO2, O3, CO, dust, pollen, European and US AQI. Pollen is modeled for Europe only, in pollen season; elsewhere it comes back null and the notice names it
  • data_source: "CAMS" marks every response as modeled grid data, not station measurements

openmeteo_get_elevation tool

  • Parallel latitudes[] / longitudes[] arrays of up to 1,000 pairs; unequal lengths fail as coordinate_count_mismatch, compared on the full arrays
  • Samples the first 100 pairs (the Elevation API's per-request limit) in one upstream request; unprocessed_count says how many were left and next_offset is where to resume — resubmit latitudes.slice(next_offset) and longitudes.slice(next_offset) until next_offset is null. A call of 100 or fewer returns 0 / null. Each sampled pair counts as one call against Open-Meteo's per-IP limits (600 a minute), so a seventh 100-pair slice inside one minute comes back rate_limited
  • elevations[] in input order, each { latitude, longitude, elevation_m } from the Copernicus DEM (~90 m); elevation_m is null where the DEM has no value (latitude 90), without failing the rest of the call

openmeteo_get_ensemble tool

  • At least one of hourly_variables / daily_variables; forecast_days 1–35 (default 7), past_days 0–92. Most models end within 16 days (ncep_gefs05 runs to about day 34); past that, columns are null and the notice says where data ends
  • models takes one ensemble name (e.g. ecmwf_ifs025_ensemble, 51 members; gem_global_ensemble, 21); omitted or blank selects ecmwf_ifs025_ensemble, echoed in model
  • cell_selection (land, sea, nearest) works as on the forecast tool: omitted, a land cell answers; the response latitude / longitude name the cell that answered
  • Each variable returns per-member columns (temperature_2m_member01, …) across up to 64 members; member_count excludes the control run. A regional model queried outside its coverage fails as a non-retryable input error; switch to a global model

openmeteo_get_flood tool

  • daily_variables required (up to 20), all in m³/s: river_discharge plus the statistics river_discharge_mean / _median / _min / _max / _p25 / _p75, which carry ensemble spread on forecast-run days and repeat river_discharge on reanalysis days
  • One mode per call: forecast_days 1–210 (the current GloFAS run reaches about six months; later days are null), or a start_date / end_date range accepted from 1984-01-01, though discharge begins 1997-01-01 and earlier days are null. Mixing them fails as forecast_days_conflict, a lone date as date_range_incomplete, a date outside the range upstream accepts as date_out_of_range
  • Omitting models reads seamless_v4: consolidated_v4 reanalysis before 2023-08-05, forecast_v4 runs from then on. models: ["consolidated_v4"] reads the reanalysis from 1997-01-01 through 2025-05-31 (null outside that span, and on forecast_days); forecast_v4 starts 2023-06-01. Output echoes models; with 2+ models each column carries a model-name suffix, and the notice names null spans
  • Discharge comes from the GloFAS 0.05° grid cell nearest the coordinate, not reliably the cell on the river you mean; when the value is far below what the river carries, step the coordinate 0.05° across the channel and compare. Null outside GloFAS coverage

openmeteo_get_climate tool

  • start_date / end_date within 1950-01-01 to 2050-12-31 and daily_variables required (the API is daily-only); up to 7 CMIP6 models, e.g. CMCC_CM2_VHR4, MRI_AGCM3_2_S
  • With 2+ models each variable is suffixed with the model name; a single or omitted model returns plain names. A variable a model doesn't carry comes back null
  • cell_selection (land, sea, nearest) works as on the forecast tool, except that the response latitude / longitude can stay the same while the values change with it, so they do not show which cell answered

openmeteo_dataframe_describe tool

  • Takes the canvas_id a spilled weather tool returned; lists each table's name, kind, row_count, and columns (name, type, nullability), plus the canvas expires_at
  • Fails as canvas_not_enabled when canvas is off, or canvas_not_found when the ID is unknown or past its 24-hour sliding TTL

openmeteo_dataframe_query tool

  • canvas_id plus a read-only SELECT against the staged table_name; rows holds the first limit rows (default 25, each whole, values never cut). A larger limit returns at most 10,000 rows (or CANVAS_DEFAULT_ROW_LIMIT when lower) and a notice says so. row_count is the exact total and truncated is true when it exceeds rows; page with OFFSET <rows.length> under an ORDER BY
  • A page's size rests on limit and the columns selected, so from a member-suffixed ensemble table select the columns the question needs rather than SELECT *. One response carries at most 8,000,000 characters of row data (the rows written as JSON, a character that needs escaping counted at its escaped length); a larger page is refused as result_too_large, never cut, and the message says how many leading rows fit
  • If the count fails or runs past 5 seconds, rows still return, row_count is a lower bound, and count_error names the reason (e.g. count_timeout)
  • Fails as canvas_not_enabled, canvas_not_found, missing_table, system_catalog_access (system catalogs are blocked, and so is a DuckDB metadata view's name such as pg_class used as a column alias, CTE name, or table alias), or result_too_large. An error message relayed from the query engine is cut to 2,000 characters, keeping its code and reason

openmeteo_dataframe_drop tool

  • Off by default: listed as disabled until OPENMETEO_DATAFRAME_DROP_ENABLED=true
  • canvas_id plus the exact table_name from openmeteo_dataframe_describe; removes that one table or view and returns dropped and the remaining_tables. A name that is not staged returns dropped: false, so a repeated drop is safe
  • Fails as canvas_not_enabled, canvas_not_found, or invalid_table_name (not a plain SQL identifier, or a reserved keyword)

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

Open-Meteo-specific:

  • No API key for non-commercial use; commercial use requires Open-Meteo's paid API tier
  • Columnar API responses reshaped into per-timestamp records with *_units maps, on the same variable names across forecast and archive
  • DataCanvas spillover on the seven weather tools: with CANVAS_PROVIDER_TYPE=duckdb (the default) an over-budget result is staged as a DuckDB table (response carries canvas_id, table_name, truncated: true); with none it returns a bounded preview and truncated: true
  • models on the forecast, historical, ensemble, climate, and flood tools is not an allowlist, so a model Open-Meteo adds later works without a server update

Agent-friendly output:

  • Location-first workflow: openmeteo_search_locations returns the IANA timezone alongside coordinates, ready for any weather tool's timezone input (default auto)
  • Variable and model lists take an array or one comma-joined string ("temperature_2m,precipitation"); the *_variables fields also answer to Open-Meteo's own current, hourly, and daily keys where the tool has the field
  • Typed rejections: variable_wrong_cadence (names the correct field), request_too_large (names the inputs to narrow), coverage_gap (a coordinate outside the dataset's grid or the model's domain), date_out_of_range (a date outside the range the archive, marine, air-quality, climate, or flood endpoint accepts), and rate_limited; only Too many concurrent requests is retried first. An outage that outlasts three attempts fails as upstream_unavailable, or upstream_timeout when the last attempt timed out
  • Request URLs never appear in error data or client-visible logs
  • One notice per response for what the data alone won't show: unserved variable names, nulls outside a dataset's coverage, and where spilled rows went

Getting started

Connect to the hosted instance, no install:

claude mcp add --transport http open-meteo-mcp-server https://open-meteo.caseyjhand.com/mcp

Or run it locally:

claude mcp add open-meteo-mcp-server -- npx -y @cyanheads/open-meteo-mcp-server

For other clients, add this to the MCP config file:

{
  "mcpServers": {
    "open-meteo-mcp-server": {
      "command": "npx",
      "args": ["-y", "@cyanheads/open-meteo-mcp-server"]
    }
  }
}

No API key is required for non-commercial use; commercial use requires Open-Meteo's paid API tier. For Docker or a source build, see Running the server.

Configuration

Every variable is optional.

VariableDescriptionDefault
OPEN_METEO_API_BASE_URLForecast and elevation API base URL.https://api.open-meteo.com
OPEN_METEO_ARCHIVE_BASE_URLHistorical archive API base URL.https://archive-api.open-meteo.com
OPEN_METEO_MARINE_BASE_URLMarine API base URL.https://marine-api.open-meteo.com
OPEN_METEO_AIR_QUALITY_BASE_URLCAMS air quality API base URL.https://air-quality-api.open-meteo.com
OPEN_METEO_GEOCODING_BASE_URLGeocoding API base URL.https://geocoding-api.open-meteo.com
OPEN_METEO_ENSEMBLE_BASE_URLEnsemble API base URL.https://ensemble-api.open-meteo.com
OPEN_METEO_FLOOD_BASE_URLGloFAS flood API base URL.https://flood-api.open-meteo.com
OPEN_METEO_CLIMATE_BASE_URLCMIP6 climate API base URL.https://climate-api.open-meteo.com
CANVAS_PROVIDER_TYPEduckdb stages over-budget weather results on a DataCanvas and enables the dataframe tools; none returns a bounded preview.duckdb
OPENMETEO_DATAFRAME_DROP_ENABLEDtrue makes openmeteo_dataframe_drop callable; otherwise it is listed as disabled.false
OPENMETEO_CLAMP_LIMITStrue lowers an openmeteo_dataframe_query limit above its per-call cap to the cap, with a notice; false advertises the cap as a maximum and rejects a larger value.true
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTHTTP server port.3010
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, notice, warning, error).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1.in-memory
OTEL_ENABLEDEnable OpenTelemetry.false

See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4.4 or higher (or Node.js v24+).

  • Clone and install:

    git clone https://github.com/cyanheads/open-meteo-mcp-server.git
    cd open-meteo-mcp-server && bun install
    
  • Build and run:

    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:stdio
    # or
    bun run start:http
    
  • Run checks and tests:

    bun run devcheck   # Lint, format, typecheck, security
    bun run test       # Vitest test suite
    bun run lint:mcp   # Validate MCP definitions against spec
    

Docker

docker run --rm -p 3010:3010 ghcr.io/cyanheads/open-meteo-mcp-server:latest

The image defaults to HTTP transport, stateless session mode, and logs to /var/log/open-meteo-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/open-meteo-mcp-server:latest"]. To build locally, docker build -t open-meteo-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools, initializes the Open-Meteo service and DataCanvas.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/tools/definitionsTool definitions (*.tool.ts), one file per tool.
src/mcp-server/toolsShared tool helpers — model catalog, cadence validation, columnar reshape, spillover, response notices.
src/services/open-meteoHTTP client for the Open-Meteo APIs — retry, error classification, coverage-gap rejection.
src/services/canvas-accessor.tsDataCanvas accessor shared by the spill-capable tools.
skills/Agent skill published over MCP and in the npm package, Docker image, and .mcpb bundle (open-meteo-guide).
tests/Unit, integration, fuzz, and smoke tests.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools in the tools[] array in src/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Attribution

Weather data by Open-Meteo.com, licensed CC BY 4.0.

Contributing

Issues are welcome. Run checks and tests before submitting:

bun run devcheck
bun run test

License

Apache-2.0 — see LICENSE for details.

版本与发布记录

@cyanheads/open-meteo-mcp-server 共发布 32 个版本,首次发布于 2026/05/30;过去 12 个月发布了 32 个版本。

版本发布日期距今
0.6.0latest2026/11/104 天前
0.5.02026/10/2916 天前
0.4.22026/10/2421 天前
0.4.12026/10/131 个月前
0.4.02026/10/041 个月前
0.3.112026/09/221 个月前

关于 @cyanheads/open-meteo-mcp-server 的常见问题

@cyanheads/open-meteo-mcp-server 是什么?

Geocode places, fetch global weather forecasts, historical climate, marine conditions, air quality, and terrain elevation via MCP. STDIO or Streamable HTTP.

如何安装 @cyanheads/open-meteo-mcp-server?

在项目目录运行 npm install @cyanheads/open-meteo-mcp-server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 open-meteo-mcp-server,可以用 npx open-meteo-mcp-server 直接运行。

@cyanheads/open-meteo-mcp-server 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cyanheads__open-meteo-mcp-server 是否存在。

@cyanheads/open-meteo-mcp-server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cyanheads/open-meteo-mcp-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cyanheads/open-meteo-mcp-server 可以商用吗?

@cyanheads/open-meteo-mcp-server 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cyanheads/open-meteo-mcp-server 的下载量有多少?

根据 npm 官方下载统计,@cyanheads/open-meteo-mcp-server 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,001 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cyanheads/open-meteo-mcp-server 还在维护吗?

最新版本 0.6.0 发布于 2026/11/10(4 天前);至今共发布 32 个版本,其中过去 12 个月发布了 32 个;首次发布于 2026/05/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。