duplicati-mcp

duplicati-mcp

MCP server for managing Duplicati backups from an LLM.

Category
访问服务器

README

Duplicati MCP Server

MCP (Model Context Protocol) server for managing Duplicati backups from an LLM.

Version française / French version

Architecture

The server wraps the Duplicati REST API and exposes it via the MCP protocol. Two transports are supported:

  • stdio — for local use via Claude Code (no network, no port)
  • Streamable HTTP — for Docker deployment, accessible over the network

Getting Started

Local use with Claude Code (stdio)

The simplest way to get started. The .mcp.json at the project root handles everything:

# Install uv if needed
brew install uv

# Claude Code will auto-detect .mcp.json and launch the server

Set your Duplicati URL and password in .mcp.json:

{
  "mcpServers": {
    "duplicati": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "duplicati-mcp"],
      "env": {
        "DUPLICATI_URL": "http://localhost:8200",
        "DUPLICATI_PASSWORD": "your-password",
        "DUPLICATI_READONLY": ""
      }
    }
  }
}

With Docker Compose (Docker Hub image)

# Edit DUPLICATI_URL and DUPLICATI_PASSWORD in docker-compose.yml, then:
docker compose up -d

With Docker Compose (local build)

# Edit docker-compose.yml: comment out `image:` and uncomment `build: .`
docker compose up -d --build

Direct Docker usage

docker run -d \
  --name duplicati-mcp-server \
  -p 3000:3000 \
  -e DUPLICATI_URL=http://your-duplicati-host:8200 \
  -e DUPLICATI_PASSWORD=your-password \
  kcofoni/duplicati-mcp:latest

Verification

# Check that the server is running
docker logs duplicati-mcp-server

# Test the MCP endpoint
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

Client Configuration

Claude Code — local (stdio)

For local use without Docker, add to your project .mcp.json:

{
  "mcpServers": {
    "duplicati": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "duplicati-mcp"],
      "env": {
        "DUPLICATI_URL": "http://localhost:8200",
        "DUPLICATI_READONLY": ""
      }
    }
  }
}

Credentials are loaded from the .env file at the project root (see Getting Started).

Claude Code — Docker/remote (HTTP)

Add to your .mcp.json:

{
  "mcpServers": {
    "duplicati": {
      "type": "http",
      "url": "http://your-host:3000/mcp"
    }
  }
}

Claude Desktop

Claude Desktop requires mcp-proxy as a bridge to HTTP servers. Add to your configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "duplicati": {
      "command": "uvx",
      "args": ["mcp-proxy", "--transport", "streamablehttp", "http://your-host:3000/mcp"]
    }
  }
}

Available Tools

Once connected, the LLM has access to:

Backup Jobs

  1. list_backups — List all configured jobs with ID, name, last run date and result
  2. get_backup — Get detailed information about a specific job
  3. run_backup — Trigger a backup job immediately
  4. abort_backup — Abort the currently running backup for a job

Status & Progress

  1. get_progress — Live progress of the active backup task (phase, %, file counts)
  2. get_server_status — Duplicati server state, version and active task

Configuration

  1. export_backup_config — Export a job configuration as JSON
  2. update_backup_config — Update an existing job configuration in place (use with export_backup_config to modify sources, settings, schedule, etc.)
  3. import_backup_config — Import a job configuration from JSON (creates a new job)

History & Diagnostics (SQLite — requires DUPLICATI_DB_PATH)

  1. db_get_backup_metadata — Rich metadata from the local database: last run date, duration, file counts, quota usage, last error
  2. db_get_backup_schedule — Schedule configuration for a backup job
  3. db_list_errors — Recent error log entries, optionally filtered by job
  4. db_list_notifications — System notifications (update alerts, etc.)
  5. db_get_backup_options — Configuration options for a job (compression, retention policy, etc.) — passphrases excluded
  6. db_list_operations — Operation history for a job (Backup, Restore, List, etc.) with timestamps
  7. db_get_operation_log — Full result and statistics for a specific operation
  8. db_list_filesets — Available restore points (backup versions) for a job

Example Prompts

Once the server is connected to your LLM, here are prompts you can use:

General status

  • "What backup jobs are configured on my Duplicati?"
  • "What was the last backup that ran and what was the result?"
  • "Is a backup currently running?"

History & statistics (requires DUPLICATI_DB_PATH)

  • "Show me the last 10 operations for backup job 2"
  • "What is the average duration of recent backups?"
  • "Have there been any errors on my backups in the past few weeks?"
  • "How many files are backed up and what is the total size on the destination?"

Restore points (requires DUPLICATI_DB_PATH)

  • "What restore points are available for my backup job?"
  • "What is the oldest backup available for a restore?"

Configuration (requires DUPLICATI_DB_PATH)

  • "What retention policy is configured on my backup job?"
  • "What compression and encryption options are in use?"

Diagnostics (requires DUPLICATI_DB_PATH)

  • "Are there any pending system notifications on Duplicati?"
  • "Has my Duplicati encountered any errors recently? Which ones?"
  • "Analyse the last backup and tell me if everything went well"

Open-ended (combines multiple tools)

  • "Give me a full health report on my Duplicati backups"

Environment Variables

Variable Default Description
DUPLICATI_URL http://localhost:8200 URL of the Duplicati instance
DUPLICATI_PASSWORD (empty) Duplicati web interface password (leave empty if none set)
DUPLICATI_READONLY (empty) Set to true, 1 or yes to disable write operations
DUPLICATI_DB_PATH (empty) Path to Duplicati-server.sqlite — enables SQLite-backed history tools
MCP_TRANSPORT stdio Transport: stdio or streamable-http
MCP_PORT 3000 Port for Streamable HTTP transport

Read-only Mode

DUPLICATI_READONLY=true disables run_backup, abort_backup, update_backup_config and import_backup_config. All read tools remain active. Useful for safely exploring and analysing backup configurations without any risk of modification.

SQLite Access

Setting DUPLICATI_DB_PATH enables the db_* tools, which read directly from the Duplicati SQLite databases. Access is strictly read-only: databases are opened in read-only mode and copied to memory via the SQLite Online Backup API before any query — the live Duplicati databases are never locked or modified.

Local use — point to the server database on your machine:

DUPLICATI_DB_PATH=/path/to/duplicati/config/Duplicati-server.sqlite

Docker — share the Duplicati config directory as a read-only volume. In docker-compose.yml:

services:
  duplicati-mcp:
    # ...
    volumes:
      - duplicati_config:/duplicati-config:ro   # named volume (recommended)
      # or: - /srv/duplicati/config:/duplicati-config:ro  # bind mount
    environment:
      - DUPLICATI_DB_PATH=/duplicati-config/Duplicati-server.sqlite

volumes:
  duplicati_config:   # must be the same volume used by the Duplicati container

Docker Hub

docker pull kcofoni/duplicati-mcp:latest

Development

File Structure

duplicati-mcp/
├── src/
│   └── duplicati_mcp/
│       ├── __init__.py
│       ├── __main__.py
│       ├── client.py        # Duplicati REST API client
│       ├── db.py            # Read-only SQLite access (server DB + per-backup DBs)
│       └── server.py        # FastMCP server and tools
├── mcp-publication/         # MCP registry publication files
├── requirements.txt         # Python dependencies
├── pyproject.toml           # Project metadata
├── Dockerfile
├── docker-compose.yml
├── .mcp.json                # Claude Code local config (stdio)
├── test_server.sh           # Docker container smoke test
├── test_mcp.py              # MCP protocol test
├── README.md                # This file (English)
└── README_fr.md             # French documentation

Running Tests

# Smoke test (requires running Docker container)
./test_server.sh

# MCP protocol test (requires running server)
python test_mcp.py
python test_mcp.py localhost:3000

Interactive Tool Testing (local)

uv run mcp dev src/duplicati_mcp/server.py

Troubleshooting

Cannot connect to Duplicati

Check that DUPLICATI_URL is reachable from the container. If both run in Docker, put them on the same network and use the service name as hostname.

Authentication failed

Verify DUPLICATI_PASSWORD matches the password set in Duplicati's web interface. Leave empty if no password is configured.

MCP endpoint not responding

docker ps | grep duplicati-mcp-server
docker logs duplicati-mcp-server

License

This project is licensed under the MIT License — see the LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选