slurm-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HPC_HOST | Yes | SSH host alias from ~/.ssh/config or hostname for the HPC cluster. May optionally be in user@host form. Comma-separated lists configure multiple clusters. | |
| HPC_USER | Yes | Username on the HPC cluster. | |
| HPC_PREAMBLE | No | Shell commands to run before job scripts, such as module loads or conda activate. Newline-separated. | |
| SLURM_ACCOUNT | No | SLURM account for job submission. Unset or empty means no #SBATCH --account line is emitted, so the site default account applies. Comma-separated lists configure accounts per cluster. | |
| NOTIFY_WEBHOOK | No | Slack, Discord, or other webhook URL for job completion alerts. | |
| HPC_GUIDE_EXTRA | No | Local path to a site-specific guide appended to the guide tool output, covering accounts, partition policy, environments, etc. | |
| HPC_RESOURCE_LOG | No | Path on the cluster to an extra resource log, such as a TSV of past runs, that resource_check greps by job name. | |
| HPC_REQUIRE_MASTER | No | Set to 1 to require a ControlMaster. A host without ControlPath is treated like a dead master: fail fast, no direct connection. Recommended on MFA clusters. | |
| SLURM_DEFAULT_GPUS | No | Default GPUs for slurm_submit. Default is 1. Sites without GPUs should set SLURM_DEFAULT_GPUS=0 to omit any --gres line. Comma-separated list configures one per cluster. | 1 |
| HPC_ALLOW_UNSAFE_REUSE | No | Set to 1 to allow plain BatchMode=yes calls when the master is alive but its ControlPath cannot be resolved safely via ssh -G, instead of refusing them. Ignored when HPC_REQUIRE_MASTER=1. | |
| SLURM_DEFAULT_PARTITION | No | Default partition for slurm_submit. Default is batch. Comma-separated list configures one per cluster in HPC_HOST order. | batch |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
SLURM HPC tools via SSH. 26 tools for job management, file sync, monitoring, and interactive sessions. Supports multi-cluster setups.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ssh_statusB | Check if SSH connection to HPC is active |
| ssh_execC | Execute a command on HPC via SSH |
| ssh_write_fileA | Write content to a file on HPC. Use this instead of ssh_exec with cat/heredoc. |
| ssh_read_fileA | Read a file from HPC. Use this instead of ssh_exec with cat. |
| workdir_setB | Set HPC working directory for this window (used by slurm_submit guard) |
| workdir_getA | Get HPC working directory for this window |
| template_saveC | Save a reusable SLURM job template |
| template_listB | List saved SLURM job templates |
| slurm_statusA | Check SLURM job status (squeue + sacct). For array jobs pass the base id "12345" to see all tasks, or "12345_3" for one task. |
| resource_checkB | Check actual resource usage of past jobs (MUST call before sbatch) |
| slurm_submitA | Submit a SLURM batch job built from a command string. Auto-registers a completion watch: when the job (or, for arrays, EVERY task) finishes, a notification with an ok/failed tally is prepended to your next tool result — never poll with ssh loops. For many independent chunks use |
| slurm_cancelB | Cancel a SLURM job, a single array task, or a range of array tasks |
| slurm_logsA | Read SLURM job output log. For array jobs pass one task, e.g. "12345_3" (logs are slurm__.out). Remembers the --output pattern of jobs submitted through slurm_submit/slurm_submit_file, so logs of finished jobs are found even where sacct stores no StdOut; pass |
| slurm_submit_fileB | Submit an existing .slurm/.sh script file on HPC |
| cluster_infoA | Get HPC cluster partitions, queue load, your jobs, and per-user partition limits (MaxTime / MaxJobsPU / MaxTRESPU) — check before choosing a partition for parallel work |
| cluster_switchB | Switch active HPC cluster (when multiple clusters configured) |
| resource_reportC | Summarize resource usage over a time period |
| sync_filesC | Sync files between local and HPC via rsync |
| terminal_startC | Start a tmux session |
| terminal_readC | Read tmux terminal content |
| terminal_sendC | Send keys to tmux session. No heredoc or multi-line scripts. |
| terminal_execA | Run an INTERACTIVE command in tmux and return output. Only for interactive/monitoring use (top, watch, conda activate). For batch commands, use ssh_exec instead. |
| terminal_stopC | Kill a tmux session |
| ssh_interactiveA | Start an interactive SSH session to HPC via tmux (for commands needing confirmation, 2FA, etc.) |
| guideA | Read the HPC guide (experiment workflow, data, SLURM templates, plus the site-specific guide if HPC_GUIDE_EXTRA is set) |
| slurm_watchesB | List active SLURM job watches and pending notifications |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 26 tools
Most tools have clearly distinct resource/action targets. The main overlaps are ssh_exec vs terminal_exec and resource_check vs resource_report, but descriptions clearly distinguish batch vs interactive use and pre-submit vs historical reporting.
Nearly all tools use snake_case with a predictable namespace_action pattern such as ssh_exec, slurm_submit, terminal_read, workdir_set, and cluster_info. Minor deviations are the bare guide tool and verb-first sync_files.
At 26 tools the surface is heavy, with several split SSH/terminal helpers and overlapping resource utilities that could potentially be consolidated. The broad HPC/SLURM scope justifies many of them, but it sits at the borderline of over-scoped.
The set covers the core HPC lifecycle: SSH/file I/O, tmux interactivity, SLURM submission/status/logs/cancel, arrays/dependencies, templates, workdirs, resources, cluster switching, and rsync. Minor gaps like template deletion/update and explicit file management are mostly workable through ssh_exec or sync_files.