BTRFS Snapper MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BTRFS Snapper MCPlist snapshots for root config"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BTRFS Snapper MCP
An MCP (Model Context Protocol) server for managing BTRFS snapshots via Snapper and monitoring BTRFS filesystem health. Exposes two unified tools with action-based dispatch to minimize tool proliferation while providing full snapshot management and disk health monitoring.
Features
Two-tool design:
snapperfor snapshots,btrfs_healthfor filesystem monitoringFull Snapper support: list, create, delete, rollback, cleanup, diff, status
BTRFS health monitoring: usage, device stats, scrub status, balance status
Flexible configuration: Environment variables for cross-system portability
No hardcoded paths: Works with any Snapper configuration and mount points
Related MCP server: Proxmox MCP Server
Installation
From PyPI (recommended)
pip install snapper-mcpUsing uvx (no install required)
uvx snapper-mcpFrom source
git clone https://github.com/danielrosehill/BTRFS-Snapper-MCP.git
cd BTRFS-Snapper-MCP
pip install -e .Configuration
The server is configured via environment variables, making it portable across systems:
Variable | Default | Description |
|
| Set to |
|
| Path to snapper binary |
|
| Path to btrfs binary |
|
| Path to sudo binary |
|
| Default snapper config name |
|
| Default BTRFS mount point |
|
| Command timeout in seconds |
MCP Client Configuration
Claude Code / Claude Desktop
Add to your MCP settings (e.g., ~/.claude/settings.json or Claude Desktop config):
{
"mcpServers": {
"btrfs-snapper": {
"command": "uvx",
"args": ["snapper-mcp"]
}
}
}With custom configuration
{
"mcpServers": {
"btrfs-snapper": {
"command": "uvx",
"args": ["snapper-mcp"],
"env": {
"SNAPPER_MCP_DEFAULT_CONFIG": "root",
"SNAPPER_MCP_DEFAULT_MOUNT": "/",
"SNAPPER_MCP_USE_SUDO": "true"
}
}
}
}Tools
snapper - Snapshot Management
Manages BTRFS snapshots via Snapper.
Actions
Action | Description | Required Parameters |
| List available snapper configurations | - |
| Show all snapshots for a config |
|
| Create a new snapshot |
|
| Remove a snapshot by number |
|
| Restore to a previous snapshot |
|
| Prune snapshots using an algorithm |
|
| Show file differences between snapshots |
|
| List changed files between snapshots |
|
Examples
// List configurations
{"action": "configs"}
// List snapshots
{"action": "list", "config": "root"}
// Create snapshot
{"action": "create", "config": "root", "description": "Before system update"}
// Delete snapshot
{"action": "delete", "config": "root", "snapshot_id": 5}
// Rollback (requires reboot)
{"action": "rollback", "config": "root", "snapshot_id": 3}
// Cleanup with algorithm
{"action": "cleanup", "config": "root", "cleanup_algorithm": "number"}
// Compare snapshots
{"action": "diff", "config": "root", "snapshot_id": 1, "snapshot_id_end": 5}Cleanup algorithms:
number: Keep a fixed number of snapshotstimeline: Keep snapshots based on age (hourly, daily, weekly, monthly, yearly)empty-pre-post: Remove empty pre/post snapshot pairs
btrfs_health - Filesystem Health Monitoring
Monitors BTRFS filesystem health and status.
Actions
Action | Description | Parameters |
| Comprehensive filesystem space usage |
|
| List devices in the BTRFS array |
|
| Device error statistics |
|
| Status of scrub operation |
|
| Status of balance operation |
|
| Space allocation by data type |
|
| Filesystem information |
|
Examples
// Check filesystem usage
{"action": "usage", "mount_point": "/"}
// Check for device errors
{"action": "stats", "mount_point": "/"}
// Check scrub status
{"action": "scrub_status", "mount_point": "/"}
// Show data/metadata allocation
{"action": "df", "mount_point": "/"}
// Show filesystem info
{"action": "filesystem_show"}Prerequisites
Linux with BTRFS filesystem
Snapper installed and configured (for snapshot management)
Python 3.10+
Sudo access (unless running as root or with appropriate permissions)
Installing Snapper
Ubuntu/Debian:
sudo apt install snapperFedora/openSUSE:
sudo dnf install snapper
# or
sudo zypper install snapperCreating Snapper Configs
# For root filesystem
sudo snapper -c root create-config /
# For home partition
sudo snapper -c home create-config /homeSudo Configuration
For passwordless operation, add to /etc/sudoers.d/btrfs-snapper:
yourusername ALL=(ALL) NOPASSWD: /usr/bin/snapper
yourusername ALL=(ALL) NOPASSWD: /usr/bin/btrfsOr disable sudo if you have direct permissions:
{
"env": {
"SNAPPER_MCP_USE_SUDO": "false"
}
}Adapting for Other Systems
Different Snapshot Tools
The architecture can be adapted for other snapshot tools (e.g., Timeshift, ZFS snapshots) by:
Replacing the
run_snapper_command()function with your tool's CLIAdjusting the action handlers for your tool's command syntax
Updating environment variables as needed
Different Filesystems
For ZFS or other filesystems:
Replace
run_btrfs_command()with your filesystem's CLIUpdate
BtrfsActionenum with relevant actionsImplement new handlers for your filesystem's commands
The action-dispatch pattern remains the same regardless of underlying tools.
License
MIT
Available Tools
2 toolsbtrfs_healthA
Check BTRFS filesystem health and status. Monitor disk usage, errors, and maintenance operations.
Actions:
usage: Comprehensive filesystem space usage
devices: List devices in the BTRFS array
stats: Device error statistics (corruption, read/write errors)
scrub_status: Status of scrub operation (data integrity check)
balance_status: Status of balance operation (data redistribution)
df: Space allocation by data type (Data, Metadata, System)
filesystem_show: Filesystem information and device list
Current default mount: / Using sudo: True
Examples:
Check usage: action="usage", mount_point="/"
Check for errors: action="stats", mount_point="/"
Scrub status: action="scrub_status", mount_point="/"
Show filesystem: action="filesystem_show"
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | The btrfs action: usage (space usage), devices (list devices), stats (error statistics), scrub_status (scrub progress), balance_status (balance progress), df (data/metadata usage), filesystem_show (filesystem info) | |
| mount_point | No | BTRFS mount point (e.g., '/', '/home'). Uses default from SNAPPER_MCP_DEFAULT_MOUNT if not specified. | |
| device | No | Specific device path for stats action (e.g., '/dev/sda1'). If not specified, uses mount point. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided so description carries full burden. It discloses sudo usage and default mount, but doesn't explicitly state whether actions are read-only or if they can trigger side effects. Actions appear to be monitoring only, but not explicitly confirmed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with bullet points and examples. Front-loaded with purpose. Concise yet comprehensive. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but actions are self-explanatory. Covers key aspects like default mount, sudo requirement, and common examples. Lacks details on error handling or return format, but adequate for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage 100%, baseline 3. Description adds significant value: explains each action in detail, provides usage examples, and clarifies the 'device' parameter usage. Exceeds baseline with rich context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks BTRFS filesystem health and status, and lists specific actions (usage, devices, stats, etc.). It distinguishes from sibling tool 'snapper' implicitly via different purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides examples for common actions and mentions default mount and sudo usage. However, lacks explicit guidance on when not to use or alternatives beyond sibling name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
snapperA
Manage BTRFS snapshots via Snapper. A unified tool for all snapshot operations.
Actions:
configs: List available snapper configurations
list: Show all snapshots for a config
create: Create a new snapshot (optionally with description)
delete: Remove a snapshot by number
rollback: Restore system to a previous snapshot (requires reboot)
cleanup: Prune snapshots using an algorithm (number, timeline, empty-pre-post)
diff: Show file differences between two snapshots
status: List changed files between two snapshots
Current default config: root Using sudo: True
Examples:
List configs: action="configs"
List snapshots: action="list", config="root"
Create snapshot: action="create", config="root", description="Before update"
Delete snapshot: action="delete", config="root", snapshot_id=5
Compare snapshots: action="diff", config="root", snapshot_id=1, snapshot_id_end=5
Cleanup old snapshots: action="cleanup", config="root", cleanup_algorithm="number"
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | The snapper action to perform: list (show snapshots), create (new snapshot), delete (remove snapshot), rollback (restore to snapshot), cleanup (prune by algorithm), diff (compare snapshots), status (show changed files), configs (list available configs) | |
| config | No | Snapper configuration name (e.g., 'root', 'home'). Uses default from SNAPPER_MCP_DEFAULT_CONFIG env var if not specified. Use 'configs' action to see available configs. | |
| snapshot_id | No | Snapshot number for delete, rollback, or start of range for diff/status | |
| snapshot_id_end | No | End snapshot number for diff/status range (e.g., diff between snapshot 5 and 10) | |
| description | No | Description for new snapshot (used with 'create' action) | |
| cleanup_algorithm | No | Cleanup algorithm: 'number' (keep N snapshots), 'timeline' (keep by age), 'empty-pre-post' (remove empty pre/post pairs) | |
| sync_after_delete | No | Sync filesystem after delete operation |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Discloses sudo usage, reboot requirement for rollback, default config, and cleanup algorithms – comprehensive behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections and bulleted actions; front-loaded with purpose. Slightly lengthy due to example redundancy, but still clear and organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all actions, parameters, and operational context (sudo, default config). No output schema, but examples imply outputs. Sufficient for agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters. Description provides examples and additional context (e.g., default config from env var) that enhance schema descriptions, justifying above baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states 'Manage BTRFS snapshots via Snapper' and lists all eight supported actions. Distinguishes from sibling 'btrfs_health' which likely deals with health checks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides examples for each action and mentions default config and sudo usage. Though it doesn't explicitly exclude scenarios for sibling tools, the action list and context make when-to-use clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.1.1- First observed
btrfs_health - First observed
snapper
TDQS
The two tools have completely distinct purposes: btrfs_health monitors filesystem health, and snapper manages snapshots. There is no overlap in functionality, so an agent can easily distinguish when to use each.
Both tool names are descriptive and use a clear style (btrfs_health uses prefix 'btrfs_', snapper uses the application name). While there is no strict pattern like verb_noun, the names are intuitive and consistent in being self-explanatory.
Only two tools for a complex domain like BTRFS management is minimal. Each tool bundles many sub-actions, which could be separate tools for better discoverability. The low count suggests an incomplete surface for tasks like defragmentation or advanced configuration.
The tools cover essential BTRFS operations: health monitoring (usage, errors, scrub, balance) and snapshot management (create, delete, rollback, diff, cleanup). Missing are direct balance initiation or defragmentation, but these are covered by status checks, making the set fairly comprehensive for core tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Snapshot and restore service for agent state and DID-bound configuration
Model Context Protocol server for Studex tools, notifications, and profile integrations
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides real-time system metrics and information through a Model Context Protocol interface, enabling access to CPU usage, memory statistics, disk information, network status, and running processes.76-
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Proxmox VE for managing VMs, containers, storage, and cluster resources via natural language through the Model Context Protocol.12MIT
- AlicenseNot gradedqualityCmaintenanceEnables natural language interaction with Home Assistant for managing entities, automations, services, and dashboards via the Model Context Protocol.237MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to monitor and manage Linux infrastructure including services, logs, processes, disk, memory, ports, cron, nginx, Docker, and system health checks via the Model Context Protocol.10MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielrosehill/BTRFS-Snapper-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server