Skip to main content
Glama
time-machine-mcp

time-machine-mcp

by deeplook

Time Machine MCP Server

This MCP (Model Context Protocol) server exposes Apple macOS Time Machine utilities (tmutil) to LLMs. It allows you to manage backups, check status, and inspect snapshots directly using natural language.

Features

The server provides the following tools and resources:

  • Backup Management: start_backup, stop_backup, disable, enable

  • Snapshot Inspection: list_backups, latest_backup, list_local_snapshots, unique_size

  • Maintenance: delete_backups, thin_local_snapshots, verify_checksums, calculate_drift

  • Configuration: add_exclusion, remove_exclusion, set_destination, set_quota

  • Resources: Access to the tmutil man page.

Related MCP server: macos-computer-use-mcp

Prerequisites

  • macOS: This server relies on the tmutil system command, which is specific to macOS.

  • Python 3.12+ (lower versions might work, too)

  • uv: Recommended for dependency management.

Installation

This installs a time-machine-mcp executable:

❯ uv tool install "git+https://github.com/deeplook/time-machine-mcp-server.git"

❯ uv tool install .

Verify the tool has been installed:

❯ uv tool list | grep time-machine
time-machine-mcp-server v0.1.0
- time-machine-mcp

Usage

Gemini CLI

Add an entry for this server to your ~/.gemini/settings.json:

{
  "mcpServers": {
    "time-machine-mcp": {
      "command": "time-machine-mcp"
    }
  }
}
❯ gemini mcp list | grep time-machine
✓ time-machine-mcp: time-machine-mcp  (stdio) - Connected

Claude Desktop (Anthropic)

Edit ~/Library/Application Support/Claude/claude_desktop_config.json and add an entry under mcpServers:

"time-machine-mcp": {
  "command": "time-machine-mcp"
}

Example chat client (source-only)

tm_chat.py is an example client and is not shipped in the installed tool. Run it from a clone:

❯ git clone https://github.com/deeplook/time-machine-mcp-server
❯ cd time-machine-mcp-server
❯ uv sync --extra chat
❯ uv run --script tm_chat.py

Claude Code CLI (Anthropic)

❯ claude mcp add time-machine -- time-machine-mcp

❯ claude mcp list | grep time-machine
time-machine: time-machine-mcp  - ✓ Connected

Codex CLI (OpenAI)

❯ codex mcp add time-machine-mcp -- $(which time-machine-mcp)
❯ grep time ~/.codex/config.toml
❯ codex mcp list | grep time-machine

Example Requests

Here are some natural language requests you can use with this server (please note that some might take a long time depending on the size of the backups):

  1. "Start a new backup immediately."

  2. "What is the current status of Time Machine?"

  3. "List all my completed backups."

  4. "Show me the path to the latest backup."

  5. "Exclude the '/Users/me/Downloads' directory from future backups."

  6. "Where are my backups currently being stored?"

  7. "Compare the '/Users/me/Projects' directory with the latest backup."

  8. "Stop the currently running backup."

  9. "Restore '/Users/me/important.doc' from the latest backup to the Desktop."

  10. "List the 10 largest files in my latest time-machine backup."

Transport

This server only supports stdio transport (the default for MCP). SSE/HTTP transport is intentionally not supported because:

  • Time Machine is local: Backups are managed on the local machine; there's no need for network access.

  • Privileged operations: Many commands require sudo and expose destructive actions (delete_backups, restore).

  • No authentication overhead: stdio provides process-level isolation without requiring API keys or TLS.

If you need remote management of Time Machine across multiple Macs, see SSE_IMPLEMENTATION.md for the security controls that would be required.

Limitations

  • There is no tmutil command to list existing exclusions.

  • Some tmutil operations can be slow and may time out in clients with short tool timeouts.

  • Some operations may require additional permissions (e.g., Full Disk Access and/or sudo).

Privileged Operations

Some Time Machine operations require root privileges. The MCP server uses sudo -n (non-interactive), which fails if a password is required—this is intentional since password prompts would break the stdio protocol.

Operations requiring root:

Operation

Needs Root

delete_backups

Yes

associate_disk

Yes

enable / disable

Yes

restore

Sometimes

start_backup, status, list_backups

No

Options for enabling privileged operations:

  1. Pre-authenticate sudo (recommended for casual use)

    Run sudo -v before starting your MCP client to cache credentials:

    sudo -v && claude  # or gemini, etc.

    Credentials typically last 5-15 minutes depending on your sudoers config.

  2. Passwordless sudo for tmutil (persistent)

    Create /etc/sudoers.d/tmutil with:

    %admin ALL=(ALL) NOPASSWD: /usr/bin/tmutil

    This allows the admin group to run tmutil without a password.

  3. Handle manually

    When privileged operations fail, the server returns helpful error messages suggesting the manual command to run.

Token Usage

Several tools produce potentially large output (list_backups, list_local_snapshots, compare_paths, calculate_drift, unique_size). These always write results to a file (e.g., /tmp/tm_listbackups_20260127_143052.txt) and return only a summary:

{"output_file": "/tmp/tm_listbackups_20260127_143052.txt", "line_count": 847, "size_bytes": 53248}

The LLM will report what was written and ask if you want to see the contents. You can:

  • Post-process the file yourself

  • Ask the LLM to read specific parts or the entire file

License

MIT

Available Tools

31 tools
add_exclusionB

Add exclusions for specified items using -p for path-based or -v for volume-based exclusions.

This tool configures Time Machine to skip designated files, directories, or volumes during backups. It requires appropriate privileges for certain operations and integrates seamlessly with MCP clients for automation.

Inputs: items (required), path_mode, volume_mode. Returns: result

associate_diskB

Associate a disk with a backup volume, optionally for all matching volumes.

This function re-links a local disk to its corresponding backup history in Time Machine. It is useful after disk erasures or replacements to maintain continuity in backup associations. Requires root and Full Disk Access privileges.

Inputs: mount_point (required), volume_backup_directory (required), all_volumes. Returns: result

calculate_driftB

Calculate drift for a specified machine directory in Time Machine backups.

This tool analyzes changes between snapshots to quantify data drift over time. Results are written to a file and a summary is returned. Ask the user if they want to see the contents, then read the file if requested.

Inputs: machine_directory (required). Returns: object

compare_pathsA

Compare backups or paths with customizable options, depth, and ignore lists.

This function performs differential analysis between files, directories, or snapshots. Results are written to a file and a summary is returned. Ask the user if they want to see the contents, then read the file if requested.

Inputs: depth, path1, path2, options, +2 more. Returns: object

delete_backupsA

Delete specified backups or paths from Time Machine.

This tool removes unwanted snapshots or files while preserving backup structure. It requires careful usage to avoid data loss and typically demands root privileges.

Inputs: path, timestamp, backup_mount_point. Returns: result

delete_in_progressB

Delete in-progress backups for a given machine directory.

This function halts and removes ongoing backup operations to free resources. It is particularly useful for resolving stalled backups or reclaiming space.

Inputs: machine_directory (required). Returns: result

delete_local_snapshotsB

Delete local snapshots, optionally by mount point or date.

This tool manages local Time Machine snapshots to optimize storage usage. It enables selective removal without affecting remote backups.

Inputs: mount_point, snapshot_date. Returns: result

destination_infoA

Retrieve information about Time Machine backup destinations.

This function lists configured destinations, including types and identifiers. It supports XML output for structured parsing in automated workflows.

Inputs: xml_format. Returns: result

disableA

Disable Time Machine automatic backups.

This tool turns off scheduled backups, requiring root privileges for execution. It is useful for temporary suspension during system maintenance.

Inputs: no named parameters. Returns: result

enableA

Enable Time Machine automatic backups.

This function activates scheduled backups, necessitating root access. It restores normal operation after a disable command.

Inputs: no named parameters. Returns: result

get_helpB

Get help information for a specific tmutil verb.

This tool fetches detailed usage for individual tmutil commands. It serves as an on-demand reference for MCP users exploring functionalities.

Inputs: verb (required). Returns: result

inherit_backupB

Inherit a backup machine directory or sparse bundle for the current machine.

This function reassigns backup ownership to the current host. It is essential for migrating or claiming existing backups.

Inputs: target (required). Returns: result

is_excludedB

Check if specified items are excluded from Time Machine backups.

This tool verifies exclusion status for files, directories, or volumes. It provides clarity on backup configurations without modifications.

Inputs: items (required). Returns: result

latest_backupB

Retrieve the path to the latest Time Machine backup.

This function identifies the most recent snapshot for the computer. It offers formatting options for machine-readable or timestamp outputs.

Inputs: mount_point, machine_format, timestamp_format. Returns: result

list_backupsB

List Time Machine backups.

This tool enumerates completed snapshots for the computer. Results are written to a file and a summary is returned. Ask the user if they want to see the contents, then read the file if requested.

Inputs: mount_point, machine_format, timestamp_format. Returns: object

list_local_snapshot_datesC

List dates of local Time Machine snapshots.

This function retrieves timestamp information for local backups. It aids in managing space by identifying available snapshots.

Inputs: mount_point. Returns: result

list_local_snapshotsB

List local snapshots for a specified mount point.

This tool provides detailed listings of on-device Time Machine data. Results are written to a file and a summary is returned. Ask the user if they want to see the contents, then read the file if requested.

Inputs: mount_point (required). Returns: object

local_snapshotA

Create a new local Time Machine snapshot.

This function generates an immediate local backup point. It supports quick recovery options without external storage.

Inputs: no named parameters. Returns: result

machine_directoryA

Retrieve the path to the current machine directory in Time Machine.

This tool identifies the storage location for the computer's backups. It is foundational for advanced backup management operations.

Inputs: no named parameters. Returns: result

remove_destinationB

Remove a Time Machine destination by its unique identifier.

This function clears configured backup targets from the system. It requires the destination ID from destination_info for precision.

Inputs: destination_id (required). Returns: result

remove_exclusionB

Remove exclusions for specified items.

This tool re-enables backing up of previously excluded items. It mirrors add_exclusion in options and privilege requirements.

Inputs: items (required), path_mode, volume_mode. Returns: result

restoreC

Restore items from source paths to a destination.

This function recovers data from snapshots to specified locations. It preserves metadata where possible and supports verbose logging.

Inputs: dst (required), src_paths (required), verbose. Returns: result

set_destinationB

Set a backup destination, supporting local volumes or AFP URLs.

This tool configures new or additional targets for Time Machine. It handles authentication for network shares when required.

Inputs: target (required), add, password. Returns: result

set_quotaC

Set a storage quota for a Time Machine destination.

This function limits space usage on backup volumes. It prevents overconsumption and requires destination identification.

Inputs: destination_id (required), quota_in_gigabytes (required). Returns: result

start_backupB

Initiate a Time Machine backup with optional parameters.

This tool triggers immediate or automated backups. It returns immediately after starting; use status() to monitor progress. Blocking mode is not supported as backups can take hours and would timeout MCP tool calls.

Inputs: auto, rotation, destination. Returns: result

statusA

Retrieve the current Time Machine backup status.

This tool parses the plist output for detailed session information. It includes progress, phase, and potential errors for monitoring.

Inputs: no named parameters. Returns: object

stop_backupB

Stop a currently running Time Machine backup.

This function interrupts ongoing operations safely. It is useful for freeing system resources promptly.

Inputs: no named parameters. Returns: result

thin_local_snapshotsC

Thin local snapshots by purging specified amounts.

This tool reduces snapshot count to manage disk space. It allows urgency levels for prioritized cleanup.

Inputs: mount_point (required), urgency, purge_amount. Returns: result

unique_sizeB

Calculate the unique size of specified paths in backups.

This function determines space occupied excluding shared data. Results are written to a file and a summary is returned. Ask the user if they want to see the contents, then read the file if requested.

Inputs: paths (required). Returns: object

verify_checksumsB

Verify checksums for paths in Time Machine backups.

This tool checks data integrity against stored hashes. It is vital for ensuring backup reliability over time.

Inputs: paths (required). Returns: result

versionA

Retrieve the version of tmutil.

This function provides the current tool version for compatibility checks. It is a simple query without additional requirements.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 31 tools

    Disambiguation4/5

    Most tools map to clearly distinct tmutil actions, and descriptions do a good job distinguishing backup, restore, status, destination, and exclusion operations. Some overlap remains among deletion and listing variants, especially delete_backups, delete_local_snapshots, thin_local_snapshots, and the local snapshot listing tools.

    Naming Consistency3/5

    All names use snake_case and are readable, but the set mixes verb_noun names such as list_backups and set_destination with bare verbs like restore and enable, plus noun phrases such as status, version, and destination_info. The convention is mixed rather than consistently verb_noun.

    Tool Count2/5

    At 31 tools, the surface is large for an MCP server even given the breadth of tmutil. Many tools are thin wrappers around individual tmutil verbs, and the set could likely be consolidated without losing core backup-management capability.

    Completeness5/5

    The tool surface covers the Time Machine lifecycle comprehensively: backup start/stop/status, restore, local snapshots, deletion/thinning, destination management, quotas, exclusions, checksum verification, drift analysis, comparison, inheritance, association, and help/version queries.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage local tmux sessions, including creating and controlling sessions, windows, and panes, sending commands, and capturing terminal output.
      16
      7 npm
      Do What The F*ck You Want To Public
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides 146 MCP tools for AI agents to control macOS, including screenshots, mouse, keyboard, window management, app automation, file system, OCR, and built-in app semantics like Calendar, Mail, Safari, Music, Messages. Enables full control over macOS through natural language.
      2
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Lets AI agents manage local virtual machines: create macOS and Linux VMs on Apple silicon and WSL distros on Windows, start/stop, clone, back up, and run commands inside them.
      4,068
      -