# Set up VPS Snaps backups with an AI assistant

VPS Snaps backs up servers, databases, Docker volumes and files into storage the customer owns (an S3-compatible bucket or Google Drive). An AI assistant can set it up over MCP, at https://vpssnaps.com/api/mcp.

## What the person does first

1. Signs up at https://vpssnaps.com/register. API access is on the Standard plan and up.
2. Connects storage in the dashboard at https://vpssnaps.com/app/storage/new. Storage keys are never given to an assistant.
3. Creates an API key with Full access at https://vpssnaps.com/app/settings (API keys).
4. Adds the MCP server to their assistant. For Claude Code:

    claude mcp add --transport http vpssnaps https://vpssnaps.com/api/mcp --header "Authorization: Bearer vps_YOUR_KEY"

## What the assistant does

Set up VPS Snaps backups for this server using the vpssnaps MCP tools.

1. Check my plan and limits (get_account) and my storage (list_storage). If I have no storage connected, tell me to add it in the VPS Snaps dashboard and wait. Never ask me for storage keys or cloud tokens.
2. Look at what is on this machine: databases and how to reach them, Docker volumes (docker volume ls), and web roots or app directories worth keeping.
3. Propose a backup plan that fits my plan's limits: what to back up, how often, and how long to keep it. Wait for my OK.
4. Create an agent for this machine with the paths and options the plan needs. Show me the install command before you run it.
5. Once the agent reports CONNECTED, create the backup jobs, run each one once, and show me how each first run went.

## Rules

- Never ask for storage keys, cloud tokens or SSH keys. If storage is missing, send the person to the dashboard.
- Propose the plan and wait for the person's agreement before creating anything.
- Show the agent's install command before running it. It contains a token, shown once.
- For an agent, a database host of localhost means the agent's own container, unless the agent was created with host_network.
- File backups through an agent read paths mounted into its container; create the agent with every path the plan backs up.
- The plan's limits apply exactly as in the dashboard. get_account says what they are.

## Tools

- `get_account`: The workspace's plan, its limits (servers, backup jobs, fastest schedule, retention), what is already used, which job types the plan allows, and whether this API key can create things. Call this first, and plan within it.
- `list_storage`: Where backups can be written: the user's own S3-compatible buckets or Google Drive, connected in the dashboard. If there are none, ask the user to add one at https://vpssnaps.com/app/storage/new and wait. Never ask the user to paste storage keys or cloud tokens into this conversation.
- `list_agents`: The workspace's agents and whether each is connected. An agent is a container on the user's machine that runs backups there, connecting out to VPS Snaps.
- `create_agent`: Creates an agent and returns the `docker run` command that installs it, with its token inside (shown once). Say what it will back up: file_paths to mount for file backups, docker_volumes for Docker volume backups, host_network if a database on the machine listens on localhost. Show the user the command and run it on the machine only with their approval, then poll get_agent until status is CONNECTED.
- `get_agent`: One agent's status: PENDING until it first connects, then CONNECTED or DISCONNECTED.
- `list_backup_jobs`: Every backup job in the workspace, with its schedule and how its last run went.
- `create_backup_job`: Creates a scheduled backup of files, Docker volumes or one database, run by an agent (or a server added in the dashboard) into one of the user's storage destinations. Propose the plan to the user and get their agreement before creating jobs. The plan's limits apply exactly as in the dashboard; a refusal says which.
- `run_backup_job`: Starts a backup job now, outside its schedule. Returns the run's id: follow it with get_backup_run.
- `list_backup_runs`: Recent backup runs, newest first, for one job or the whole workspace.
- `get_backup_run`: A run's status, size and checksum, and the last 100 lines of its log, which say why a failed run failed.

## REST API

The same key works over REST, as `Authorization: Bearer vps_...`. Endpoints marked * need a key with Full access.

- `GET /api/v1/account`: Plan, limits, usage, and what this key may do
- `GET /api/v1/storage-destinations`: Storage destinations, never with their keys
- `POST /api/v1/storage-destinations` *: Connect an S3-compatible bucket
- `GET /api/v1/agents`: Agents and whether each is connected
- `POST /api/v1/agents` *: Create an agent; returns its install command once
- `GET /api/v1/agents/{id}`: One agent's status
- `GET /api/v1/servers`: Servers reached over SSH
- `POST /api/v1/servers` *: Add a server reached over SSH
- `GET /api/v1/backup-jobs`: Every backup job
- `POST /api/v1/backup-jobs` *: Create a backup job, with the dashboard's plan checks
- `GET /api/v1/backup-jobs/{id}`: One job with its recent runs
- `POST /api/v1/backup-jobs/{id}/run`: Start a backup now
- `GET /api/v1/backup-runs`: Recent runs, filterable
- `GET /api/v1/backup-runs/{id}`: One run, with its log

More: https://vpssnaps.com/ai-setup and https://vpssnaps.com/llms.txt
