Us Drought Monitor Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.2.0更新於 Oct 26, 2026

Query U.S. Drought Monitor severity, DSCI, population, and drought duration.

已驗證Streamable HTTP可網頁執行位置與生活資料與分析

概覽

AI 產生的概覽

查詢美國乾旱監測資料:目前與歷史乾旱嚴重程度、DSCI、人口、排名,以及各郡乾旱持續週數。

可以做什麼
  • 查詢乾旱等級、DSCI 公式、涵蓋範圍,以及州、郡、HUC 流域、部落區域、氣候分區與河流預報中心的精確地理識別碼
  • 取得目前或指定日期的嚴重程度快照,包含面積百分比、平方英里、人口數,以及 DSCI 與其 4 週、52 週變化
  • 取得最多 100 個區域的每週時間序列,並附上缺漏資料區間與峰值摘要
  • 依 DSCI 或 D2+/D3+ 覆蓋率對州或郡排名,也可依相對基準週的變化排名
  • 統計某郡在指定等級或更嚴重條件下連續或非連續的乾旱週數
  • 將大型結果暫存為資料表,並以唯讀 DuckDB SQL 檢視與分頁
適用情境
適合需要權威美國乾旱統計的情境,例如撰寫報告、研究、區域比較,包括查詢某郡目前狀況、追蹤乾旱趨勢或對州與郡排名。它是資料擷取與分析工具,不用於判定補助資格或提供官方建議。
執行需求
可使用託管的遠端端點,或透過 npx(Node.js)或 Docker 在本機執行;不需要 API 金鑰或帳號。需要能連線至上游 USDM 資料服務的網路。選用環境變數可控制傳輸方式、HTTP 主機/連接埠/路徑、驗證模式、日誌等級、上限截斷與暫存行為;暫存與 SQL 需要原生 DuckDB,npm 與 Docker 安裝已包含。
安裝前請注意
對上游資料為唯讀,但暫存畫布權杖被描述為可分享且會過期的能力憑證,應視同憑證保管。當 DROUGHT_DATAFRAME_DROP_ENABLED 設為 true 時,選用工具 drought_dataframe_drop 會刪除暫存表。DSCI 是上游實驗性指數,人口數據為粗略的普查推估,乾旱持續週數不代表補助資格。將 MCP_AUTH_MODE 設為 jwt 或 oauth 需自行設定憑證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Us Drought Monitor Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fus-drought-monitor-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "us-drought-monitor": {
      "type": "http",
      "url": "https://us-drought-monitor.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/us-drought-monitor-mcp-server

Query U.S. Drought Monitor severity, DSCI, population, and drought duration via MCP. STDIO or Streamable HTTP.

8 Tools (1 opt-in)


Overview

Weekly drought statistics from the U.S. Drought Monitor (USDM) data services. Snapshot an area's current or dated severity, follow weekly history, rank states and counties, and count county weeks in drought across national, state, county, HUC watershed, tribal, climate-division and River Forecast Center geographies. Large results stage as tables for read-only SQL. No API key is required.

The caller guide covers interpretation and complete analytical retrieval; the server also serves it as a skill resource.

Tools

ToolDescription
drought_list_referenceBrowse drought categories, DSCI formulas, coverage and exact geography identifiers
drought_get_current_severityCurrent or dated snapshot with area, square miles, population, DSCI and 4/52-week DSCI change
drought_get_timeseriesWeekly metrics and DSCI for explicit areas, with missing-data runs and peak summaries
drought_compare_areasRank states or counties by DSCI or D2+/D3+ coverage, or by change from a baseline week
drought_get_weeks_in_droughtCounty consecutive streaks or non-consecutive week counts at a drought category or worse
drought_dataframe_describeInspect a staged canvas: tables, columns, expiry and full producer metadata
drought_dataframe_queryPage read-only SQL over staged drought tables
drought_dataframe_dropRemove one disposable staged table; opt-in via DROUGHT_DATAFRAME_DROP_ENABLED=true

Capability reference

drought_list_reference tool

  • topic: categories, dsci, area_types, coverage, states, counties, tribal, climate_divisions, river_forecast_centers or huc; nameContains token filter, state for counties or climate divisions, hucLevel (2, 4, 6 or 8) required for huc. Optional parentHuc selects descendants of an existing shorter HUC at level 2, 4 or 6
  • Default 25 records per page, clamped to 200; continued via nextCursor with unchanged filters. Explicit pages return the effective count, fewer only at exhaustion; totalCount counts every match
  • Records keep leading-zero identifiers, climate-state postal codes and source vintages; bundleVersion and topic-dependent sourceMetadata (source URLs and SHA-256 hashes) date the offline bundle. provenance.sourceUrls uses the same source selection

drought_get_current_severity tool

  • One area (areaType + aoi, plus hucLevel for HUC; aoi takes an exact identifier or exact state or "County Name, ST" name); unique suffix-free county names such as "King, WA" are accepted after exact-name matching. Optional date defaults to the latest published map; us selects both CONUS and Total
  • Each snapshot carries cumulative and categorical area percent, cumulative square miles, cumulative population (populationStatus unsupported outside US/state/county), dsci, and dsciChange4Weeks / dsciChange52Weeks against exactly 28 and 364 days earlier, each with an available / missing / before_coverage status
  • A date outside published coverage returns found: false with guidance
  • River Forecast Centers use areaType: "river_forecast_center" with an official code (for example CBRFC) or exact name (Colorado Basin); area percentages, square miles and DSCI are supported. Unknown RFCs fail local reference resolution

drought_get_timeseries tool

  • 1–100 areas sharing one areaType and HUC level; inclusive startDate / endDate; metric area_percent (default), area_sq_miles, population_percent or population_count (US/state/county only); statisticsType cumulative (default) or categorical
  • Rows carry the metric buckets plus dsci; missingAreas, missingObservations (date runs per metric and DSCI component) and per-area summary (every tied peak) cover the complete series
  • Rows past the inline budget stage behind a preview, with the table in staging; optional canvas_id stages into an existing canvas. Metadata remains complete inline whenever it fits. Overflow automatically retains complete rows and metadata, including zero-observation results; metadata_pages gives each array's total, returned count and next offset

drought_compare_areas tool

  • scope states or counties (optional state, else nationwide); metric dsci (default), d2_d4 or d3_d4; optional date (default latest) and baselineDate to rank the change; direction desc (default) or asc
  • Competition ranks share ties; excludedAreas names each area missing its target or baseline value; changeUnit is index or percentage_points
  • limit (default 20, clamped to 200) sizes the inline preview; the complete ranking stages, with optional canvas_id reuse

drought_get_weeks_in_drought tool

  • startDate, endDate, minCategory (D0–D4) and minWeeks required; mode consecutive (default) or non_consecutive; states or one county, never both, or neither for nationwide counties
  • Rows give fips, county, state, and either startDate / endDate / consecutiveWeeks or nonConsecutiveWeeks; a county qualifies when any part of it reaches the category or worse, and streaks are bounded by the requested window
  • Consecutive startMayExtendEarlier and endMayContinue flag boundaries touching the effective window; they express uncertainty about continuation. The Monday end is compared with the final map Tuesday plus six days. Non-consecutive rows omit these flags
  • Default 25 rows per page, clamped to 200; nextCursor stays valid five minutes with unchanged filters. Explicit pages return the effective count, fewer only at exhaustion. Counts are duration statistics, not program eligibility

drought_dataframe_describe tool

  • canvas_id from a staging response; tables with SQL column types, row counts and expiry
  • With table_name, that table's full producer metadata: requested and effective ranges, units, bucket-column mapping, missing data, summaries and provenance
  • Oversized metadata returns first-page prefixes with metadata_pages. To read a complete retained collection, supply table_name, metadata_field (areas, summary, missingAreas, missingObservations), metadata_offset and metadata_limit (default 20, clamped to 100); follow metadata_page.next_offset until null. Explicit pages return the effective count, fewer only at exhaustion, from the same snapshot without fetching upstream again

drought_dataframe_query tool

  • canvas_id plus one DuckDB read expression with an optional terminal semicolon; writes, multiple statements, external reads and system catalogs are refused
  • A column named current_schema must be table-qualified (t.current_schema); unqualified references are refused because DuckDB can bind them as an engine-settings function
  • limit (default 25, clamped to 500) and offset up to 250,000; continue next_offset with identical SQL until null. Explicit pages return the effective count, fewer only at exhaustion, regardless of cell width. SELECT * FROM <table_name> ORDER BY row_id returns the original rows in order
  • countIsExact is true only when one page from offset 0 holds every row; use SELECT COUNT(*) for totals

drought_dataframe_drop tool

  • canvas_id and table_name; removes the analytical copy only, returning dropped: false when the table is already gone; an expired canvas fails as canvas_not_found
  • Opt-in: absent from tools/list unless DROUGHT_DATAFRAME_DROP_ENABLED=true

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.

USDM-specific:

  • Fixed-origin client for the USDM data services (usdmdataservices.unl.edu): no key, at most 64 upstream requests and 64 MiB per call, three concurrent upstream requests, one retry that honors Retry-After
  • Dates snap to the containing Tuesday–Monday map week; coverage starts 2000-01-04, and the latest map (usually published Thursday) is discovered from upstream
  • Cumulative buckets (d1_d4 = D1 or worse) overlap; categorical buckets (d1_only) are exclusive. DSCI is upstream's experimental 0–500 index, never recomputed
  • Offline geography bundle: 52 states and jurisdictions, 3,230 counties (Connecticut planning regions included), 323 tribal areas, 357 climate divisions, 13 River Forecast Centers and 2,916 HUCs, refreshed by scripts/update-reference-data.ts
  • Staged tables live in DuckDB with a 30-minute sliding lifetime renewed by queries; canvas tokens are tenant-scoped, shareable capabilities, so treat them as credentials
  • At the four-canvas process cap, omitted-token staging reuses the tenant's most recently used service-owned canvas with a free slot (eight tables per canvas). Explicitly supplied canvases remain caller-owned; live tables are never evicted. staging_capacity_exhausted advises token reuse or expiry, while staging_busy advises waiting for active work. The two-workflow admission bound applies before fetching, including inline reads
  • Connecticut's eight legacy county FIPS remain discoverable but are omitted from comparison populations. Their empty observation lookups explain that USDM serves Connecticut by planning region; call drought_list_reference with topic: counties, state: CT. Counties are never mapped onto different planning-region boundaries; currentUsdm: false alone is not a historical-coverage rule
  • Node acquisition uses a private reusable Undici HTTP/1.1 dispatcher, released during server teardown; Bun retains native fetch

Agent-friendly output:

  • Reference records, query rows and describe columns use compact tables with JSON cells; empty cells distinguish absent optional fields from null values. Metadata, nested values and clickable URLs remain complete on both response surfaces
  • Positive integer page/preview limits above 200 (references, comparisons, duration), 500 (SQL), or 100 (metadata) are clamped; effectiveLimit and limitNotice disclose the result. Set DROUGHT_CLAMP_LIMITS=false to advertise and enforce these maxima instead. Clamps emit a request log and the drought.limit_clamps counter. Continuation retains every record. Nonpositive and fractional limits are rejected; count ceilings do not bound response bytes
  • Date inputs advertise YYYY-MM-DD and validate real calendar dates; blank optional snapshot and comparison dates retain their defaults. A duration threshold beyond its window advises lowering minWeeks or widening the dates
  • Provenance on every response: sourceUrls, retrievedAt, the USDM credit line and the experimental-DSCI citation
  • Supported population snapshots and population series add provenance.populationInterpretation, retained through dataframe describe/query: USDM population figures are rough census-based estimates assuming uniform population within counties, with artificial precision rather than exact contemporary headcounts. Source values remain unchanged; no census vintage is inferred
  • Missing data stays explicit: nulls with dsciStatus / populationStatus, missingAreas, missingObservations date runs and excludedAreas, never zero-filled
  • Range and identity echo: requestedRange / effectiveRange, latestMapDate, resolvedAreas, and staging handles that name drought_dataframe_describe and drought_dataframe_query

Getting started

Connect to the hosted instance:

sh
claude mcp add --transport http us-drought-monitor-mcp-server https://us-drought-monitor.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add us-drought-monitor-mcp-server -- npx -y @cyanheads/us-drought-monitor-mcp-server

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

json
{  "mcpServers": {    "us-drought-monitor-mcp-server": {      "command": "npx",      "args": ["-y", "@cyanheads/us-drought-monitor-mcp-server"]    }  }}

No API key or account is required. Set DROUGHT_DATAFRAME_DROP_ENABLED=true to expose table removal. For Docker or a source build, see Running the server.

Configuration

VariableDescriptionDefault
DROUGHT_DATAFRAME_DROP_ENABLEDExpose drought_dataframe_drop for disposable staged tables.false
DROUGHT_CLAMP_LIMITSClamp oversized positive limits; false advertises and enforces maxima.true
CANVAS_PROVIDER_TYPEAnalytical engine: duckdb, or none to disable staging and SQL.duckdb
CANVAS_DEFAULT_MEMORY_LIMIT_MBMemory limit per canvas engine.128
CANVAS_MAX_CANVASES_PER_TENANTProvider canvas cap; the server separately admits four live canvases per process.4
CANVAS_DEFAULT_ROW_LIMITProvider query row cap; at least 501 when the canvas is enabled.10000
CANVAS_TTL_MSSliding canvas lifetime, in ms; staged tables expire after 30 minutes without use.86400000
CANVAS_ABSOLUTE_CAP_MSAbsolute canvas lifetime, in ms.604800000
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_HOSTHTTP bind address.127.0.0.1
MCP_HTTP_PORTHTTP server port.3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path./mcp
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.).info
LOGS_DIRDirectory for log files (Node.js only).<app-root>/logs
OTEL_ENABLEDEnable OpenTelemetry.false

See .env.example for every server setting and the common framework overrides.

Running the server

Local development

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

sh
git clone https://github.com/cyanheads/us-drought-monitor-mcp-server.gitcd us-drought-monitor-mcp-serverbun installcp .env.example .env# optional: set DROUGHT_DATAFRAME_DROP_ENABLED or canvas limits

Staging and SQL need native DuckDB, included in npm and Docker installs. The portable Claude Desktop .mcpb bundle fixes CANVAS_PROVIDER_TYPE=none: producers return complete inline results within acquisition limits. Explicit canvas tokens and dataframe operations still require an analytical provider; invalid, expired or foreign tokens never fall back to inline success.

  • Build and run the production version:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:http# orbun run start:stdio
  • Run checks and tests:

    sh
    bun run devcheck  # Lints, formats, type-checks, and morebun run test      # Runs the test suite

Docker

sh
docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/us-drought-monitor-mcp-server:latest

The image runs on Bun with native DuckDB, defaults to HTTP on port 3010 in stateless session mode, and logs to /var/log/us-drought-monitor-mcp-server. OpenTelemetry peer dependencies are installed by default; build with --build-arg OTEL_ENABLED=false to omit them.

To build locally, run docker build -t us-drought-monitor-mcp-server .. For stdio clients, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/us-drought-monitor-mcp-server:latest"].

Project structure

DirectoryPurpose
src/mcp-server/toolsTool definitions (*.tool.ts). Eight drought and dataframe tools.
src/services/droughtUSDM client, geography resolution, map-week dates, workflows, staging and rendering.
src/services/canvas-accessor.tsAccess to the framework DataCanvas configured at startup.
src/configEnvironment loading, canvas defaults, count schemas and clamp telemetry.
src/dataGenerated geography reference bundle (reference.json).
scripts/update-reference-data.tsMaintainer refresh of the reference bundle from official sources.
tests/Unit, contract and integration tests, mirroring the src/ structure.

Development guide

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

  • Handlers throw, framework catches — no try/catch in tool logic
  • Service errors carry the reason declared in each tool's inline errors[] contract
  • Register new tools in the createApp() arrays in src/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

The U.S. Drought Monitor is jointly produced by the National Drought Mitigation Center at the University of Nebraska-Lincoln, the United States Department of Agriculture, the National Oceanic and Atmospheric Administration and the National Aeronautics and Space Administration. Map courtesy of NDMC.

DSCI: Akyuz, F. A. 2017. Drought Severity and Coverage Index. United States Drought Monitor.

來源:README.md,提交 fcb98a2

工具

7

drought_list_reference

Look up drought reference data

Look up drought categories, DSCI formulas, metric support, publication coverage and exact geography identifiers. Filter complete families by nameContains before paging. Use state for counties or climate_divisions; huc requires hucLevel 2, 4, 6 or 8 and accepts a shorter parentHuc. Follow nextCursor with the same filters to browse every match.

輸入參數limitstatetopic必填cursorhucLevelparentHucnameContains

drought_get_current_severity

Get a drought severity snapshot

Get current or dated drought severity, cumulative and categorical area percentages, area square miles, supported population counts and experimental upstream DSCI. Resolve identifiers with drought_list_reference. DSCI changes use exactly 4 and 52 weeks earlier; missing observations remain null. US selects both CONUS and Total.

輸入參數area必填date

drought_get_timeseries

Get weekly drought observations

Get weekly drought metrics and experimental DSCI for 1–100 explicit areas sharing one geography type and HUC level. Resolve identifiers with drought_list_reference. Dates select inclusive Tuesday map weeks. Missing values remain null; summaries include every tied peak. Large results are staged when analytics is enabled; use the returned dataframe tools to read every row and retained metadata page. Without analytics, complete results remain inline within acquisition limits.

輸入參數areas必填metricendDate必填canvas_idstartDate必填statisticsType

drought_compare_areas

Compare drought severity across areas

Rank all supported states, or counties within an optional state, on one published map. Omit state for nationwide supported counties. With baselineDate, rank target minus exact baseline; missing sides are excluded explicitly. Equal values share competition rank. limit controls a staged preview; without analytics, complete rankings remain inline within acquisition limits.

無需輸入參數。

drought_get_weeks_in_drought

Get county weeks in drought

Get authoritative consecutive streaks or non-consecutive week counts when any county area meets the selected drought category or worse. Supply states or one county, never both; omitted selectors mean supported nationwide counties. Counts are duration statistics, not program eligibility. Follow nextCursor with unchanged filters within five minutes.

輸入參數modelimitcountycursorstatesendDate必填minWeeks必填startDate必填minCategory必填

drought_dataframe_query

Query staged drought data

Run one DuckDB read expression against staged drought tables, optionally ending with one semicolon. Get canvas_id from drought_get_timeseries or drought_compare_areas and inspect columns with drought_dataframe_describe. For every original row, SELECT * FROM the table ORDER BY row_id and follow next_offset until null. Arbitrary SQL pagination requires your own stable ORDER BY. Exact totals require SELECT COUNT(*).

輸入參數sql必填limitoffsetcanvas_id必填

drought_dataframe_describe

Describe staged drought tables

Inspect tables and column types in a canvas_id returned by drought_get_timeseries or drought_compare_areas. Supply table_name for its complete source query, area/date/metric, units, missing-data and provenance metadata. Omit table_name for bounded schema summaries. Tokens are shareable capabilities and expire; this tool never lists other tokens.

輸入參數canvas_id必填table_namemetadata_fieldmetadata_limitmetadata_offset

版本歷史

4
  1. v0.2.0最新Oct 26, 2026
  2. v0.1.3Oct 24, 2026
  3. v0.1.2Oct 20, 2026
  4. v0.1.1Oct 20, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分