Skip to main content

MCP Auto Backup

A lightweight backup tool for AI Agents built with Model Context Protocol (MCP). Simpler than Git, focused on quick backup needs.

Features

  • Single File & Folder Backup: Backup individual files or entire directories
  • Automatic Safety Backups: Creates safety backups before restore operations
  • Checksum Verification: SHA256 verification for data integrity
  • Compressed Archives: Efficient folder backup using gzip compression
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Async Operations: Non-blocking operations for large files
  • MCP Protocol: Full Model Context Protocol compliance for AI integration

Installation

From PyPI (Recommended)

pip install mcp-auto-backup

From Source

git clone https://github.com/yourusername/mcp-auto-backup.git
cd mcp-auto-backup
pip install -e .

Quick Start

1. Initialize the backup system

mcp-auto-backup init

2. Start the MCP server

mcp-auto-backup serve

3. Use with your AI agent

The server provides 8 MCP tools for backup operations:

  • backup_create - Backup a single file
  • backup_list - List backups for a file
  • backup_restore - Restore a file backup
  • backup_folder_create - Backup a folder
  • backup_folder_list - List folder backups
  • backup_folder_restore - Restore a folder backup
  • backup_list_all - List all backups
  • backup_cancel - Cancel active operations

MCP Tools Reference

File Operations

backup_create(file_path, context_description=None)

Create a backup of a single file.

# Example usage in AI agent
result = await call_tool("backup_create", {
    "file_path": "/path/to/important_file.py",
    "context_description": "Before refactoring"
})

backup_list(file_path)

List all backups for a specific file.

backups = await call_tool("backup_list", {
    "file_path": "/path/to/important_file.py"
})

backup_restore(backup_id, target_path=None)

Restore a file backup (creates safety backup first).

result = await call_tool("backup_restore", {
    "backup_id": "uuid-here",
    "target_path": "/optional/custom/path.py"
})

Folder Operations

backup_folder_create(folder_path, include_patterns=None, exclude_patterns=None, max_depth=None, context_description=None)

Create a backup of a folder with optional filtering.

result = await call_tool("backup_folder_create", {
    "folder_path": "/path/to/project",
    "exclude_patterns": ["*.tmp", "__pycache__", ".git"],
    "context_description": "Project milestone backup"
})

backup_folder_list(folder_path)

List all backups for a specific folder.

backup_folder_restore(backup_id, target_path)

Restore a folder backup.

Global Operations

backup_list_all()

List all backups in the system.

backup_cancel(operation_id)

Cancel an active backup operation.

Configuration

Configure via environment variables or .env file:

# Backup storage location
MCP_BACKUP_BACKUP_ROOT=/custom/backup/path

# Security settings
MCP_BACKUP_ENABLE_ENCRYPTION=true
MCP_BACKUP_ENCRYPTION_KEY=your-key-here

# Performance settings
MCP_BACKUP_MAX_FILE_SIZE=104857600  # 100MB
MCP_BACKUP_MAX_CONCURRENT_OPERATIONS=3

# Cleanup settings
MCP_BACKUP_AUTO_CLEANUP_DAYS=30

# Logging
MCP_BACKUP_LOG_LEVEL=INFO
MCP_BACKUP_LOG_FILE=/path/to/backup.log

CLI Commands

Server Management

# Start server with custom settings
mcp-auto-backup serve --backup-root /custom/path --log-level DEBUG

# Show system information
mcp-auto-backup info

# Initialize backup system
mcp-auto-backup init --backup-root /custom/path

Storage Structure

.mcp_backups/
├── metadata.json              # Global metadata
├── files/                     # File backups
│   └── {file_hash}/
│       ├── {backup_id}.data   # Backup data
│       └── {backup_id}.meta   # Backup metadata
└── folders/                   # Folder backups
    └── {folder_hash}/
        ├── {backup_id}.tar.gz # Compressed backup
        └── {backup_id}.meta   # Backup metadata

Safety Features

  • Automatic Safety Backups: Before any restore operation, the current file/folder is automatically backed up
  • Checksum Verification: All backups are verified with SHA256 checksums
  • Atomic Operations: Operations are atomic - they either complete fully or are rolled back
  • Path Validation: Prevents path traversal and other security issues

Development

Setup Development Environment

git clone https://github.com/yourusername/mcp-auto-backup.git
cd mcp-auto-backup
pip install -e ".[dev]"

Run Tests

pytest

Code Quality

# Format code
black src tests

# Lint code
ruff check src tests

# Type checking
mypy src

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run quality checks
  6. Submit a pull request

Support

Changelog

v0.1.0

  • Initial release
  • Core backup and restore functionality
  • MCP protocol compliance
  • CLI interface
  • Cross-platform support

Metadata

Release files for mcp-auto-backup 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-auto-backup 0.1.1
File Size Uploaded Provenance
mcp_auto_backup-0.1.1.tar.gz 21.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-auto-backup 0.1.1
File Interpreter ABI Platform
mcp_auto_backup-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.3 kB

Release files / mcp_auto_backup-0.1.1.tar.gz

Download URL mcp_auto_backup-0.1.1.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6ac7539ac6181dc700de10bcf2838f535f5fcea10185342747227657cdc1d5ff
BLAKE2b-256 checksum
How to use checksums
97c1f2f8e018561e857d8d77ebb7d7be8f03f3fa07c94817322496e4f6fa8a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / mcp_auto_backup-0.1.1-py3-none-any.whl

Download URL mcp_auto_backup-0.1.1-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
091ad036b758958ae404f738331b7bd9095334f5b94d9f42a60504356e798e49
BLAKE2b-256 checksum
How to use checksums
e89c18a8aeb0ffb4a362b1c52debbd051fa6312c51ff1b711f453fc41ddb4737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Security for mcp-auto-backup 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page