
yidong72/slurm_mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
An MCP (Model Context Protocol) server that enables AI agents to interact with remote Slurm clusters via SSH.
Обзор
An MCP (Model Context Protocol) server that enables AI agents to interact with remote Slurm clusters via SSH. This server provides tools for job management, cluster monitoring, interactive sessions, and file operations. - : Submit, monitor, and cancel jobs via SSH - : Query GPU availability and allocate GPU resources - : Support for containerized workloads with .sqsh images - : Launch and manage persistent interactive sessions - : Save and reuse interactive session configurations - : Browse, read, and write files on the cluster - : Organized access to datasets, models, results, and logs The server is configured via environment variables with the SLURM_ prefix. The slurm-mcp-config tool automatically converts your .env file to mcp.json format: Options: - -o, --output FILE - Write to file instead of stdout - --merge FILE - Merge into an existing mcp.
README
Показан фрагмент оригинального README. Открыть оригинал.
Slurm MCP Server
An MCP (Model Context Protocol) server that enables AI agents to interact with remote Slurm clusters via SSH. This server provides tools for job management, cluster monitoring, interactive sessions, and file operations.
Features
- Remote Slurm Management: Submit, monitor, and cancel jobs via SSH
- GPU Support: Query GPU availability and allocate GPU resources
- Pyxis/Enroot Containers: Support for containerized workloads with
.sqshimages - Interactive Sessions: Launch and manage persistent interactive sessions
- Session Profiles: Save and reuse interactive session configurations
- File Operations: Browse, read, and write files on the cluster
- Directory Structure: Organized access to datasets, models, results, and logs
Installation
# Clone the repository
git clone https://github.com/yourusername/slurm-mcp.git
cd slurm-mcp
# Install with pip
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
Quick Start
cd /path/to/slurm_mcp
pip install -e .
# Configure
cp .env.example .env
# Edit .env with your cluster details
# Generate mcp.json for Cursor/Claude Desktop
slurm-mcp-config .env -o mcp.json
# Or run directly
slurm-mcp
Configuration
The server is configured via environment variables with the SLURM_ prefix.
Required Settings
| Variable | Description |
|---|---|
SLURM_SSH_HOST |
Remote Slurm login node hostname |
SLURM_SSH_USER |
SSH username |
SLURM_USER_ROOT |
User’s root directory on cluster |
SSH Settings
| Variable | Default | Description |
|---|---|---|
SLURM_SSH_PORT |
22 | SSH port |
SLURM_SSH_KEY_PATH |
None | Path to SSH private key |
SLURM_SSH_PASSWORD |
None | SSH password or key passphrase |
SLURM_SSH_KNOWN_HOSTS |
None | Path to known_hosts file |
Slurm Settings
| Variable | Default | Description |
|---|---|---|
SLURM_DEFAULT_PARTITION |
None | Default partition for jobs |
SLURM_DEFAULT_ACCOUNT |
None | Default account/project |
SLURM_COMMAND_TIMEOUT |
60 | Command timeout in seconds |
SLURM_GPU_PARTITIONS |
None | Comma-separated GPU partition names |
SLURM_CPU_PARTITIONS |
None | Comma-separated CPU partition names |
Interactive Session Settings
| Variable | Default | Description |
|---|---|---|
SLURM_INTERACTIVE_PARTITION |
interactive | Partition for interactive jobs |
SLURM_INTERACTIVE_ACCOUNT |
None | Account for interactive jobs |
SLURM_INTERACTIVE_DEFAULT_TIME |
4:00:00 | Default time limit |
SLURM_INTERACTIVE_DEFAULT_GPUS |
8 | Default GPUs per node |
SLURM_INTERACTIVE_SESSION_TIMEOUT |
3600 | Idle timeout in seconds |
Directory Structure
| Variable | Default | Container Mount |
|---|---|---|
SLURM_USER_ROOT |
Required | - |
SLURM_DIR_DATASETS |
$USER_ROOT/data |
/datasets |
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"slurm": {
"command": "slurm-mcp",
"env": {
"SLURM_SSH_HOST": "login.cluster.example.com",
"SLURM_SSH_USER": "username",
"SLURM_SSH_KEY_PATH": "~/.ssh/id_rsa",
"SLURM_USER_ROOT": "/lustre/users/username",
"SLURM_GPFS_ROOT": "/lustre",
"SLURM_DEFAULT_ACCOUNT": "my_project",
"SLURM_DEFAULT_PARTITION": "batch",
"SLURM_INTERACTIVE_PARTITION": "interactive"
}
}
}
}