A hosted Model Context Protocol (MCP) server that gives AI assistants grounded access to MODFLOW and PEST documentation, to the FloPy and PyEMU Python API, to the Fortran source of MODFLOW 6 and MODFLOW-USG-Transport (GSI), to tutorials, and to the ModelMuse Help. Your assistant searches and retrieves real sources instead of guessing. It can use those sources to help create and run a MODFLOW 6 model with FloPy. The open_in_viewer tool then turns that completed local run into a read only browser link, valid for 30 days, so other people can inspect the model without installing anything.
MODFLOW-AI MCP Server exposes thirteen tools over the Model Context Protocol. An AI assistant calls them to search documentation, retrieve files, return cited answers, help create MODFLOW 6 models with FloPy, and turn a completed local run into a read only browser link.
- Multi-repository search across MODFLOW 6, MODFLOW-USG, PEST, PEST++, PEST_HP, plproc, gwutils, FloPy, PyEMU, and the ModelMuse Help.
- Source code, not just documentation: the FloPy and PyEMU Python sources and the Fortran sources of MODFLOW 6 and MODFLOW-USG-Transport (GSI) are indexed and retrievable in full, so an assistant can read what a package actually does rather than what the manual says about it.
- Text and semantic search, each tuned for a specific content type (docs, code, tutorials).
- Acronym expansion for MODFLOW/PEST terms (WEL, RIV, MAW, CHD, DRN, UZF, β¦).
- GitHub URLs returned with every code or tutorial result.
- File retrieval by exact path, with pagination for files over 30 KB.
- Indexed ModelMuse Help, with ranked search, page retrieval, and internal links.
- Create a model and open it in the viewer: the indexed documentation, source code, and tutorials help the assistant write and run a MODFLOW 6 model locally with FloPy. The
open_in_viewertool then creates a read onlyviewer.modflow.ailink, valid for 30 days, that opens in any browser. The files go straight from your machine to storage; the MCP server never receives model bytes. - Authenticated access, limited to approved users.
- Usage tracking: tool calls are traced on our own infrastructure to monitor reliability and improve results. Traces record the account and the search arguments. They are never sold or shared with third parties.
For access, visit www.modflow.ai. You'll receive configuration instructions by email.
HTTP transport (direct connection):
- VS Code
- Cursor
- Codex
- ChatGPT
MCP-Remote required:
- Claude Desktop
- Claude.ai (Claude Code)
In ChatGPT the server also exposes the OpenAI-compatible search and fetch
tools, so results appear as citable sources.
Your access email includes the endpoint URL and the exact configuration block for your client.
Full-text search across documentation, Python modules, and tutorial notebooks.
- Ultra-flexible
repositoryparameter (array, comma / space / pipe / semicolon separated). - Wildcards (
*) and boolean operators (AND/OR/NOT). - Acronym expansion (
UZFβ Unsaturated Zone Flow). - Omit
repositoryto search everything.
API and module search for FloPy and PyEMU, plus Fortran source for MODFLOW 6 and MODFLOW-USG-Transport (GSI).
- Returns signatures, parameters, docstrings.
- Python results include package codes (WEL, RCH, β¦) and model families.
- Fortran results search subroutine and module names across the full file.
- Direct GitHub links to source, pinned to the indexed commit.
Tutorials and workflows.
- Filters by complexity (beginner / intermediate / advanced).
- Shows prerequisites and common modifications.
- Array search inside use cases and implementation tips.
Concept-based documentation search using OpenAI embeddings. Best for "how to" and exploratory queries.
Semantic search over tutorials with domain-aware matching (e.g., uncertainty vs. flow modeling).
Full-text search over the indexed ModelMuse HTML Help.
- Best for ModelMuse dialogs, menu commands, objects, formulas, and package setup.
- Expands acronyms such as
MAWautomatically. - Returns exact
hrefvalues for page retrieval.
Fetch a complete file by exact path. Paginates files over 30 KB.
- Works for documentation files, Python modules, and Fortran source
(
.f,.for,.f90,.inc).
Fetch an indexed ModelMuse Help page using an exact href from search_modelmuse_help. Large pages are paginated and can include up to 100 internal links.
Server overview: available repositories, tools, and statistics. No parameters.
New. After a MODFLOW 6 run on your machine, the assistant offers this on its own: one link, no install, and the model is in a browser.
Open a MODFLOW 6 model that was built and run on your machine in the MODFLOW AI web viewer: mesh, packages, heads per timestep, cell inspector, cross section, 3D. The assistant installs the writer once (python -m pip install mfai-viewer, on PyPI, Python 3.10 or newer; pip brings numpy, flopy, flatbuffers, pydantic, scipy, matplotlib and shapely), runs mfai-viewer snapshot on the model directory, sends the small summary.json it prints to this tool, and receives one mfai-viewer upload command that sends the files, completes the link and prints the URL. Nothing is downloaded into your project directory.
- The model must have been run (
mfsim.namplus a head file). - Limits: 250 000 cells and 500 MB per snapshot, 10 links and 2 GB per account. A refusal names the number.
- Links are valid for 30 days.
Only when the upload command says files are missing: confirms that every file of a link has arrived and returns its URL, or names the files still missing.
List your links with their expiry and quota use, or delete one to make room.
User: "How do I set up a pumping well in MODFLOW 6?"
Agent calls: search_docs with query="WEL package MODFLOW 6"
β WEL package docs, examples, API.
User: "Show me a beginner tutorial for FloPy"
Agent calls: search_tutorials with query="getting started", complexity="beginner"
β Step-by-step FloPy tutorials with code.
User: "Explain how particle tracking works in groundwater models"
Agent calls: semantic_search_docs with a conceptual query
β Theory and mathematical explanations.
User: "I need the NPF package documentation file"
Agent calls: get_file_content with the exact path
β Full NPF docs.
User: "How does MODFLOW 6 actually solve for the well flow rate?"
Agent calls: search_code with query="WEL", repository="mf6", then
get_file_content on the returned path
β The Fortran subroutine itself, read from the indexed release.
User: "What is MODFLOW AI?"
Agent calls: get_modflow_ai_info
β Server overview.
User: "Create a MODFLOW 6 model with FloPy and give me a link I can send to a colleague"
Agent: writes and runs the model locally, prepares the viewer files, then calls open_in_viewer
β A read only browser link, valid for 30 days, with the mesh, packages, heads, cell inspector, cross section, and 3D view.
User: "Where do I configure the MAW package in ModelMuse?"
Agent calls: search_modelmuse_help with query="MAW", then get_modelmuse_help_page with the returned href
β The indexed ModelMuse Help topic and its internal links.
- Use
search_docswithout arepositoryto search everything at once. - Use specific terms or acronyms (
UZF,WEL package) rather than long sentences. - Start with
get_modflow_ai_infoto see what's available. - Ask for "open this model in the viewer" after a local FloPy run to get a browser link.
- Use
semantic_search_docsfor "how / why" conceptual questions. - Use
search_modelmuse_helpfor ModelMuse interface and setup questions. - Avoid overlapping the same query across multiple tools in one turn.
- Use
search_codeβ not semantic search β for exact function or class names.
- FloPy β Python package for MODFLOW (modules and tutorials).
- pyEMU β Python tools for uncertainty analysis and PEST++ integration.
- MODFLOW 6 β Fortran source from the latest stable USGS release.
- MODFLOW-USG-Transport β Fortran source from the official GSI Environmental distribution. This is the GSI transport build, not the USGS MODFLOW-USG release.
Python sources are re-indexed daily from upstream. Fortran sources follow each new published release.
- MODFLOW AI β Server documentation and guides.
- MODFLOW 6 β USGS modular groundwater flow model.
- MODFLOW-USG β USGS unstructured grid version. Documentation only; its source is not indexed.
- PEST β Parameter estimation toolkit.
- PEST++ β Next-generation PEST tools.
- PEST_HP β High-performance computing version.
- gwutils β Groundwater utility programs.
- plproc β Pilot point processor.
- ModelMuse Help β the USGS ModelMuse HTML Help, indexed page by page with
its internal links. Covers dialogs, menu commands, objects, formulas, and
package setup from the GUI side. Served by its own pair of tools rather than
by
search_docs.
The server expands common MODFLOW/PEST acronyms automatically:
WELβ Well PackageRIVβ River PackageMAWβ Multi-Aquifer WellCHDβ Constant Head BoundaryDRNβ Drain PackageEVTβ EvapotranspirationRCHβ RechargeSFRβ Streamflow Routing- β¦ and more.
- Text search for exact terms, acronyms, quoted phrases.
- Semantic search for conceptual / "how to" questions.
- Hybrid search when a query benefits from both.
Code results include direct links:
- FloPy modules:
github.com/modflowpy/flopy/blob/<commit>/β¦ - PyEMU modules:
github.com/pypest/pyemu/blob/<commit>/β¦ - MODFLOW 6 source: linked at the indexed release commit.
Links point at the exact commit that was indexed, so a result keeps matching the code it came from. MODFLOW-USG-Transport ships as a download rather than a public repository, so those results carry the distribution version instead of a link.
- Issues and questions: reach out via the contact in your access email.
- Feature requests: tell us what would help your workflow.
- Corrections: suggest improvements to docs or coverage.
MODFLOW-AI MCP Server is a proprietary hosted service. By using it you agree to:
- Use the service within rate limits.
- Not reverse-engineer or abuse the service.
The service is provided as-is. No source code is licensed for redistribution.
For questions or access: LinkedIn.
Built with data from:
- USGS MODFLOW
- FloPy Project
- PEST Suite
- The broader groundwater modeling community.
For access, visit www.modflow.ai.
