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.
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.
| Tool | What it does | Needs |
|---|---|---|
| search_swat_models | Browse the example-model catalog (state, size, calibration status) | open |
| get_model_calibration | Calibration and held-out validation NSE / PBIAS for one model | open |
| query_groundwater | Nearest wells and lithology from the 28.8M-interval national inventory | open |
| query_pfas | National PFAS monitoring inventory by state or analyte | open |
| request_model | Preview what SWATGenX would build for a gauge or HUC12 outlet | open |
| get_engine_info | SWAT+ engine fork, compile guide (/compile-swat-plus), and toolchain pointers | open |
| get_access_info | The access ladder and your current tier | open |
| order_model | Order a real SWAT+ build (fair-use allocations apply) | API key |
| get_order_status | Track a build order to completion | API key |
| list_my_models | List your build orders | API key |
| download_model | Mint a 24-hour pull link; your agent saves the ZIP locally | API 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.
