agentmetal
v0.3.5Rent a Linux VPS from an AI agent: provision, SSH in, run commands.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
provision_server Provision a server
Provision a brand-new Linux VPS and pay for it in a single call. SPENDS REAL USDC — the payment is signed on-chain via x402 (Base) up to this MCP server's per-call spend cap; it is a real charge, not a quote or a dry run. Returns the server id (srv_…), public IPv4, and an SSH target (`ssh root@<ip>`, or `ssh -p <port> root@<ip>` in cdmx-1), usually reachable in under 60 seconds. Use when an agent needs its own compute to build, run, or host something with no human signup. Pass `ssh_key` to get inbound SSH; omit it and the box boots with no way to log in. The lease lasts `days` days, after…
| Parameter | Type | Description |
|---|---|---|
days * | integer | Lease length in whole days (1–30). The server auto-destroys at expiry unless extended; you pay up front for the whole lease. |
plan * | string | Server size / price tier: "nano" (smallest, cheapest), "small", or "medium". Choose the smallest that fits the workload. |
location | string | Optional zone. Omit for the default (Hetzner US, with fallback). "cdmx-1" is our own bare metal in Mexico City: Ubuntu 22.04/24.04 only, SSH on a per-box port of a shared IP, no storage or firewall AP… |
managed_key | boolean | Generate a server-side SSH keypair, authorize it on the box, and return the private key ONCE; enables exec_command. Stored only encrypted server-side. |
os | string | Optional OS image, e.g. "ubuntu-24.04" (default), "debian-12", "fedora-44", "rocky-9". Call get_catalog for the full list. |
ssh_key | string | Optional single-line OpenSSH public key (e.g. "ssh-ed25519 AAAA…") authorized for root SSH. Omit and the box has NO inbound SSH access. |
via | string | Optional attribution tag (e.g. the calling skill name). Analytics only; does not affect provisioning. |
get_server Get server status
Look up one server's live status (provisioning | running | suspended | expired | destroyed), public IPv4, lease expiry (unix seconds), and bandwidth usage. Read-only — never charges money or changes the server. Use to confirm a box is up and reachable, or to see how long it has before auto-destroy.
| Parameter | Type | Description |
|---|---|---|
id * | string | Server id returned by provision_server, e.g. "srv_abc123". |
list_servers List your servers
List every server (the fleet) for a payer wallet, or for the whole account when an account API key is configured. Read-only — never charges or changes anything. Defaults to the wallet configured on this MCP server; pass `wallet` to list a different payer. Use to enumerate active boxes before calling extend_server or destroy_server.
| Parameter | Type | Description |
|---|---|---|
wallet | string | Optional payer wallet address (0x…) whose servers to list. Defaults to this MCP server's configured wallet. |
extend_server Extend a server lease
Extend an existing server's lease so it is not auto-destroyed at expiry. SPENDS REAL USDC — signed on-chain via x402 (Base) up to the per-call spend cap; a real charge. Adds `days` days to the current expiry and returns the new expiry (unix seconds). Use before a lease runs out to keep a box alive; check the current expiry first with get_server.
| Parameter | Type | Description |
|---|---|---|
days * | integer | Whole days to add to the current lease (1–30). |
id * | string | Server id to extend, e.g. "srv_abc123". |
destroy_server Destroy a server
Permanently destroy a server RIGHT NOW, before its lease expires. IRREVERSIBLE — the VM and all its data are deleted and remaining lease time is NOT refunded. Requires an account API key (AGENTMETAL_API_KEY); without one this returns an auth error. Use to free quota or stop holding an unneeded box. To let a box expire naturally instead, simply do not extend it.
| Parameter | Type | Description |
|---|---|---|
id * | string | Server id to destroy, e.g. "srv_abc123". This action cannot be undone. |
get_catalog List plans, locations, and pricing
List available server plans (size + price), the regions servers can run in, and add-on pricing for bandwidth and storage. FREE — read-only, charges no money and needs no wallet or account. Call this FIRST to see what sizes, regions, and prices are on offer before provisioning a server.
reboot_server Reboot a server
Soft-reboot a server (graceful ACPI restart) without destroying it or losing data. Use to recover a box that has become unresponsive or to apply changes that need a restart. Requires an account API key (AGENTMETAL_API_KEY) and ownership of the server; without one this returns an auth error. Does not charge money. Returns immediately with status "rebooting"; the box is back in well under a minute.
| Parameter | Type | Description |
|---|---|---|
id * | string | Server id to reboot, e.g. "srv_abc123". |
exec_command Run a command on a server
Run a single shell command as ROOT on a server over SSH and get back its exit code, stdout, and stderr. Requires (1) an account API key (AGENTMETAL_API_KEY) AND ownership of the server, and (2) a server provisioned with managed_key:true — the only way the API holds a key it can log in with; a box created without managed_key returns "no_managed_key". The command runs in a non-interactive shell with no TTY, so avoid prompts; chain steps with && or ;. Execution is bounded by `timeout_seconds` (1–120, default 60); if it overruns, the process is killed and `timed_out` is true. Output is capped…
| Parameter | Type | Description |
|---|---|---|
command * | string | The shell command to run as root (non-empty, ≤4096 chars). Runs non-interactively; chain steps with && or ;. |
id * | string | Server id to run the command on, e.g. "srv_abc123". Must be a running, managed-key server you own. |
timeout_seconds | integer | Max seconds to wait before the command is killed (1–120, default 60). On overrun, timed_out is true. |
server_logs Server diagnostics (hypervisor-level)
Hypervisor-level diagnostics for a server WITHOUT logging into it: current status, recent provider actions (with any error messages), a VNC console URL + one-time password, and live CPU / disk / network metrics. Use to diagnose a stuck, unreachable, or misbehaving box from the outside. Requires an account API key (AGENTMETAL_API_KEY) and ownership; does not charge money. NOTE: the cloud provider exposes no text serial-console / boot log, so this returns actions + console access + metrics, not a plain-text log — open the VNC console URL for screen-level access.
| Parameter | Type | Description |
|---|---|---|
id * | string | Server id to diagnose, e.g. "srv_abc123". |
get_firewall List a server firewall
List a server's inbound firewall rules (the edge Hetzner Cloud Firewall). New boxes boot locked-down (SSH + ICMP only); other ports are opened with manage_firewall. Read-only, no charge. `managed:false` with a note means the box has no edge firewall (legacy box; nothing to manage here). Requires an account API key (AGENTMETAL_API_KEY) and ownership.
| Parameter | Type | Description |
|---|---|---|
id * | string | Server id whose firewall to list, e.g. "srv_abc123". |
manage_firewall Open or close a firewall port
Open or close a single port on a server's edge firewall so it can (or can't) serve traffic. Does not charge money. Requires an account API key (AGENTMETAL_API_KEY) and ownership of the server. The last SSH (port 22) rule cannot be removed unless force:true (it would lock you out). Use action "open" to expose e.g. 443 for a web server, "close" to remove a rule.
| Parameter | Type | Description |
|---|---|---|
action * | string | "open" adds an allow rule; "close" removes the matching rule. |
id * | string | Server id to manage, e.g. "srv_abc123". |
protocol * | string | Rule protocol. Most web/app ports are tcp. |
description | string | Optional human label for the rule. |
force | boolean | Required (true) to remove the last SSH (22) rule; guards against locking yourself out. |
port | string | Port or range for tcp/udp, e.g. "443" or "8000-9000". Omit for icmp/esp/gre. |
source_ips | array | Allowed source CIDRs (e.g. ["0.0.0.0/0","::/0"]). Defaults to the whole internet. |
claim_account Claim an account (request code)
Begin claiming an AgentMetal account by email. Sends a one-time 6-digit code to the address; redeem it with verify_claim to get an account API key. Side effect: sends one email. Does not charge. Accounts are OPTIONAL — they add fleet management under one key, monthly card billing, and higher quotas, but are not required to provision or pay. Call verify_claim next with the emailed code.
| Parameter | Type | Description |
|---|---|---|
email * | string | Email address that should receive the one-time 6-digit claim code. |
verify_claim Verify an account claim
Complete an account claim using the 6-digit code emailed by claim_account. Returns a long-lived account API key (am_live_…) — store it securely; it authorizes destroy_server and account-scoped calls. Optionally link a wallet so its existing servers attach to the account — this REQUIRES wallet_signature: sign the exact message "AgentMetal: link wallet <wallet> to <email>" with the wallet and pass the 0x signature (without it the API rejects the wallet with the message to sign). The code expires 10 minutes after claim_account and is invalidated after 5 wrong attempts.
| Parameter | Type | Description |
|---|---|---|
code * | string | The 6-digit code from the claim email. |
email * | string | The same email address you passed to claim_account. |
wallet | string | Optional wallet address (0x…) to link to the account, attaching its existing servers. Requires wallet_signature. |
wallet_signature | string | Required when `wallet` is set: the 0x signature of "AgentMetal: link wallet <wallet> to <email>" signed by that wallet, proving control of it. |