slurm_MCP
Click on "Install 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.9161MIT
- FlicenseNot gradedqualityCmaintenanceEnables 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.104
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Uptime, SSL, DNS and domain monitoring you can talk to from Claude or any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pengc0066-star/slurm_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server