lebrice/slurm_mcp
If you are the rightful owner of slurm_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The slurm_mcp is a simple Model Context Protocol (MCP) server designed to facilitate interaction with SLURM clusters using natural language.
slurm_mcp
Simple MCP server to interact with SLURM clusters in natural language.
Features
- Allows LLM agents to retrieve information on your running jobs from
squeue, prior jobs fromsacct, and to get compute usage information based on Prometheus (once you configure it, see instructions below).
Demo
Limitations
- This can only fetch your own SLURM job information, not of other users.
- This can't be used to launch jobs. It is not a good idea to let an LLM submit compute jobs for you.
- To get compute metrics, you need to set the
PROMETHEUS_URL_<CLUSTER>environment variable to the Prometheus URL of your cluster. See step 3 below.- On the Mila cluster, some jobs are missing GPU compute stats because of a bug in the DCGMI / slurm job exporter / nvidia driver / something, that causes the gpu util to be a very very very large number. This tool filters those and displays them as having no usable compute metrics.
Setup
You need to have SSH access to a SLURM compute cluster.
-
Create a
.vscode/mcp.jsonfile with the following content:
{
"servers": {
"slurm_mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"git+https://www.github.com/lebrice/slurm_mcp",
"slurm_mcp"
]
}
}
}
-
To get GPU metrics, you need to set the
PROMETHEUS_URL_<CLUSTER>environment variable to the Prometheus URL of your cluster. If the SLURM cluster requires authentication to connect to prometheus, you also need to set thePROMETHEUS_HEADERS_FILE_<CLUSTER>environment variable to point to a JSON file containing the headers to use for authentication (e.g.,{"Authorization": "Bearer <TOKEN>"}).- you can set these environment variables in your shell configuration file (e.g.,
.bashrc,.bash_aliases,.zshrc, etc.):
export PROMETHEUS_URL_MILA="THE_MILA_PROMETHEUS_URL" export PROMETHEUS_HEADERS_FILE_MILA="secrets/prometheus_headers_mila.json" - you can set these environment variables in your shell configuration file (e.g.,