---
name: slurm-watch-mcp
description: Use when the user wants to monitor remote SLURM jobs over SSH, check queue state, wait for a job to leave pending, or wait for a job to finish.
---

# SLURM Watch MCP

Monitor remote SLURM jobs over SSH for workflow orchestration.

Workflow position: this skill supports long-running HPC jobs where the assistant needs to pause active work until a submitted batch job is ready or complete.

## Quick Start

Use these MCP tools first:

- `slurm-watch-mcp.health`
- `slurm-watch-mcp.job_status`
- `slurm-watch-mcp.wait_until_started`
- `slurm-watch-mcp.wait_until_finished`

Typical sequence:

1. `health` to confirm SSH and remote SLURM readiness.
2. `job_status` to inspect the current state.
3. `wait_until_started` to block until the job leaves `PENDING`.
4. `wait_until_finished` to block until the terminal state is known.

## Host Setup

Before using wait tools, confirm SSH access to the remote login host.

Optional default:

```bash
export SLURM_WATCH_HOST="login.hpc.example.edu"
```

Optional SSH flags for jump hosts or identity files:

```bash
export SLURM_WATCH_SSH_OPTIONS="-J bastion.example.edu -i ~/.ssh/id_ed25519"
```

If `SLURM_WATCH_HOST` is not set, pass `host` explicitly in tool calls.

## Operational Patterns

### Check a running or queued job

Use `job_status` first to see whether the job is still pending, already active, or already terminal.

### Wait for the job to leave pending

Use `wait_until_started` when downstream work can begin as soon as the scheduler has admitted the job out of the queue.

### Wait for the final result

Use `wait_until_finished` when follow-on analysis depends on the final `sacct` state and exit code.

## Local Implementation Notes

This skill is aligned to the current repository implementation:

- Server code: `servers/slurm-watch-mcp/src/slurm_watch_mcp/server.py`
- Launcher: `scripts/run-slurm-watch-mcp.sh`

Keep this skill generic. Do not hardcode personal usernames, cluster account names, or hostnames into the skill text.
