autodl
Allows deploying Gitee-hosted repositories to AutoDL GPU instances through the same deploy workflow, automatically skipping the academic proxy for domestic-hosted code.
Allows deploying GitHub-hosted repositories to AutoDL GPU instances, including cloning, installing dependencies, running commands, and optionally reusing or stopping the instance afterward.
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., "@autodlcreate a 4090 GPU with a 2-hour shutdown and wait until it's ready"
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.
autodl-cli
Unofficial. This project is not affiliated with, endorsed by, or sponsored by AutoDL. "AutoDL" is used only to identify the platform this tool talks to.
Manage AutoDL GPU instances from the command line — and let your coding agent do it too.
Built on AutoDL's official open API, so the developer token stays valid indefinitely and nothing breaks when the web console is redesigned.
Why
When an AI agent needs a GPU box mid-task, it has no way to get one: AutoDL's instances are created by clicking through a web console. This gives the agent three ways in, all backed by the same core:
Entry point | For | How |
CLI | humans |
|
MCP server | Claude Code, Cursor, Cline, … |
|
SDK | Node programs |
|
Every command speaks --json with a stable schema and a documented exit code, so an
agent can branch on the result without parsing prose.
Related MCP server: lab-ops
Install
npm install -g @minatoaqukin/autodl-cli # then: autodl <command>
npx @minatoaqukin/autodl-cli <command> # or without installingRequires Node.js 22+.
The dashboard
autodl tui # or just `autodl` in an interactive terminalOn a machine with no token yet it opens on a login screen offering two things —
configure a token, or quit. Paste the token, it is verified against the API before
being saved, and you land on the dashboard. Once configured, autodl goes straight in.
A live table of your instances: status, GPU, region, how long each has been powered on
and roughly what that has cost, and how much TTL is left. Keys: ↑↓ move, Enter
detail, s start, x stop, c copy the SSH command to the clipboard, Ctrl+D release, g GPU stock,
n new instance, r refresh, q quit. Release sits on Ctrl+D rather than a bare key
because it wipes the instance permanently.
It fills the terminal and shows your account id and balance in the header. Copying with
c puts only the SSH command on the clipboard — never the root password, which any
process could then read. Where no clipboard helper exists (SSH sessions, containers) it
falls back to OSC 52 and says so, since the terminal never confirms.
It runs on the terminal's alternate screen, so it owns a fixed canvas instead of scrolling below whatever was already there, and quitting restores your prompt and scrollback untouched.
It exists because AutoDL bills on power state: the expensive mistake is not a wrong command, it's an instance nobody remembered to stop. Leaving this open makes that visible.
Two deliberate honesty constraints. A rate is only knowable from a running instance's snapshot, so a stopped instance shows elapsed time and no money — inventing a number would be worse than showing none. And while a rate is still loading the total says so rather than quietly under-reporting.
The TUI never runs in a pipe, in CI, or under --json: it exits with code 2 and an
explanation instead of taking over a terminal that isn't there. A bare autodl outside
an interactive terminal still prints help exactly as before.
Setup
The official API needs a developer token from an identity-verified account (个人或企业实名认证). Get it from the AutoDL console → 设置 → 开发者 Token.
autodl login # verifies the token, then saves it with 0600 permissions
autodl account # balance, vouchers, lifetime spendToken precedence: --token › AUTODL_TOKEN › ~/.config/autodl-cli/config.json.
Quick start
# Rent a GPU that shuts itself off after two hours, and wait until it's ready
autodl create --gpu 4090 --ttl 2h --wait
# Work with it
autodl ls
autodl ssh pro-76419909953e # interactive login
autodl exec pro-76419909953e "nvidia-smi" # one-off command, remote exit code
autodl push pro-76419909953e ./src /root/work # SFTP upload
autodl pull pro-76419909953e /root/work/out . # SFTP download
# Stop paying
autodl stop pro-76419909953e
autodl rm pro-76419909953e --yes # irreversible: wipes all dataOr do the whole thing in one verb:
autodl run "python train.py" \
--gpu 4090 --sync ./ --pull /root/autodl-cli/checkpoints --ttl 4hThat creates an instance, waits for it, uploads your code, streams the command's output, downloads the results, and powers the instance off — including on Ctrl-C.
Use it from an agent
Claude Code
claude mcp add autodl -- npx -y @minatoaqukin/autodl-cli mcpCursor / Cline / any MCP client
{
"mcpServers": {
"autodl": {
"command": "npx",
"args": ["-y", "@minatoaqukin/autodl-cli", "mcp"],
"env": { "AUTODL_TOKEN": "your-token" }
}
}
}Tools exposed: autodl_account_info, autodl_list_instances, autodl_get_instance,
autodl_create_instance, autodl_power_on, autodl_power_off,
autodl_release_instance, autodl_exec, autodl_upload, autodl_download,
autodl_run, autodl_list_gpu_specs, autodl_list_images, autodl_save_image,
autodl_sweep_expired. Plus an autodl://instances resource.
MCP defaults are deliberately stricter than the CLI's, because nobody is watching:
a 2-hour TTL is applied unless you ask for longer, releasing requires an explicit
confirm: true, and passwords come back redacted unless requested.
Shell / CI
autodl ls --json | jq -r '.data[] | select(.status=="running") | .uuid'Deploying a git project
# Rent a box, clone, auto-install dependencies, run it, then stop the instance
autodl deploy owner/repo --gpu 4090 --start "python train.py" --ttl 4h
# Long-running service: background it and keep the instance up
autodl deploy owner/repo --gpu 4090 --start "python app.py" --detach
# Come back later — powers the same box on and `git pull`s, no rebuild
autodl deploy owner/repo --instance pro-76419909953e --start "python train.py"deploy differs from run in one deliberate way: it stops the instance at the end
instead of releasing it. A stopped instance keeps its disks, so the next deploy reuses
the environment you already built. --on-finish release opts out.
Code lands in /root/autodl-tmp/<repo> — the data disk. AutoDL's system disk is a fixed
30GB that also gets packed into any saved image; the data disk is separate, faster and
expandable. The trade-off worth knowing: data-disk contents are not included when you
save an image, so put the environment on the system disk and the code here.
Dependencies are auto-detected in this order, first hit wins — environment.yml →
requirements.txt → pyproject.toml → package-lock.json/package.json. Override with
--setup "<cmd>", or skip with --no-setup.
Remote commands run through a login shell. AutoDL images keep python, pip and
conda in /root/miniconda3/bin, which only reaches PATH via the login profile — a
plain non-interactive ssh host "pip install ..." exits 127. This applies to
autodl exec too, so it behaves the way it does when you autodl ssh in by hand.
Cloning from GitHub or HuggingFace automatically enables AutoDL's academic proxy
(source /etc/network_turbo). Gitee is domestic and skips it. --no-accel disables it.
AutoDL notes the proxy is "for academic use, with no stability guarantee".
Private repos: --git-token, or GIT_TOKEN / GITHUB_TOKEN in the environment. The
token never reaches a log line, an error message, --json output, or the checkout's
stored git remote.
Checking GPU stock
autodl stock --gpu 4090 # where are the free cards
autodl stock # everything, everywhereRead this table carefully — the numbers are less authoritative than they look. They
come from AutoDL's elastic-deployment stock endpoint, the only capacity API that exists,
and it does not track Pro instance availability. Measured on 2026-08-23: it reported 140
idle RTX 4090D in westDC3 while creating a Pro instance there answered "暂无库存" —
and the identical request with no region constraint succeeded, landing in beijingDC2.
Two consequences, both baked into the tool:
Creating an instance never narrows regions on its own. Omitting
data_center_listgives AutoDL the widest choice, which empirically succeeds most often.Only two regions accept a Pro instance at all:
westDC3(西北B区) andbeijingDC2(北京B区). The other nine in the stock table are elastic-deployment only; passing one to--regionis rejected up front rather than failing later with AutoDL's opaque "请求参数错误". The可建Procolumn marks which is which.
The cost guard
AutoDL bills purely on power state. An instance that finished training an hour ago costs exactly as much as one at 100% utilisation. This is the single easiest way for an unattended agent to waste real money, so the protection is built in rather than optional.
Three layers:
Inside the instance.
--ttl 2harms a detachedsleep && shutdownon the box itself viastart_command. It fires even if this CLI is killed, your laptop sleeps, or the network dies. This is the layer that actually protects your wallet.A local ledger. Every command opportunistically sweeps instances past their TTL and powers them off. Catches the cases layer 1 can't — a
start_commandthat silently failed, or a manual power-on with no fresh timer.Idle detection.
autodl guard idle <id>samples GPU utilisation over SSH and shuts down after a sustained lull.
autodl guard ttl pro-xxx 2h # arm/re-arm on a running instance
autodl guard cancel pro-xxx # disarm
autodl guard list # what this machine is tracking
autodl guard sweep # reclaim everything past its TTL now
autodl guard idle pro-xxx --threshold 5 --samples 6 --interval 1mA balance gate also refuses to create an instance when your wallet is below
--min-balance (default ¥5). AutoDL doesn't reclaim instances the moment the balance
hits zero — it keeps them to protect your data — so a low balance turns into a stuck,
unusable instance rather than a clean failure.
The agent contract
Stable across minor versions. Breaking changes require a major.
stdout in --json mode is pure JSON. Progress, prompts and warnings all go to
stderr, so autodl ... --json | jq is always safe.
// success
{ "ok": true, "data": { /* ... */ } }
// failure
{ "ok": false, "error": { "code": "NO_STOCK", "message": "…", "hint": "…", "requestId": "…" } }Exit | Meaning | Error codes |
0 | Success | — |
1 | Generic failure |
|
2 | Bad arguments |
|
3 | Token missing or invalid |
|
4 | Resource not found |
|
5 | Out of budget / blocked by a guard |
|
6 | No GPU stock |
|
7 | Timed out |
|
8 | SSH failure |
|
autodl exec and autodl run instead exit with the remote command's exit code, so
autodl exec box "make test" && deploy behaves the way you'd expect.
Commands
Command | What it does |
| Token management |
| Balance, vouchers, lifetime spend |
| List instances |
| Details, live SSH info, resource usage |
| Create a pay-as-you-go Pro instance |
| Power on / off / release |
| Interactive login (extra flags pass through to |
| Run a command, stream output, propagate exit code |
| SFTP transfer, recursive, respects ignore files |
| Create → sync → run → fetch → power off |
| Create → clone → install deps → start → stop, keeping data |
| Live GPU stock per region |
| Cost guards |
| Private image management |
| Catalogue lookup |
| Interactive dashboard (also entered by a bare |
| Run as an MCP server |
Global flags: --json, --yes, --token, --base-url, --lang zh|en, --verbose,
--no-color, --no-sweep.
push and pull skip .git, node_modules, __pycache__, .venv and friends, then
apply .autodlignore if present, falling back to .gitignore.
SDK
import {
AutoDLClient,
createInstance,
execCommand,
powerOffInstance,
waitForRunning,
} from "@minatoaqukin/autodl-cli";
const client = new AutoDLClient({ token: process.env.AUTODL_TOKEN! });
const uuid = await createInstance(client, {
gpuSpec: "v-48g",
gpuNum: 1,
imageUuid: "base-image-l2t43iu6uk",
cudaFrom: 118,
});
await waitForRunning(client, uuid);
const { stdout } = await execCommand(client, uuid, "nvidia-smi");
console.log(stdout);
await powerOffInstance(client, uuid);Everything re-exported from the package root is public API. Prices arrive as yuan
(number), timestamps as ISO strings, and Go's sql.NullTime shape is flattened to
string | null.
What the official API cannot do
These are AutoDL's limits, not this tool's. Knowing them up front saves a lot of confusion:
Pay-as-you-go only. No daily/weekly/monthly plans and no renewal endpoint.
Pro instances only. The seven specs in
autodl gpus— the cheaper standard instances aren't reachable through the open API.No usable stock query for Pro. The one capacity endpoint reports elastic-deployment stock, which demonstrably does not match Pro availability (see above). Creation is effectively a blind attempt; no capacity means exit code 6 and another spec to try.
Only two regions accept a Pro instance:
westDC3andbeijingDC2.No CPU-only boot yet. AutoDL's own wording is deliberately provisional:
payloadis documented as"gpu:有卡开机, 暂不支持API以无卡模式开机"— not yet supported, rather than never. Confirmed on a live instance 2026-08-24:cpu,no_gpu,nogpu,cpu_only,cpu-onlyandnoneall returnServerError | 不支持的启动模式, and an emptypayloadis accepted but boots with the GPU attached (start_mode: "gpu"). Use the web console for the ¥0.1/hr 无卡模式 in the meantime; this tool will expose it once the API does.Identity verification required before the API will respond at all.
Missing operations: rename, scheduled shutdown, resizing, migration, system reset.
SSH credentials can change on any power cycle — port and root password. AutoDL may reschedule the instance onto a different machine. It doesn't always happen (a real stop/start was observed keeping both identical), which is precisely what makes caching dangerous: a stale value works often enough to hide the bug until it doesn't. This tool re-reads them on every connection, so you never have to think about it.
runningdoes not mean sshd is ready. A freshly created instance reportsrunningbefore it accepts connections. Connection attempts here are spaced out rather than fired back to back.A non-interactive SSH session has almost no PATH. No python, pip or conda — they live in
/root/miniconda3/binand arrive only through the login profile. Every remote command here runs underbash -lcfor that reason.Releasing requires a completed shutdown, and a second
power_offon an instance that is already stopping is an error. Both are handled internally.
Also worth knowing: an instance left shut down for 15 consecutive days is released and its data wiped.
Verified against the live API on 2026-08-23: full lifecycle (create → SSH exec → SFTP round trip → stop → start → exec again → release) on a 4090D, total cost ¥0.10.
The GPU spec, region and base-image tables are baked in because the API exposes no catalogue endpoint. If AutoDL changes them, please open an issue.
Development
npm install
npm run build
npm test # 325 tests, no network access, no cost
npm run lint
npm run typecheckReal end-to-end tests rent an actual GPU and cost actual money, so they're opt-in:
AUTODL_E2E=1 AUTODL_TOKEN=<token> npm run test:e2eThey always power the instance down in an afterAll, even on failure. Add
AUTODL_E2E_RELEASE=1 to release it too.
Contributing
Issues and PRs welcome — see CONTRIBUTING.md. Especially valuable: corrections to the static catalogue, and real API error codes we haven't mapped yet (AutoDL doesn't document them).
License
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
- AlicenseNot gradedqualityCmaintenanceManages AutoDL GPU cloud instances, including lifecycle management, SSH operations, file transfer, and GPU monitoring.1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that converts SSH operations on training servers into AI-callable tools for GPU monitoring, job submission, file transfer, and more.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables management of AutoDL GPU resources including instance lifecycle, balance queries, elastic deployments, and notifications through typed MCP tools.2MIT
- FlicenseAqualityBmaintenanceMCP server that wraps the Vast.ai REST API to enable LLM agents to search GPU marketplace, rent machines, manage instance lifecycle, run commands, and inspect billing.201
Related MCP Connectors
Massed Compute MCP — GPU inventory, VM lifecycle, billing, SSH keys, and setup recipes.
Provision and manage a VPS for AI agents over MCP: register, order, get root, control the server.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
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/Minato-Aqukin/AutoDL-cli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server