slurm-mcp
slurm-mcp
一个只读的 MCP 服务器,将 Slurm 调度器状态暴露给代理。 allowlist 在代码中强制执行,而不是在提示词中请求;工具表面采用渐进式披露,因此一个 Slurm 相关的问题不会消耗一个 Slurm 规模的上下文窗口。
v0.1.0。 守卫、主题表面和 stdio 服务器均已构建并测试。可针对真实集群运行,也可在未安装 Slurm 的情况下基于录制的测试数据运行。
为什么守卫写在代码中
系统提示词说*“只使用只读命令”*只是一种请求,而不是控制。它是默认放行的。一次越狱、一次混乱的工具调用,或一次普通的幻觉,都足以在生产控制器上执行 scontrol update。
任何可能使节点进入 drain 状态的操作都必须无法被表达,而不只是被劝阻。因此,allowlist 位于 guard.py 中,并且在每次调用时都会执行:
总共只允许运行八个只读二进制文件;
scontrol仅被允许用于show,而拒绝update、reconfigure、shutdown、reboot、requeue、hold、power等另外十五个操作;参数中的 shell 元字符会被拒绝,并且命令无论如何都以
shell=False执行——这是纵深防御,而不只是唯一的屏障。
威胁模型并不是恶意用户。 而是一个在凌晨 3 点读了一行令人困惑的日志、正打算做出某个决定性操作的代理。
测试通过 51 个真实的变更与注入尝试来驱动这一点,而不是去断言提示词文本,因为承诺在提示词层上是无法被测试的:
make testRelated MCP server: systemd-mcp
渐进式披露
显而易见的设计是每个二进制文件暴露一个工具——sinfo、squeue、sacct、sdiag、sprio、sshare、scontrol、sacctmgr——每个工具都带有自己的旗标 schema。Slurm 的旗标面非常庞大,且大部分与任何给定问题无关,但它们全部每轮都会驻留在上下文中。
此服务器暴露三个工具:
工具 | 何时使用 |
| 大多数会话开始时的快照——节点、队列、诊断,一次调用即可完成 |
| 一个主题加上可选过滤器。主题是封闭词汇表,不是命令行 |
| 仅针对一个主题的列含义和输入说明,只有在需要时才获取 |
上述内容已被测量过,并可通过 make footprint 复现:
resident, three tools 1088 chars
detail, fetched on request 3029 chars
flat one-tool-per-binary 4441 chars (4.1x resident)这是一个上下文成本测量,而不是质量声明。它说明细节在请求之前不会常驻;它并不说明代理会更好诊断。这里没有任何东西在 slurm-rca-bench 上得分。
主题: queue、nodes、accounting、priority、fairshare、diagnostics、config。
快速开始
无需集群。
make install
make surface # the read-only allowlist, and what is denied
make demo # a full overview against recorded fixtures
make footprint # reproduce the context measurement above
make check # ruff, ruff format, mypy --strict, pytest对于真实集群,去掉 --fixtures:
slurm-mcp overview
slurm-mcp query queue --filter user=alice
slurm-mcp describe accounting作为 MCP 服务器
pip install -e ".[server]"
slurm-mcp serve # stdio; add --fixtures to serve recorded data将任何 MCP 客户端指向该命令。每个响应都会标记为 [live] 或 [fixture],因此已被记录的数据永远不会被误认为是一次实时集群读取。
局限
只读仅在本服务器自身的工具表面上强制执行。 它不会对宿主机进行沙箱保护,也不决定一个代理手里的其他工具能干些什么。
这些测试数据是说明性的,不是基准。 它们用于展示一个合理的集群形态,以使工具层面可运行;不应引用其中的任何结果。
没有评分。 这里的声明是关于工具表面,而不是诊断准确性的。衡量渐进披露是否能改变某些代理的诊断,是
cluster-sre-agent的工作,而这项工作尚未开展。单一 Slurm 方言。 输出格式是针对 Slurm 25.x 列布局进行测试的。较旧版本可能有所不同。
sacct可能发生阻塞。 accounting 路径通知可能会出现故障导致挂起而不是报错;调用在 20 秒超时并会明确说明这一点,因为一个永远等待的代理比一个被告知失败坏的代理更糟。
相关链接
cluster-sre-agent —— 使用这种工具面的代理。这种设计正是出自其内部最大的只读工具层; 本仓库是独立的服务器。
cluster-ops-skills —— 代理一旦能够读取集群就能遵循的运维手册。
slurm-rca-bench —— 在这里,关于诊断质量的任何主张都必须得到证明确认。
许可证
MIT。
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
- AlicenseAqualityDmaintenanceEnables read-only interaction with Proxmox homelab VMs and containers, allowing LLM agents to list VMs, monitor status and performance metrics, view snapshots, and check cluster health through natural language queries.8MIT
- AlicenseNot gradedqualityNot gradedmaintenanceProvides AI assistants with safe, read-only access to Linux systemd services, including status monitoring, log querying, and dependency analysis, with optional granular permissions for service management actions.2
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Slurm HPC clusters via SSH, allowing job submission, monitoring, and error diagnosis through MCP clients like Claude Desktop.6MIT
- 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
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Runtime permission, approval, and audit layer for AI agent tool execution.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
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/Zhanyl-tech/slurm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server