dtu-hpc

dtu-hpc

Connects MCP-capable agents to the DTU Computing Center cluster for submitting, monitoring, and chaining LSF jobs without shell access.

Category
访问服务器

README

dtu-hpc

Let your coding agent run your DTU HPC jobs — without ever giving it a shell.

dtu-hpc connects MCP-capable agents (Claude Code, Codex, and others) to the DTU Computing Center cluster through a small, audited set of operations. You authenticate once a day; your agent submits, monitors, chains, and diagnoses LSF jobs while you direct the research. No SSH terminal, no Cisco VPN in your daily loop, and no interactive shell on the login node — every action the agent can take is a named, argument-validated operation under limits it cannot raise.

Why not just give the agent SSH?

Because your student account is personally accountable for everything that happens on a shared, rationed cluster — and agents are already being used over raw SSH today, with no guardrails at all. This tool is the safer path for something that is happening anyway:

  • No shell on the login node. Agents choose from named operations (submit job, check queue, fetch logs). Every argument is validated. There is no "run this command", and agents never supply script text — they send a spec, and the trusted daemon writes the job script itself.
  • Jailed writes. Agents can only touch approved project folders, with paths re-checked after the server resolves them, so a planted symlink can't escape. Your dotfiles and SSH keys are structurally out of reach.
  • Hard limits the agent cannot raise. GPUs, cores, memory, walltime, chain length, concurrent jobs, and submissions per hour, enforced inside the credentialed daemon from a file outside your project. Raising one takes a human edit plus a restart.
  • Audit trail. Every action — including every denied one — is logged locally. You can always answer "what did my agent do on the cluster?"
  • One kill switch. All access flows through one daemon on your laptop. Stop it and every agent loses cluster access instantly. (Jobs already queued keep running on DTU — dtu-hpc down tells you which, so you can cancel them first if that's what you meant.)
  • Nothing installed on the cluster. DCC sees ordinary SSH sessions and ordinary, well-formed job submissions. No daemons on login nodes.
  • No telemetry. This tool never phones home. Your usage data is yours.

What your agent gets good at

DCC runs LSF, which most tutorials (and most LLMs) get wrong — they emit SLURM syntax the cluster rejects, or omit the flags that silently kill jobs at 15 minutes and 1 GB of RAM. The templates here encode the cluster's real rules, including the one that matters most for ML work:

GPU jobs die at 24 hours. dtu-hpc treats longer runs as first-class: hpc_submit_chain splits a 72-hour training run into three checkpointed, dependency-linked segments that resume from each other, with LSF signalling your trainer ten minutes before each kill so it can flush a checkpoint.

Architecture

Claude Code / Codex        agents: disposable, hold no secrets
        │  stdio (MCP)
   dtu-hpc MCP server      stateless adapter
        │  loopback + per-run token
      dtuhpcd              you type your password HERE, once — nowhere else
        │  one persistent SSH session
 login.hpc.dtu.dk → LSF    cluster sees a normal user session

Setup (once)

# Not on PyPI yet — install from source:
git clone https://github.com/PV-Bhat/dtu-hpc-mcp && cd dtu-hpc-mcp
python -m venv .venv && .venv/Scripts/activate     # Linux/macOS: source .venv/bin/activate
pip install -e .
dtu-hpc init               # key setup + cluster install + agent config snippets

init walks you through installing an SSH key on the cluster (you type your DTU password into OpenSSH's own prompt — this tool never sees it). After that, the VPN is no longer needed for cluster work.

Daily use

dtu-hpc up                 # start the control plane, authenticate once
dtu-hpc status             # check it
dtu-hpc audit              # see everything your agents did
dtu-hpc down               # revoke all agent access

Then talk to your agent:

"Run the GRPO config on 2 A100s with a 4-hour budget, and chase it — if it OOMs, halve the batch size and resubmit."

What this does NOT protect against

Being straight about the boundary, because the audience is students staking a real account: a batch job is arbitrary code running as you on a compute node. That is what a batch job is on every cluster. This tool bounds what gets submitted — resources, destinations, rate — and records all of it. It does not sandbox the code inside your job, and an agent that can submit jobs effectively has your Unix account on the compute nodes. The audit log is a plain file, so it is evidence against a confused agent, not a hostile one. Run this with agents you'd trust with your cluster account, and read the log.

Safety model in one paragraph

The daemon holds the only credential and the only connection. Agents reach it through a token-gated loopback socket and can only invoke allowlisted operations with regex-validated arguments. Writes are confined to declared project roots, re-validated after the server resolves symlinks. Job scripts are rendered by the daemon from a spec — agents never supply shell — and are checked against ceilings held outside the project tree, so a profile an agent can edit cannot raise them. Every operation, parameter, and denial is appended to a local audit log. Killing one process revokes access.

Status

Early but real: read, sync, submit, and chain paths all work and have been exercised against DCC. Five independent code reviews (2026-07) found and fixed a class of bugs where resource limits were enforced in the wrong process; see DESIGN.md §2 for what changed and why.

Known gaps, honestly: there is no durable run ledger yet, so a run's story lives across a manifest, the scheduler, and logs rather than one place. Human approval above thresholds is currently asserted by the agent rather than confirmed through a trusted channel. Artifact fetch (pulling results back) isn't built. There are no tests yet.

Issues and PRs welcome — especially from other DTU students. If you run a cluster and want a backend for it, lsf.py is the template to copy.

For DCC / HPC support staff

This tool submits standard bsub jobs from a standard SSH session and runs nothing on your infrastructure. It exists to make agent-assisted usage more conservative than manual usage: validated scripts, capped resources, no login-node compute, full local audit. We'd welcome your review of the operation allowlist — open an issue or reach out.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选