Metadata-Version: 2.5
Name: mfai-viewer
Version: 0.1.0
Summary: Write and upload the MODFLOW AI web viewer snapshot of a MODFLOW 6 model that was run with FloPy
Project-URL: Homepage, https://www.modflow.ai
Project-URL: Source, https://github.com/modflowai/modflowai-mcp
Author-email: GWLab <admin@modflow.ai>
License-Expression: MIT
Keywords: flopy,groundwater,modflow,viewer
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Hydrology
Requires-Python: >=3.10
Requires-Dist: flatbuffers>=23.5
Requires-Dist: flopy>=3.5
Requires-Dist: matplotlib>=3.7
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: shapely>=2.0
Description-Content-Type: text/markdown

# mfai-viewer

The writer behind the `open_in_viewer` tool of the MODFLOW AI MCP
(`https://mcp.modflow.ai`). It turns a MODFLOW 6 simulation that was built
with FloPy and run on this machine into the snapshot the MODFLOW AI web
viewer (`viewer.modflow.ai`) reads, and uploads that snapshot to the link
the MCP tool created.

```sh
python -m pip install mfai-viewer
mfai-viewer snapshot --workdir <model dir> --out <snapshot dir>
mfai-viewer upload <snapshot dir> "<uploads url from open_in_viewer>"
mfai-viewer version
```

`snapshot` refuses a model that has not been run (no head file). It writes
`manifest.json` and a small `summary.json`; the MCP tool takes the summary
and answers the one `upload` command to run. `upload` sends every file in
parallel, retries, marks the link complete and prints the URL.

Exit codes: 0 done, 2 the environment cannot run it (Python older than 3.10,
missing packages, bad arguments), 3 the model has not been run, 4 files are
still missing after the upload, 1 anything else.

The writer code (`mfai_viewer/writer`) and the GWlink slice it vendors
(`mfai_viewer/gwlink`) are copied byte for byte from the mfai-chat and gwlink
repositories; `mfai_viewer/sources.json` records the commits and the sha256
of every file. Nothing is edited here.
