# MCP Server

Want to manage Cloudback from your AI chat? Connect the Cloudback MCP server to Claude Code, Claude Desktop, Cursor, VS Code, or any other MCP-compatible client and change schedules, storages, and retention policies just by asking.

![Cloudback MCP Server in Visual Studio Code](https://2781059148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQEI7SjBF2CddqNXZpCoE%2Fuploads%2Fgit-blob-98f12f71dcad22d811bb7cb751494b5782f2b8fc%2Fvscode-cloudback-mcp.png?alt=media)

## Quick setup

You need Docker installed and an MCP-compatible client. You can connect multiple accounts across different platforms in a single setup — each account uses its own API key.

### 1. Create API keys

Open the [API Keys page](https://app.cloudback.it/apikeys) and create an Operations API key for **each account** you want the assistant to manage. You can configure as many accounts as you like — one key per account.

### 2. Create `appsettings.json`

Save this file anywhere on your machine (for example, at `~/cloudback-mcp/appsettings.json`). You'll point the container at it in the next step.

```json
{
  "OpsApi": {
    "BaseUrl": "https://app.cloudback.it/",
    "Account": {
      "1": "GitHub::your-org::your-api-key",
      "2": "GitLab::your-group::your-api-key"
    }
  }
}
```

Add one entry per account you want to expose. Each entry's value is `Platform::Account::ApiKey`, and the keys (`1`, `2`, ...) just need to be unique. Supported platforms (case-insensitive): `GitHub`, `AzureDevOps`, `GitLab`, `Linear`.

### 3. Register the server with your MCP client

In VS Code, open (or create) `.vscode/mcp.json` in your workspace — or your user-level `mcp.json` — and paste:

```json
{
  "servers": {
    "cloudback-ops": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v", "/absolute/path/to/appsettings.json:/app/appsettings.json:ro",
        "myrtlelabs/cloudback-mcp:latest"
      ],
      "type": "stdio"
    }
  }
}
```

Replace `/absolute/path/to/appsettings.json` with the full path to the file you created in step 2.

The same `docker run` invocation works with Claude Code, Claude Desktop, Cursor, and any other stdio MCP client — check your client's docs for where to put its MCP config.

Reload the client and you're done.

## Typical prompts

Once connected, ask things like:

* *"List my Cloudback accounts."*
* *"What backup definitions are enabled in my GitHub account?"*
* *"Switch every repo with `prod` in the name to daily backups at 3 AM UTC."*
* *"Create a new schedule that runs at 2 AM every day and make it the default."*
* *"Change the retention policy to `Keep 30 days` for all GitLab definitions using the `S3-main` storage."*
* *"Show me which storages are configured for my Linear workspace and delete the old `S3-test` one."*
* *"Update my account defaults: timezone `Europe/Berlin`, default schedule `Daily at 2 AM`."*

## Troubleshooting

* **`No accounts configured`** — the `appsettings.json` mount is wrong. Double-check the host path after `-v` and that it maps to `/app/appsettings.json` inside the container.
* **`No API key configured for platform '...' and account '...'`** — the platform/account the assistant tried to use isn't in your `appsettings.json`. Ask it to list configured accounts first; lookup is case-insensitive but typos still fail.
* **Client shows a protocol error, or nothing happens** — the MCP client must use the stdio transport. Don't wrap or redirect stdout; server logs go to stderr.

## References

* [Operations API](https://docs.cloudback.it/automation/operations-api) — the underlying HTTP API the server wraps
* [Terraform Provider](https://docs.cloudback.it/automation/terraform-provider)
* [Cloudback API Keys](https://app.cloudback.it/apikeys)
* [`myrtlelabs/cloudback-mcp` on Docker Hub](https://hub.docker.com/r/myrtlelabs/cloudback-mcp)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudback.it/automation/mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
