Docs

Agents and MCP

Give an agent a token it can't overspend, and connect it over MCP.

Give the agent its own token

On API & agents, create a token for the agent with only what it needs:

  • Scopes read and rent (not manage or billing).
  • A spend cap in dollars, a longest rental in hours, and an expiry.

The token is shown once. Keep it in the agent's secret store, never in a prompt or a repository. A capped token must set a shutdown time on every rental, and a rental that would pass its cap is refused.

Connect over MCP

The MCP endpoint is $ARRAKIS_URL/mcp, using the agent's token. It speaks MCP's streamable HTTP with plain JSON responses.

Claude Code:

Shell
claude mcp add --transport http arrakis $ARRAKIS_URL/mcp --header "Authorization: Bearer ark_..."

Cursor (mcp.json):

JSON
{
  "mcpServers": {
    "arrakis": {
      "url": "$ARRAKIS_URL/mcp",
      "headers": { "Authorization": "Bearer ark_..." }
    }
  }
}

Tools

ToolWhat it does
search_gpusFinds machines, cheapest first. Filters: GPU type, minimum GPUs, max price per GPU-hour, country.
get_market_summaryWhat the GPU markets list, by GPU family, and whether Arrakis rents yet.
get_balanceWhat the balance can pay.
rent_gpuRents a machine; returns it with its SSH command. Billable.
list_instancesYour machines.
get_instanceOne machine, refreshed.
terminate_instanceStops and removes a machine.
schedule_removalSets when a machine removes itself.

Retries never rent twice

Give each intended rental a stable idempotency_key. Retrying with the same key returns the same machine instead of a second bill.

A good first prompt

Reading this as an agent? This page as Markdown.