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 13 callable tools. Every call needs a SWATGenX sign-in or an API key. The model, data and order tools are part of the paid plans; the documentation tools stay open to any account.
Watch: let your AI assistant use SWATGenX
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 your SWATGenX account when prompted, and the platform becomes 13 callable tools. The model, data and order tools are part of the paid plans; the documentation tools stay open to any account. 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 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 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?
13 tools. Every call needs a SWATGenX sign-in or an API key. The model, data and order tools are part of the paid plans; the documentation tools stay open to any account.
| Tool | What it does | Needs |
|---|---|---|
| search_swat_models | Browse the example-model catalog (state, size, calibration status) | paid plan |
| get_model_calibration | Calibration and held-out validation NSE / PBIAS for one model | paid plan |
| query_groundwater | Nearest wells and lithology from the national well inventory | paid plan |
| query_pfas | PFAS monitoring inventory by state or analyte | paid plan |
| request_model | Preview what SWATGenX would build for a gauge or HUC12 outlet | paid plan |
| get_engine_info | SWAT+ engine fork, compile guide (/compile-swat-plus), and toolchain pointers | any account |
| get_access_info | The access ladder and your current tier | any account |
| search_docs | Search the SWATGenX I/O reference (bundle layout, input files, units, run modes) | any account |
| get_doc | Read one full documentation chapter as markdown | any account |
| order_model | Order a real SWAT+ build (fair-use allocations apply) | paid plan |
| get_order_status | Track a build order to completion | paid plan |
| list_my_models | List your build orders | paid plan |
| download_model | Mint a 24-hour pull link; your agent saves the ZIP locally | paid plan |
- 13 tools
- OAuth 2.1 — SWATGenX 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?
Connected over OAuth with a SWATGenX account, an agent can search the SWAT+ example-model catalog, read calibration and held-out validation scores, query the national groundwater well-log and lithology inventory, query the PFAS monitoring inventory, and preview what a model of a given watershed would contain (these tools need a paid plan). With a sign-in (OAuth with the models scope) or 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.
What do I need to use the SWATGenX MCP server?
A SWATGenX account, signed in or with an API key. Agent access to the model, data and order tools is part of the paid plans (Starter, MAX or Department); four tools stay open to any account: search_docs and get_doc (the documentation), get_access_info (your access) and get_engine_info (the engine and build guide). 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 depth-resolved lithology intervals harmonized from state well registries, a 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.
