uxarray-mcp 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/PKG-INFO +172 -184
  2. uxarray_mcp-0.1.2/README.md +206 -0
  3. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/pyproject.toml +13 -7
  4. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/__init__.py +2 -3
  5. uxarray_mcp-0.1.2/src/uxarray_mcp/app.py +77 -0
  6. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/cli.py +62 -4
  7. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/domain/__init__.py +4 -2
  8. uxarray_mcp-0.1.2/src/uxarray_mcp/domain/mesh.py +63 -0
  9. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/domain/vector_calc.py +19 -5
  10. uxarray_mcp-0.1.2/src/uxarray_mcp/domain/zonal.py +155 -0
  11. uxarray_mcp-0.1.2/src/uxarray_mcp/registry.py +699 -0
  12. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/remote/agent.py +22 -4
  13. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/remote/compute_functions.py +134 -19
  14. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/remote/health.py +50 -4
  15. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/__init__.py +4 -1
  16. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/advanced.py +128 -7
  17. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/capabilities.py +36 -3
  18. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/execution_control.py +1 -1
  19. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/frontdoor.py +40 -8
  20. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/inspection.py +62 -5
  21. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/plotting.py +4 -5
  22. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/remote_tools.py +20 -5
  23. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/stateful.py +1 -1
  24. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/vector_calc.py +31 -12
  25. uxarray_mcp-0.1.1/README.md +0 -218
  26. uxarray_mcp-0.1.1/src/uxarray_mcp/domain/mesh.py +0 -26
  27. uxarray_mcp-0.1.1/src/uxarray_mcp/domain/zonal.py +0 -66
  28. uxarray_mcp-0.1.1/src/uxarray_mcp/server.py +0 -94
  29. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/LICENSE +0 -0
  30. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/__main__.py +0 -0
  31. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/domain/area.py +0 -0
  32. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/domain/plotting.py +0 -0
  33. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/domain/variable.py +0 -0
  34. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/provenance.py +0 -0
  35. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/py.typed +0 -0
  36. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/remote/__init__.py +0 -0
  37. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/remote/config.py +0 -0
  38. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/state.py +0 -0
  39. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/catalog.py +0 -0
  40. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/orchestration.py +0 -0
  41. {uxarray_mcp-0.1.1 → uxarray_mcp-0.1.2}/src/uxarray_mcp/tools/scientific_agent.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uxarray-mcp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: MCP server for analyzing unstructured meshes with UXarray
5
5
  Keywords: uxarray,mcp,unstructured grids,scientific computing,globus compute
6
6
  Author: Rajeev Jain, Dayan Abdulla
@@ -212,243 +212,231 @@ Classifier: Intended Audience :: Science/Research
212
212
  Classifier: Topic :: Scientific/Engineering
213
213
  Classifier: Programming Language :: Python
214
214
  Classifier: Programming Language :: Python :: 3
215
- Classifier: Programming Language :: Python :: 3.11
216
215
  Classifier: Programming Language :: Python :: 3.12
217
- Classifier: Programming Language :: Python :: 3.13
218
216
  Classifier: License :: OSI Approved :: Apache Software License
219
- Requires-Dist: fastmcp>=3.4.0
217
+ Requires-Dist: toolregistry-server[mcp]>=0.4.0
220
218
  Requires-Dist: holoviews>=1.19.0
221
219
  Requires-Dist: matplotlib>=3.9.0
222
220
  Requires-Dist: pyyaml>=6.0
223
- Requires-Dist: uxarray>=2025.12.0
221
+ Requires-Dist: uxarray>=2026.6.0
224
222
  Requires-Dist: sphinx>=7.0 ; extra == 'docs'
225
223
  Requires-Dist: sphinx-book-theme>=1.1.0 ; extra == 'docs'
226
224
  Requires-Dist: myst-parser>=3.0 ; extra == 'docs'
227
225
  Requires-Dist: academy-py>=0.3.1 ; extra == 'hpc'
228
226
  Requires-Dist: globus-compute-sdk>=4.5.0 ; extra == 'hpc'
229
- Requires-Python: >=3.11
227
+ Requires-Dist: toolregistry-server[openapi]>=0.4.0 ; extra == 'openapi'
228
+ Requires-Python: >=3.12, <3.13
230
229
  Project-URL: Documentation, https://uxarray-mcp-server.readthedocs.io
231
230
  Project-URL: Source, https://github.com/UXARRAY/uxarray-mcp-server
232
231
  Project-URL: Tracker, https://github.com/UXARRAY/uxarray-mcp-server/issues
233
232
  Provides-Extra: docs
234
233
  Provides-Extra: hpc
234
+ Provides-Extra: openapi
235
235
  Description-Content-Type: text/markdown
236
236
 
237
237
  # UXarray MCP Server
238
238
 
239
- An MCP server that exposes [UXarray](https://uxarray.readthedocs.io/) tools to
240
- AI clients such as Claude. It supports:
239
+ An MCP server that lets an AI assistant (Claude Code, Claude Desktop, Cursor,
240
+ or any MCP client) analyze unstructured climate meshes with
241
+ [UXarray](https://uxarray.readthedocs.io/) — locally on your machine, or
242
+ remotely on an HPC system you have access to.
241
243
 
242
- - local execution for normal mesh analysis
243
- - optional remote execution on HPC systems through Globus Compute
244
- - diagnostics and provenance for scientific workflows
244
+ ```text
245
+ ┌─────────────┐ stdio ┌──────────────┐ ┌─────────────────┐
246
+ │ AI client │ ◀─────▶ │ uxarray-mcp │ ◀── Globus ──────▶ │ HPC endpoint │
247
+ │ (Claude…) │ pipe │ (your laptop)│ Compute (opt) │ (Slurm/PBS node)│
248
+ └─────────────┘ └──────────────┘ └─────────────────┘
249
+ ```
245
250
 
246
- ## How it runs
251
+ > **What the AI can do.** Open meshes and datasets, compute area / zonal mean
252
+ > / vorticity / divergence, subset, remap, plot, and run multi-step workflows.
253
+ > All as natural-language prompts.
247
254
 
248
- The server runs as a subprocess of the MCP client (Claude Code, Claude Desktop,
249
- or any FastMCP transport) and dispatches tool calls either locally or to a
250
- configured Globus Compute endpoint on an HPC cluster. Same MCP tool, same
251
- schema `use_remote: bool` on every tool decides which path runs.
255
+ > **Local by default; HPC is opt-in.** Everything runs on your machine unless
256
+ > you configure a [Globus Compute](https://www.globus.org/compute) endpoint.
257
+ > The remote option only becomes available once such an endpoint exists —
258
+ > running one requires an account and allocation on that HPC system, though a
259
+ > shared/service-account endpoint can let authorized users submit without their
260
+ > own login.
252
261
 
253
- **Local mode** analysis on your machine, files on your disk:
262
+ > **⚠️ What the AI can access.** Any file you (or your HPC account) can read.
263
+ > Any compute the configured endpoint can submit. Outputs are written to your
264
+ > disk. **See [SECURITY.md](SECURITY.md) before connecting any remote endpoint.**
254
265
 
255
- ```
256
- ┌────────────────┐ ┌─────────────────────────────┐
257
- │ Claude Code │ stdio │ uv run python -m │ reads
258
- │ / Desktop │ ◀─────▶ │ uxarray_mcp │ ───▶ local
259
- │ │ pipe │ (subprocess on your box) │ mesh files
260
- └────────────────┘ └─────────────────────────────┘
261
- ```
266
+ ---
262
267
 
263
- **HPC mode** analysis on facility hardware, files stay on facility storage:
268
+ ## Pick your path
264
269
 
265
- ```
266
- ┌────────────────┐ stdio ┌─────────────────────────┐ Globus ┌─────────────────────────┐
267
- │ Claude Code │ ◀─────▶ │ uxarray_mcp on laptop │ ◀──────▶ │ Worker on HPC endpoint │ reads
268
- │ / Desktop │ pipe │ (dispatches when │ Compute │ (uxarray reads file │ ───▶ facility
269
- │ │ │ use_remote=True) │ RPC │ from facility GPFS) │ mesh files
270
- └────────────────┘ └─────────────────────────┘ └─────────────────────────┘ (never copied)
271
- ```
270
+ You are most likely one of:
272
271
 
273
- The dispatcher falls back to local execution if a remote call is requested
274
- but the endpoint is missing or unhealthy.
272
+ 1. **Local user** laptop only, no HPC. [Local install](#local-install).
273
+ 2. **HPC user, endpoint already exists** someone at your lab gave you a
274
+ Globus Compute endpoint UUID. → [Local install](#local-install), then
275
+ [docs/remote-hpc.md](docs/remote-hpc.md).
276
+ 3. **HPC user, your own personal endpoint** — you have a Globus identity and
277
+ shell access to an HPC machine, and want to stand up an endpoint just for
278
+ yourself. → [Local install](#local-install), then
279
+ [docs/operating-an-endpoint.md](docs/operating-an-endpoint.md#solo-personal-endpoint-quickstart).
280
+ 4. **Group / shared endpoint operator** — you're standing one up for a team,
281
+ project, or lab. → [Local install](#local-install), then the full
282
+ [docs/operating-an-endpoint.md](docs/operating-an-endpoint.md) including
283
+ service-account migration and the MEP allowlist.
275
284
 
276
- ## Install
285
+ ---
277
286
 
278
- ```bash
279
- # Stable user path (after the package is published)
280
- uv tool install uxarray-mcp
281
- uxarray-mcp setup
282
- uxarray-mcp install-claude --print-only # prints the Claude Desktop block
283
- ```
287
+ ## Local install
284
288
 
285
- ```bash
286
- # Stable user path with HPC support
287
- uv tool install "uxarray-mcp[hpc]"
288
- uxarray-mcp setup
289
- uxarray-mcp endpoints add improv <your-endpoint-uuid> --set-default
290
- uxarray-mcp doctor --endpoint improv --timeout-seconds 180
291
- ```
289
+ Five steps. Each is one command unless noted.
290
+
291
+ ### Step 1 — Install the package
292
+
293
+ Pick one. `uv` is the easiest; `pip` works too.
292
294
 
293
295
  ```bash
294
- # Developer / contributor path, and best path when using repo scripts/docs
296
+ # Recommended
297
+ uv tool install --python 3.12 uxarray-mcp
298
+
299
+ # Or from a fresh clone (developer path)
295
300
  git clone https://github.com/UXARRAY/uxarray-mcp-server.git
296
- cd uxarray-mcp-server
297
- uv sync # core local install
298
- uv sync --extra hpc # add Globus Compute deps
301
+ cd uxarray-mcp-server && uv sync --python 3.12
299
302
  ```
300
303
 
304
+ > **Why `--python 3.12`?** The server uses Globus Compute to submit work to
305
+ > HPC endpoints, and Globus Compute's serializer is fragile across Python
306
+ > minor versions — a 3.13 submitter against a 3.12 endpoint worker raises
307
+ > `WorkerLost` on non-trivial payloads. HPC sites broadly ship 3.12 conda
308
+ > stacks today, so we pin the install to match. Tracking removal of this pin
309
+ > at [globus/globus-compute#2139](https://github.com/globus/globus-compute/issues/2139).
310
+ > `uv` downloads 3.12 automatically if your system doesn't have it.
311
+
312
+ ### Step 2 — Write a starter config
313
+
301
314
  ```bash
302
- # User install directly from GitHub before a PyPI release exists
303
- uv tool install "git+https://github.com/UXARRAY/uxarray-mcp-server.git"
304
315
  uxarray-mcp setup
305
- uxarray-mcp endpoints add improv <your-endpoint-uuid>
306
- uxarray-mcp install-claude --print-only # prints the Claude Desktop block
307
316
  ```
308
317
 
309
- The ``uxarray-mcp`` CLI exposes:
310
-
311
- | subcommand | what it does |
312
- | ------------------- | -------------------------------------------------------- |
313
- | ``serve`` | run the MCP server on stdio (Claude / FastMCP transport) |
314
- | ``setup`` | write a starter config to ``~/.config/uxarray-mcp/`` |
315
- | ``endpoints add`` | register a named Globus Compute endpoint |
316
- | ``endpoints list`` | show configured endpoints + discovery path |
317
- | ``doctor`` | validate auth, endpoint health, optional remote probes |
318
- | ``install-claude`` | print or merge the Claude Desktop ``mcpServers`` block |
319
-
320
- Config is discovered in this order: ``$UXARRAY_MCP_CONFIG`` →
321
- ``./config.yaml`` in the current working directory →
322
- ``~/.config/uxarray-mcp/config.yaml`` → the editable-install repo config
323
- fallback. The project-local file wins inside a checkout so development
324
- endpoints are not shadowed by an empty user config.
325
-
326
- ## Most Users Should Read These in Order
327
-
328
- 1. [GETTING_STARTED.md](GETTING_STARTED.md) for the short setup path
329
- 2. [docs/getting-started.md](docs/getting-started.md) for the full walkthrough
330
- 3. [docs/globus-compute.md](docs/globus-compute.md) if you are new to Globus Compute
331
- 4. [docs/hpc.md](docs/hpc.md) for generic cluster bring-up
332
- 5. [docs/improv.md](docs/improv.md) if you are on Argonne Improv
333
- 6. [docs/ucar.md](docs/ucar.md) if you are on NCAR Casper
334
- 7. [docs/chrysalis.md](docs/chrysalis.md) if you are on Argonne Chrysalis
335
- 6. [docs/workflows.md](docs/workflows.md) for sequential remote workflows
336
-
337
- ## MCP Front-Door Tools
338
-
339
- The MCP surface is intentionally small. Low-level UXarray functions are still
340
- available as Python APIs inside `uxarray_mcp.tools`, but MCP clients see
341
- intent-shaped tools:
342
-
343
- - `get_capabilities` — discover topology, variables, applicable operations,
344
- and next steps.
345
- - `analyze_dataset` — deterministic first-look pipeline: inspect, validate,
346
- area, zonal mean, and plots where possible.
347
- - `run_analysis` — one-operation dispatcher for inspection, validation,
348
- area/zonal statistics, subsetting, vector calculus, comparison, remapping,
349
- temporal/ensemble summaries, and export.
350
- - `plot_dataset` — mesh, geographic mesh, variable, or zonal-mean plots.
351
- - `diagnose_endpoint` and `probe_path_access` — endpoint status, setup
352
- validation, and exact path readability checks.
353
- - `run_workflow`, `resume_workflow`, `get_status`, `get_result`, and
354
- `manage_session` — persisted sessions, workflows, operation status, and
355
- result handles.
356
-
357
- `analyze_dataset`, `run_analysis`, `plot_dataset`, and `probe_path_access`
358
- accept ``use_remote: bool`` and ``endpoint: str | None`` where remote execution
359
- applies. When ``use_remote=True`` the dispatcher submits to the configured (or
360
- named) Globus Compute endpoint and falls back to local execution if the endpoint
361
- is missing or unhealthy. There are no separate ``*_hpc`` tool names on the MCP
362
- surface.
363
-
364
- Full parameter and return details live in [docs/tools.md](docs/tools.md).
365
-
366
- ## Helper Scripts
367
-
368
- - `scripts/hpc_doctor.py`
369
- First-pass CLI doctor for local auth, endpoint status, remote no-op
370
- execution, and optional real-path probing.
371
- - `scripts/improv_endpoint.sh`
372
- Writes Improv endpoint templates for single-host validation or PBS debug.
373
- - `scripts/agentic_hpc_loop.py`
374
- Example submit/poll/branch workflow using Globus Compute futures directly.
375
-
376
- ## HPC in One Paragraph
377
-
378
- Remote execution has three separate layers:
379
-
380
- 1. the local machine running this repository
381
- 2. the endpoint running on the HPC machine
382
- 3. the remote worker environment that must also have `uxarray`, `xarray`,
383
- `netCDF4`, and `h5netcdf`
384
-
385
- Most confusing failures happen because only one or two of those layers are set
386
- up. Start with [docs/globus-compute.md](docs/globus-compute.md) and use
387
- `diagnose_endpoint(action="validate")` before real remote jobs.
388
-
389
- ## Configuration
390
-
391
- Use the CLI for the common case:
318
+ Creates `~/.config/uxarray-mcp/config.yaml` with sensible defaults. Local mode
319
+ needs nothing more.
320
+
321
+ ### Step 3 Connect your AI client
322
+
323
+ **Claude Desktop**
392
324
 
393
325
  ```bash
394
- uxarray-mcp setup
395
- uxarray-mcp endpoints add improv <your-endpoint-uuid> --path-prefix /lus/ --set-default
326
+ uxarray-mcp install-claude # merges the mcpServers block into your config
327
+ # or
328
+ uxarray-mcp install-claude --print-only # prints the JSON to paste manually
396
329
  ```
397
330
 
398
- This writes ``~/.config/uxarray-mcp/config.yaml`` with the canonical
399
- multi-endpoint schema. For dev clones, ``./config.yaml`` at the repo root
400
- still works (and is gitignored). The full schema:
401
-
402
- ```yaml
403
- hpc:
404
- default_endpoint: "ucar"
405
- endpoints:
406
- ucar:
407
- endpoint_id: "your-ucar-endpoint-uuid"
408
- path_prefixes: ["/glade/"]
409
- improv:
410
- endpoint_id: "your-improv-endpoint-uuid"
411
- path_prefixes: ["/gpfs/fs1/", "/home/jain/"]
412
- execution_mode: "auto"
413
- timeout_seconds: 300
331
+ Restart Claude Desktop. The `uxarray` server should appear in Settings →
332
+ Developer.
333
+
334
+ **Claude Code**
335
+
336
+ ```bash
337
+ claude mcp add uxarray --transport stdio -- uxarray-mcp serve
414
338
  ```
415
339
 
416
- Remote tools accept `endpoint="ucar"` or `endpoint="improv"`; when omitted,
417
- the server routes by path prefix before falling back to `default_endpoint`.
340
+ Then `/mcp` in Claude Code; pick `uxarray`.
341
+
342
+ **Cursor / other MCP clients**
343
+
344
+ Add an MCP server entry pointing at `uxarray-mcp serve` over stdio. See your
345
+ client's MCP docs.
418
346
 
419
- ## Development Checks
347
+ ### Step 4 — Sanity check
420
348
 
421
349
  ```bash
422
- uv run pre-commit run --all-files
423
- uv run pytest tests/ --ignore=tests/test_remote_agent.py
424
- uv sync --extra docs --dev
425
- uv run sphinx-build -b html docs docs/_build/html
350
+ uxarray-mcp doctor
426
351
  ```
427
352
 
428
- ## Publishing
353
+ Should print `local execution: ok` and (if no endpoints configured) skip the
354
+ remote checks.
429
355
 
430
- Releases follow the UXarray pattern: publish a GitHub Release from a version tag
431
- such as `v0.1.0`; the release workflow builds and publishes to PyPI with trusted
432
- publishing. Conda packages are handled through a separate conda-forge feedstock;
433
- `conda/recipe/meta.yaml` is a seed recipe for `uxarray-mcp-feedstock`.
356
+ ### Step 5 Ask the AI to do something
357
+
358
+ In your client, try:
359
+
360
+ > "Open `<path to a UGRID/MPAS/SCRIP grid file>` and plot the mesh."
361
+
362
+ That's it for local use.
363
+
364
+ ---
365
+
366
+ ## Going beyond your laptop
367
+
368
+ If you have an HPC account at a national lab or university cluster with
369
+ [Globus Compute](https://www.globus.org/compute) available:
370
+
371
+ | You want to … | Read this |
372
+ |---|---|
373
+ | Connect to an endpoint someone else set up | **[docs/remote-hpc.md](docs/remote-hpc.md)** |
374
+ | Stand up your own endpoint | **[docs/operating-an-endpoint.md](docs/operating-an-endpoint.md)** |
375
+ | Understand the security model first | **[SECURITY.md](SECURITY.md)** |
376
+
377
+ Both paths assume you've finished local install above.
378
+
379
+ ---
380
+
381
+ ## What the MCP exposes
382
+
383
+ Intent-shaped tools, not raw UXarray bindings:
384
+
385
+ - `get_capabilities` — what can I do with this mesh?
386
+ - `analyze_dataset` — deterministic first-look: inspect, validate, area, zonal mean, plots.
387
+ - `run_analysis` — one operation at a time (gradient, curl, subset, remap, …).
388
+ - `plot_dataset` — mesh, geographic, variable, or zonal-mean plots.
389
+ - `diagnose_endpoint`, `probe_path_access` — endpoint health + file readability.
390
+ - `run_workflow`, `resume_workflow`, `get_status`, `get_result`, `manage_session` —
391
+ persisted sessions and multi-step workflows.
392
+
393
+ Tools that can run remotely take `use_remote: bool` and optional `endpoint: str`.
394
+ The dispatcher falls back to local if the endpoint is unhealthy.
395
+
396
+ Full schema: [docs/tools.md](docs/tools.md).
397
+
398
+ ---
399
+
400
+ ## CLI reference
401
+
402
+ | Command | Purpose |
403
+ |---|---|
404
+ | `uxarray-mcp serve` | Run the MCP server (used by your AI client) |
405
+ | `uxarray-mcp setup` | Write a starter config |
406
+ | `uxarray-mcp endpoints add NAME UUID` | Register a Globus Compute endpoint |
407
+ | `uxarray-mcp endpoints list` | Show configured endpoints |
408
+ | `uxarray-mcp doctor` | Validate local + (optionally) remote setup |
409
+ | `uxarray-mcp install-claude` | Merge or print the Claude Desktop config block |
410
+
411
+ ---
412
+
413
+ ## Risks (read before relying on output)
414
+
415
+ AI agents can misread prompts, pick the wrong file, get units wrong (e.g.,
416
+ sphere-radius scaling on derivatives), or run long jobs on your HPC
417
+ allocation. uxarray-mcp does **not** guarantee correctness of agent-driven
418
+ analysis. You are responsible for:
419
+
420
+ - Verifying numerical results before publishing.
421
+ - Reviewing what files the agent opens.
422
+ - Monitoring HPC job submissions against your allocation.
423
+
424
+ For the security model (what the agent and the endpoint operator can access),
425
+ see **[SECURITY.md](SECURITY.md)**.
426
+
427
+ ---
428
+
429
+ ## Development
434
430
 
435
431
  ```bash
436
- uv build
437
- uv tool install dist/uxarray_mcp-*.whl --force
438
- uxarray-mcp --help
432
+ uv sync --extra hpc --extra docs --dev
433
+ uv run pre-commit run --all-files
434
+ uv run pytest tests/ --ignore=tests/test_remote_agent.py
435
+ uv run sphinx-build -b html docs docs/_build/html
439
436
  ```
440
437
 
441
- See [docs/release.md](docs/release.md) for the full PyPI and Conda workflow.
438
+ Release process: [docs/release.md](docs/release.md).
442
439
 
443
- ## Documentation Index
440
+ ## License
444
441
 
445
- - [GETTING_STARTED.md](GETTING_STARTED.md)
446
- - [docs/getting-started.md](docs/getting-started.md)
447
- - [docs/globus-compute.md](docs/globus-compute.md)
448
- - [docs/hpc.md](docs/hpc.md)
449
- - [docs/improv.md](docs/improv.md)
450
- - [docs/ucar.md](docs/ucar.md)
451
- - [docs/chrysalis.md](docs/chrysalis.md)
452
- - [docs/tools.md](docs/tools.md)
453
- - [docs/workflows.md](docs/workflows.md)
454
- - [docs/scientific-agent.md](docs/scientific-agent.md)
442
+ See [LICENSE](LICENSE).
@@ -0,0 +1,206 @@
1
+ # UXarray MCP Server
2
+
3
+ An MCP server that lets an AI assistant (Claude Code, Claude Desktop, Cursor,
4
+ or any MCP client) analyze unstructured climate meshes with
5
+ [UXarray](https://uxarray.readthedocs.io/) — locally on your machine, or
6
+ remotely on an HPC system you have access to.
7
+
8
+ ```text
9
+ ┌─────────────┐ stdio ┌──────────────┐ ┌─────────────────┐
10
+ │ AI client │ ◀─────▶ │ uxarray-mcp │ ◀── Globus ──────▶ │ HPC endpoint │
11
+ │ (Claude…) │ pipe │ (your laptop)│ Compute (opt) │ (Slurm/PBS node)│
12
+ └─────────────┘ └──────────────┘ └─────────────────┘
13
+ ```
14
+
15
+ > **What the AI can do.** Open meshes and datasets, compute area / zonal mean
16
+ > / vorticity / divergence, subset, remap, plot, and run multi-step workflows.
17
+ > All as natural-language prompts.
18
+
19
+ > **Local by default; HPC is opt-in.** Everything runs on your machine unless
20
+ > you configure a [Globus Compute](https://www.globus.org/compute) endpoint.
21
+ > The remote option only becomes available once such an endpoint exists —
22
+ > running one requires an account and allocation on that HPC system, though a
23
+ > shared/service-account endpoint can let authorized users submit without their
24
+ > own login.
25
+
26
+ > **⚠️ What the AI can access.** Any file you (or your HPC account) can read.
27
+ > Any compute the configured endpoint can submit. Outputs are written to your
28
+ > disk. **See [SECURITY.md](SECURITY.md) before connecting any remote endpoint.**
29
+
30
+ ---
31
+
32
+ ## Pick your path
33
+
34
+ You are most likely one of:
35
+
36
+ 1. **Local user** — laptop only, no HPC. → [Local install](#local-install).
37
+ 2. **HPC user, endpoint already exists** — someone at your lab gave you a
38
+ Globus Compute endpoint UUID. → [Local install](#local-install), then
39
+ [docs/remote-hpc.md](docs/remote-hpc.md).
40
+ 3. **HPC user, your own personal endpoint** — you have a Globus identity and
41
+ shell access to an HPC machine, and want to stand up an endpoint just for
42
+ yourself. → [Local install](#local-install), then
43
+ [docs/operating-an-endpoint.md](docs/operating-an-endpoint.md#solo-personal-endpoint-quickstart).
44
+ 4. **Group / shared endpoint operator** — you're standing one up for a team,
45
+ project, or lab. → [Local install](#local-install), then the full
46
+ [docs/operating-an-endpoint.md](docs/operating-an-endpoint.md) including
47
+ service-account migration and the MEP allowlist.
48
+
49
+ ---
50
+
51
+ ## Local install
52
+
53
+ Five steps. Each is one command unless noted.
54
+
55
+ ### Step 1 — Install the package
56
+
57
+ Pick one. `uv` is the easiest; `pip` works too.
58
+
59
+ ```bash
60
+ # Recommended
61
+ uv tool install --python 3.12 uxarray-mcp
62
+
63
+ # Or from a fresh clone (developer path)
64
+ git clone https://github.com/UXARRAY/uxarray-mcp-server.git
65
+ cd uxarray-mcp-server && uv sync --python 3.12
66
+ ```
67
+
68
+ > **Why `--python 3.12`?** The server uses Globus Compute to submit work to
69
+ > HPC endpoints, and Globus Compute's serializer is fragile across Python
70
+ > minor versions — a 3.13 submitter against a 3.12 endpoint worker raises
71
+ > `WorkerLost` on non-trivial payloads. HPC sites broadly ship 3.12 conda
72
+ > stacks today, so we pin the install to match. Tracking removal of this pin
73
+ > at [globus/globus-compute#2139](https://github.com/globus/globus-compute/issues/2139).
74
+ > `uv` downloads 3.12 automatically if your system doesn't have it.
75
+
76
+ ### Step 2 — Write a starter config
77
+
78
+ ```bash
79
+ uxarray-mcp setup
80
+ ```
81
+
82
+ Creates `~/.config/uxarray-mcp/config.yaml` with sensible defaults. Local mode
83
+ needs nothing more.
84
+
85
+ ### Step 3 — Connect your AI client
86
+
87
+ **Claude Desktop**
88
+
89
+ ```bash
90
+ uxarray-mcp install-claude # merges the mcpServers block into your config
91
+ # or
92
+ uxarray-mcp install-claude --print-only # prints the JSON to paste manually
93
+ ```
94
+
95
+ Restart Claude Desktop. The `uxarray` server should appear in Settings →
96
+ Developer.
97
+
98
+ **Claude Code**
99
+
100
+ ```bash
101
+ claude mcp add uxarray --transport stdio -- uxarray-mcp serve
102
+ ```
103
+
104
+ Then `/mcp` in Claude Code; pick `uxarray`.
105
+
106
+ **Cursor / other MCP clients**
107
+
108
+ Add an MCP server entry pointing at `uxarray-mcp serve` over stdio. See your
109
+ client's MCP docs.
110
+
111
+ ### Step 4 — Sanity check
112
+
113
+ ```bash
114
+ uxarray-mcp doctor
115
+ ```
116
+
117
+ Should print `local execution: ok` and (if no endpoints configured) skip the
118
+ remote checks.
119
+
120
+ ### Step 5 — Ask the AI to do something
121
+
122
+ In your client, try:
123
+
124
+ > "Open `<path to a UGRID/MPAS/SCRIP grid file>` and plot the mesh."
125
+
126
+ That's it for local use.
127
+
128
+ ---
129
+
130
+ ## Going beyond your laptop
131
+
132
+ If you have an HPC account at a national lab or university cluster with
133
+ [Globus Compute](https://www.globus.org/compute) available:
134
+
135
+ | You want to … | Read this |
136
+ |---|---|
137
+ | Connect to an endpoint someone else set up | **[docs/remote-hpc.md](docs/remote-hpc.md)** |
138
+ | Stand up your own endpoint | **[docs/operating-an-endpoint.md](docs/operating-an-endpoint.md)** |
139
+ | Understand the security model first | **[SECURITY.md](SECURITY.md)** |
140
+
141
+ Both paths assume you've finished local install above.
142
+
143
+ ---
144
+
145
+ ## What the MCP exposes
146
+
147
+ Intent-shaped tools, not raw UXarray bindings:
148
+
149
+ - `get_capabilities` — what can I do with this mesh?
150
+ - `analyze_dataset` — deterministic first-look: inspect, validate, area, zonal mean, plots.
151
+ - `run_analysis` — one operation at a time (gradient, curl, subset, remap, …).
152
+ - `plot_dataset` — mesh, geographic, variable, or zonal-mean plots.
153
+ - `diagnose_endpoint`, `probe_path_access` — endpoint health + file readability.
154
+ - `run_workflow`, `resume_workflow`, `get_status`, `get_result`, `manage_session` —
155
+ persisted sessions and multi-step workflows.
156
+
157
+ Tools that can run remotely take `use_remote: bool` and optional `endpoint: str`.
158
+ The dispatcher falls back to local if the endpoint is unhealthy.
159
+
160
+ Full schema: [docs/tools.md](docs/tools.md).
161
+
162
+ ---
163
+
164
+ ## CLI reference
165
+
166
+ | Command | Purpose |
167
+ |---|---|
168
+ | `uxarray-mcp serve` | Run the MCP server (used by your AI client) |
169
+ | `uxarray-mcp setup` | Write a starter config |
170
+ | `uxarray-mcp endpoints add NAME UUID` | Register a Globus Compute endpoint |
171
+ | `uxarray-mcp endpoints list` | Show configured endpoints |
172
+ | `uxarray-mcp doctor` | Validate local + (optionally) remote setup |
173
+ | `uxarray-mcp install-claude` | Merge or print the Claude Desktop config block |
174
+
175
+ ---
176
+
177
+ ## Risks (read before relying on output)
178
+
179
+ AI agents can misread prompts, pick the wrong file, get units wrong (e.g.,
180
+ sphere-radius scaling on derivatives), or run long jobs on your HPC
181
+ allocation. uxarray-mcp does **not** guarantee correctness of agent-driven
182
+ analysis. You are responsible for:
183
+
184
+ - Verifying numerical results before publishing.
185
+ - Reviewing what files the agent opens.
186
+ - Monitoring HPC job submissions against your allocation.
187
+
188
+ For the security model (what the agent and the endpoint operator can access),
189
+ see **[SECURITY.md](SECURITY.md)**.
190
+
191
+ ---
192
+
193
+ ## Development
194
+
195
+ ```bash
196
+ uv sync --extra hpc --extra docs --dev
197
+ uv run pre-commit run --all-files
198
+ uv run pytest tests/ --ignore=tests/test_remote_agent.py
199
+ uv run sphinx-build -b html docs docs/_build/html
200
+ ```
201
+
202
+ Release process: [docs/release.md](docs/release.md).
203
+
204
+ ## License
205
+
206
+ See [LICENSE](LICENSE).