SWATGenXSWATGenX
Watershed ExplorerExample modelsCloud calibrationDocsAccess

For AI agents

SWATGenX has an MCP server

A public Model Context Protocol server over streamable HTTP. Add it to Claude or any MCP client and a continental watershed-modeling platform becomes 11 callable tools — 7 of them with no credentials at all.

Connect in 30 seconds Full developer API
$ claude mcp add --transport http swatgenx \ https://www.swatgenx.com/mcp ✓ connected — 11 tools available > "Find a calibrated SWAT+ model in Michigan and show its validation NSE." → search_swat_models(state="MI", calibrated=true) → get_model_calibration(model_id=…) NSE 0.71 daily · 0.83 monthly (held-out years)

Does SWATGenX have an MCP server?

Yes. SWATGenX runs a public Model Context Protocol server at https://www.swatgenx.com/mcp, over the streamable-HTTP transport with OAuth 2.1. Add it to Claude or any MCP client, sign in with a free SWATGenX account when prompted, and the platform becomes 11 callable tools. Scripts can authenticate with an API key as a Bearer token instead.

Most scientific platforms make an agent scrape a web app or reverse-engineer an API. SWATGenX exposes the platform directly: the same models, the same national datasets and the same quotas that the web application uses, as tools an agent can call.

How do I connect Claude to SWATGenX?

Add https://www.swatgenx.com/mcp as a streamable-HTTP MCP server in your client configuration. No install, no local process, no scraping. Your client discovers OAuth automatically and walks you through a one-click sign-in with a free SWATGenX account (GitHub-style: the data is public, the access is authenticated). Scripts and agents can instead send an API key as the Bearer token.

The endpoint — nothing to install, no local process:

https://www.swatgenx.com/mcp    (transport: streamable HTTP)

Client configuration:

{
  "mcpServers": {
    "swatgenx": {
      "type": "http",
      "url": "https://www.swatgenx.com/mcp"
    }
  }
}

Your MCP client discovers OAuth automatically and prompts a one-click sign-in with a free SWATGenX account. In Cursor, Claude Code, or any client configured from a file, skip the browser round-trip and authenticate with an API key in the headers instead:

{
  "mcpServers": {
    "swatgenx": {
      "type": "http",
      "url": "https://www.swatgenx.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY",
        "X-SWATGenX-Api-Key": "YOUR_API_KEY"
      }
    }
  }
}

Authorization: Bearer <your key> is the header that authenticates the connection — sending only X-SWATGenX-Api-Key returns 401. Include both: the second one is what the model-ordering tools read.

Keys come from your access settings. The server is also advertised to agents in this site's llms.txt.

What tools does the server expose?

11 tools. The read side is open to any agent; only building and downloading models consume an allocation.

ToolWhat it doesNeeds
search_swat_modelsBrowse the example-model catalog (state, size, calibration status)open
get_model_calibrationCalibration and held-out validation NSE / PBIAS for one modelopen
query_groundwaterNearest wells and lithology from the 28.8M-interval national inventoryopen
query_pfasNational PFAS monitoring inventory by state or analyteopen
request_modelPreview what SWATGenX would build for a gauge or HUC12 outletopen
get_engine_infoSWAT+ engine fork, compile guide (/compile-swat-plus), and toolchain pointersopen
get_access_infoThe access ladder and your current tieropen
order_modelOrder a real SWAT+ build (fair-use allocations apply)API key
get_order_statusTrack a build order to completionAPI key
list_my_modelsList your build ordersAPI key
download_modelMint a 24-hour pull link; your agent saves the ZIP locallyAPI key
  • 11 tools
  • OAuth 2.1 — free account
  • National groundwater + PFAS data

What data can an agent query?

If nothing seems to happen after you press Approve, reload the page — that is all it takes, and you do not need to change any browser or cookie setting. After the refresh, SWATGenX MCP will be connected. The reason is that the authorization only completes on that reload: the connector list does not always repaint on its own, so approving a second time does not help. If it is still unfinished, close any other Authorize tabs you have open, delete the half-created connector, and run the flow once from a single tab — a code sent back to a flow Claude has already abandoned is silently ignored. Only if both of those fail is it browser privacy blocking: the callback page needs claude.ai’s own session cookie, and Chrome’s third-party-cookie blocking or Safari’s content blockers can strip it, so Claude drops the connection with no error shown. In that case allow third-party cookies in Chrome (a site exception for claude.ai is enough) or turn off content blockers for claude.ai, reconnect, approve once — then restore your settings, since the cookie is only needed during the one-time handshake. In every case, make sure you are signed in to claude.ai in the same browser and use the exact server URL https://www.swatgenx.com/mcp, including the www.

The groundwater inventory is described in a preprint under open review at Earth System Science Data. Nothing is interpolated or gap-filled; every record traces to the agency that published it.

Common questions

What can an AI agent do with SWATGenX?

With a free SWATGenX account connected over OAuth, an agent can search the SWAT+ example-model catalog, read calibration and held-out validation scores, query the national groundwater inventory of 28.8 million lithology intervals, query the national PFAS monitoring inventory, and preview what a model of a given watershed would contain. With an API key it can also order a real SWAT+ build, track it, and download the finished model package.

How do I connect Cursor, Claude Code, or another client that uses a config file?

Add SWATGenX as a streamable-HTTP server and authenticate with an API key in the headers — no OAuth round-trip, which is what you want in an editor or a script. In Cursor, put this in your MCP settings; Claude Code and most other config-file clients accept the same shape: {"mcpServers": {"swatgenx": {"type": "http", "url": "https://www.swatgenx.com/mcp", "headers": {"Authorization": "Bearer YOUR_API_KEY", "X-SWATGenX-Api-Key": "YOUR_API_KEY"}}}}. The Authorization header is the one that gets you past the door — sending only X-SWATGenX-Api-Key returns 401, because the MCP transport reads Authorization. Sending both is the safe default: Authorization authenticates the connection and X-SWATGenX-Api-Key is what the model-ordering tools use. Get a key from your SWATGenX access settings, and treat it like a password — it is your account.

Is the SWATGenX MCP server free?

Yes — a free SWATGenX account is all you need. Catalog search, calibration results, groundwater and PFAS queries, and build previews are included. Ordering models consumes the same fair-use allocation as the web application and the REST API, so an agent cannot exceed what its user is entitled to.

What data can an agent query through SWATGenX?

A national groundwater inventory of about 28.8 million depth-resolved lithology intervals harmonized from state well registries, a national PFAS monitoring inventory, and the SWAT+ example-model catalog with calibration and validation statistics for each model. All of it is derived from public agency sources with provenance retained.

Does the MCP server let an agent build a watershed model?

Yes, with an API key. An agent calls order_model with a USGS gauge number, a HUC12 outlet or a HUC8 code, tracks the build with get_order_status, and retrieves the finished SWAT+ package with download_model. The build runs the same pipeline as the web application — NHDPlus HR hydrography, gSSURGO soils, NLCD land cover and PRISM climate.

Three ways in

MCP is one of three doors onto the same platform — the others are the REST API and the swatgenx Python package. Same national data, same SWAT+ and MODFLOW 6 models, same quotas.