river-watershed-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@river-watershed-mcp What's the current stream flow and water temp at USGS 01646500?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
river-watershed-mcp
An MCP (Model Context Protocol) server that gives AI agents live access to bioregional river and watershed data, pulled directly from public U.S. federal APIs:
USGS NWIS (National Water Information System) — real-time stream flow, gage height, water temperature
EPA WQP (Water Quality Portal) — water-quality results ranked against EPA-style compliance thresholds
Built for the "Encrypt/access the river data" bioregional sensor bounty (#450).
Tools exposed
Tool | What it does |
| Live discharge (cfs), gage height (ft), and water temp for a USGS site number |
| Recent DO, pH, turbidity, temperature, E. coli, nitrate, phosphorus for a WQP site, each ranked |
| Composite 0–100 score across multiple sites in a basin (70% water-quality compliance, 30% live-flow gauge coverage) |
All three return a common SensorReading JSON shape (see src/schema.ts):
{
sensor_id: string;
sensor_type: "stream_flow" | "water_quality" | "basin_health";
location: { lat: number; lon: number; name?: string; huc_code?: string };
parameters: Record<string, { value: number; unit: string; compliance?: "good"|"fair"|"poor"|"unknown" }>;
observed_at: string; // ISO-8601
source: "USGS-NWIS" | "EPA-WQP" | "COMPOSITE";
}On the "bounty #450 sensor schema": I wasn't able to retrieve the exact
spec text for that field layout from this build environment's network
access. The schema above follows the common convention for bioregional
sensor-network payloads (typed location + parameters map + provenance +
timestamp). If the bounty spec differs, toSensorReading logic lives
entirely in src/usgs.ts, src/epaWqp.ts, and src/basinHealth.ts — remap
field names there.
Related MCP server: gagelink
Setup
npm install
npm run buildThen point any MCP-compatible client (Claude Desktop, Claude Code, etc.) at:
{
"mcpServers": {
"river-watershed": {
"command": "node",
"args": ["/absolute/path/to/river-watershed-mcp/dist/index.js"]
}
}
}Live demo
npm run build
npm run demosrc/demo.ts acts as an AI agent: it spawns the server over real MCP stdio
transport, lists its tools, then calls all three against real Potomac River
basin sites (USGS 01646500, 01651800).
Verified vs. not yet verified: the MCP protocol wiring (tool
registration, JSON-RPC over stdio, request/response shape) was verified live
in this repo's build environment — listTools() and callTool() both work
end-to-end against the compiled server. The underlying USGS/EPA HTTP calls
were not verified from that same environment, because its network
allowlist doesn't include waterservices.usgs.gov or
www.waterqualitydata.us (confirmed: a live call returns a clean fetch failed isError: true result — the server handles it correctly, but no
real river data crossed the wire). Run npm run demo on a machine with
normal internet access to see live values.
Example site numbers to try
01646500— Potomac River near Washington, DC01651800— Northeast Branch Anacostia River at Riverdale, MD01474500— Schuylkill River at Philadelphia, PA
Find any USGS site at https://waterdata.usgs.gov/nwis/inventory, and its
matching WQP ID is usually USGS-<site number>.
License
MIT
Available Tools
3 toolsget_basin_healthA
Get a composite bioregional basin/watershed health score (0-100) across a set of USGS monitoring sites, combining EPA water-quality compliance with live flow-gauge coverage. Pass every USGS site number in the basin you want scored together.
Inputs: basin_name (required), usgs_site_numbers (required), wqp_site_ids.
get_stream_flowA
Get live stream flow (discharge, gage height, water temperature) for a USGS monitoring site from the NWIS Instantaneous Values service. Site numbers are 8-15 digit USGS site codes, e.g. '01646500' (Potomac River near Washington, DC). Find sites at https://waterdata.usgs.gov/nwis/inventory.
Inputs: usgs_site_number (required).
get_water_qualityA
Get recent water-quality results (dissolved oxygen, pH, turbidity, temperature, E. coli, nitrate, phosphorus) for a monitoring site from the EPA Water Quality Portal, each ranked good/fair/poor against EPA-style compliance thresholds. Site ID format is '-', e.g. 'USGS-01646500'.
Inputs: wqp_site_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct data domain: stream flow is live hydrologic measurements, water quality is compliance-ranked sample results, and basin health is a composite score aggregating both. There is no overlap or ambiguity in purpose.
All three tools follow the consistent verb_noun pattern: get_stream_flow, get_water_quality, get_basin_health. The naming is predictable and clearly indicates the resource being accessed.
Three tools is well-scoped for a river watershed monitoring server. Each tool covers a major data category without unnecessary bloat or redundancy.
The core surface covers live flow, water quality, and an integrated health score, which addresses the primary needs of watershed monitoring. Minor gaps exist, such as no dedicated site metadata or historical data retrieval, but these are workarounds via external links and not critical to the main purpose.
Maintenance
Related MCP Connectors
Real-time water levels and flow rates from USGS stream gauges
Query real-time and historical USGS water data from ~8,000 stream gages and groundwater wells.
Access UK flood warnings, river levels, water quality, Met Office forecasts, and carbon data
River levels & flood alerts: USGS gauges. $0.01/query. Be born in one call — free testnet funds.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables querying USGS water data including real-time and historical streamflow, gage height, and water temperature from USGS gauges across the United States.3MIT
- AlicenseAqualityBmaintenanceProvides hydrology data (river levels, streamflow, flood forecasts, water quality) from USGS, NOAA, and SWOT, preserving units, datums, timezones, and data quality for AI agents.1371 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query live and historical USGS water data — real-time streamflow, gage height, temperature, precipitation, turbidity and other parameters — for individual gauge sites, and to discover which gauges are actively reporting a given parameter across a US state. Runs either as a keyless local stdio server or through a hosted gateway endpoint, with daily-value time series for trends and hydrographs.94 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables querying live USGS stream gauge data by river name or location, retrieving current water-quality readings (temperature, pH, dissolved oxygen, turbidity), and ranking locations by EPA Clean Water Act compliance scores and grades. Supports comparing multiple watersheds best-to-worst, with no API keys required.MIT