Skip to main content

AI-Hydro: 17 hydrological research tools as an MCP server for AI agents

Project description

aihydro-tools

17 hydrological research tools as an MCP server for AI agents.

aihydro-tools is the Python backend for AI-Hydro, a VS Code extension that gives AI assistants direct access to hydrological analysis tools via the Model Context Protocol (MCP).

Install

pip install aihydro-tools

Or install with optional geo/analysis dependencies:

pip install aihydro-tools[data]       # streamflow, forcing, land cover
pip install aihydro-tools[analysis]   # watershed, signatures, TWI, CN
pip install aihydro-tools[modelling]  # differentiable HBV-light, LSTM
pip install aihydro-tools[all]        # everything above

Verify installation

aihydro-mcp --help

If aihydro-mcp is not found, pip installed it outside your PATH. Check these locations:

OS Typical location
Windows (user) %APPDATA%\Python\Python3XX\Scripts\aihydro-mcp.exe
Windows (system) C:\Python3XX\Scripts\aihydro-mcp.exe
macOS/Linux (user) ~/.local/bin/aihydro-mcp
macOS/Linux (system) /usr/local/bin/aihydro-mcp
Conda ~/miniconda3/bin/aihydro-mcp or ~/anaconda3/bin/aihydro-mcp

Tip: On Windows, replace 3XX with your Python version (e.g., 310 for Python 3.10).

Run the MCP Server

aihydro-mcp

This starts the MCP server on stdio, ready for any MCP client (AI-Hydro extension, Claude Code, Cursor, etc.).

Configure with AI-Hydro Extension

The AI-Hydro VS Code extension auto-detects aihydro-mcp on startup — both PATH and common pip install locations. If auto-detection succeeds, no manual setup is needed.

Manual configuration

If auto-detection fails, add the server manually to aihydro_mcp_settings.json:

Windows:

{
  "mcpServers": {
    "ai-hydro": {
      "command": "C:\\Users\\<USERNAME>\\AppData\\Roaming\\Python\\Python310\\Scripts\\aihydro-mcp.exe",
      "args": []
    }
  }
}

macOS/Linux:

{
  "mcpServers": {
    "ai-hydro": {
      "command": "/Users/<USERNAME>/.local/bin/aihydro-mcp",
      "args": []
    }
  }
}

Settings file locations:

  • Windows: %APPDATA%\Code\User\globalStorage\aihydro.ai-hydro\settings\aihydro_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage/aihydro.ai-hydro/settings/aihydro_mcp_settings.json
  • Linux: ~/.config/Code/User/globalStorage/aihydro.ai-hydro/settings/aihydro_mcp_settings.json

Tools (17)

Category Tools
Watershed delineate_watershed
Streamflow fetch_streamflow_data
Signatures extract_hydrological_signatures
Geomorphic extract_geomorphic_parameters
Terrain compute_twi
Curve Number create_cn_grid
Forcing fetch_forcing_data
CAMELS extract_camels_attributes
Knowledge query_hydro_concepts
Modelling train_hydro_model, get_model_results
Session start_session, get_session_summary, clear_session, add_note, export_session, sync_research_context

Example

You: "Delineate the watershed for USGS gauge 01031500 and fetch 10 years of forcing data."

AI-Hydro: [calls delineate_watershed → fetch_forcing_data]
          Watershed: 769 km², Piscataquis River ME
          Forcing: 3,652 days of GridMET data (prcp, tmax, tmin, PET, srad, wind)

Data Sources

  • USGS NWIS — daily streamflow via hydrofunctions
  • NHDPlus / NLDI — watershed delineation via pynhd
  • GridMET — climate forcing via pygridmet
  • 3DEP — DEM and terrain analysis via py3dep
  • NLCD / POLARIS — land cover and soils
  • CAMELS-US — catchment attributes via pygeohydro

Session Persistence

Every tool result is cached in a HydroSession (JSON file per gauge at ~/.aihydro/sessions/). Expensive computations are done once and reused across conversations.

Troubleshooting

"aihydro-mcp not found"

pip installed the executable outside your PATH. Either:

  1. Add the Scripts directory to PATH (see the table above for locations)
  2. Use the full path directly in your MCP configuration
  3. Re-install with --user flag removed: pip install aihydro-tools (may need admin/sudo)

"Connection closed" error

  • Use the aihydro-mcp executable, not python -m ai_hydro.mcp.app
  • Verify the path in your MCP settings matches the actual installed location
  • Check: pip show aihydro-tools to confirm it's installed

Re-install from scratch

pip uninstall -y aihydro-tools
pip install aihydro-tools

License

Apache 2.0

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aihydro_tools-1.0.5.tar.gz (138.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aihydro_tools-1.0.5-py3-none-any.whl (140.0 kB view details)

Uploaded Python 3

File details

Details for the file aihydro_tools-1.0.5.tar.gz.

File metadata

  • Download URL: aihydro_tools-1.0.5.tar.gz
  • Upload date:
  • Size: 138.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aihydro_tools-1.0.5.tar.gz
Algorithm Hash digest
SHA256 511f27aae86c9022189a138d957e8b8820a30a72588c3ce01446a8ee2cabac20
MD5 3d57b53232c42f442850049970af43e7
BLAKE2b-256 927e93ac5f236c33e8a96ff61e63b891a0b0523bd7abf75fa592d3c743ba48ff

See more details on using hashes here.

File details

Details for the file aihydro_tools-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: aihydro_tools-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 140.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aihydro_tools-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6653faf73343bac898cbb993351c3adb2ab90bb0351f61efdcef49ef756a24b0
MD5 24f03770f74502b84a14779aabab5cb4
BLAKE2b-256 17f9dcaa3c3eb3d159426e8ca8a9a0b4a172f5146cefed0601379f87cfa90684

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page