slurm_MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@slurm_MCPlist all jobs in the queue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Slurm HPC MCP Server
A Python-based MCP Server designed to connect to Slurm HPC clusters via SSH and expose cluster capabilities to clients such as Claude Desktop, Claude Code, Cursor, and MCP Inspector.
The current version has completed full-path verification:
MCP Server starts successfully
Claude/MCP Inspector connects successfully
Can connect to remote Slurm login nodes via SSH
Can submit real
sbatchjobsCan read job logs
Can perform structured diagnosis for common HPC runtime errors
Features
The following MCP capabilities are currently provided:
list_jobsView the current job queuelist_partitionsView partition informationget_job_statusQuery the status, exit code, reason, and log path of a specific jobsubmit_slurm_jobUpload and submit a Slurm scriptdiagnose_errorPerform structured error classification on logsjob_log://{job_id}Read job standard output logs
Related MCP server: claude-ssh-mcp
Tech Stack
Python
MCP Python SDK (
mcp[cli])Paramiko
Slurm CLI (
squeue,sinfo,sacct,scontrol,sbatch)
Directory Structure
slurm-hpc-mcp/
├─ mcp_hpc_server.py
├─ README.md
├─ requirements.txt
├─ claude_desktop_config.example.json
├─ mcp.inspector.template.json
├─ examples/
│ └─ example_job.slurm
└─ tests/
└─ test_mcp_server.pyInstallation
Using an independent virtual environment is recommended.
pip install -r requirements.txtConfiguration
The service reads remote cluster configuration via environment variables.
Required:
SLURM_SSH_HOSTSLURM_SSH_USERNAME
Optional:
SLURM_SSH_PORT, default22SLURM_SSH_KEY_PATHSLURM_SSH_PASSWORDSLURM_SSH_ALLOW_UNKNOWN_HOSTS, defaultfalseSLURM_REMOTE_WORKDIR, default/tmp/mcp-slurmSLURM_CONNECT_TIMEOUT, default15SLURM_COMMAND_TIMEOUT, default60SLURM_LOG_MAX_BYTES, default200000MCP_TRANSPORT, defaultstdio
Running Locally
By default, it runs in stdio mode, which is suitable for Claude Desktop, Claude Code, Cursor, and Inspector:
python .\mcp_hpc_server.pyTo switch to HTTP transport:
$env:MCP_TRANSPORT="streamable-http"
python .\mcp_hpc_server.pyClaude Desktop Configuration
Please refer to:
claude_desktop_config.example.json
Example:
{
"mcpServers": {
"slurm-hpc": {
"type": "stdio",
"command": "<your-python-executable>",
"args": ["<your-project-dir>/mcp_hpc_server.py"],
"env": {
"SLURM_SSH_HOST": "your-login-host",
"SLURM_SSH_PORT": "22",
"SLURM_SSH_USERNAME": "your-username",
"SLURM_SSH_KEY_PATH": "<your-ssh-private-key-path>",
"SLURM_SSH_ALLOW_UNKNOWN_HOSTS": "true"
}
}
}
}Common configuration location for Claude Desktop on Windows:
%APPDATA%\Claude\claude_desktop_config.jsonMCP Inspector
Please refer to:
mcp.inspector.template.json
If you configure it manually in Inspector:
Set
Commandto the Python interpreter pathSet
Argumentsto themcp_hpc_server.pypathSet environment variables for
SLURM_SSH_*related items
Example Job Script
Refer to:
examples/example_job.slurm
When submitting, please modify the following according to your cluster's actual situation:
Partition name
GRES / GPU / DCU resources
Time limit
Output path
Tool Descriptions
1. list_jobs
View jobs in the current queue.
Input:
{
"user": "optional"
}2. list_partitions
View partition status.
Input:
{}3. get_job_status
Query the status of a specific job.
Input:
{
"job_id": "37285107"
}4. submit_slurm_job
Submit a Slurm script.
The input field is script_content; enter the multi-line script body directly without extra quotes.
5. diagnose_error
Perform structured fault classification on log text.
Input:
{
"log_content": "ModuleNotFoundError: No module named 'mpi4py'"
}6. job_log://{job_id}
Read job standard output logs via resource template.
Security Mechanisms
Submissions are checked by ActionGuard before execution, which blocks typical dangerous commands by default, such as:
rm -rf /mkfsDirect writes to
/dev/*shutdown/rebootsudo
This is only the first layer of protection. For production environments, it is still recommended to:
Use a low-privilege SSH account
Restrict the remote working directory
Retain operation logs
Do not commit private keys to the repository
Testing
Run minimal tests:
python -m unittest tests.test_mcp_serverCurrent minimal test coverage:
Script shebang validation
Batch script normalization
Error classification logic
Partition parsing
Job status parsing
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Deploy, monitor, and manage your OpenClaw AI assistants via natural language.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.128MIT
- AlicenseAqualityCmaintenanceEnables Claude to connect to servers via SSH, execute commands, transfer files, and manage connections through natural language.98 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude Code to interact with a TACC or SLURM HPC cluster for bioinformatics pipelines, allowing job management, log reading, file browsing, remote script execution, and job submission through natural language.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage SLURM HPC clusters via SSH. Supports job submission, resource monitoring, queue management, and file operations.13 npm4-