borg-mcp
OfficialProvides read-only access to BorgBackup repositories, offering tools to list repositories, view repository info, list archives, get archive details, check the latest archive, and preview prune operations.
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., "@borg-mcpWhat would prune remove from home?"
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.
A read-only MCP server for BorgBackup operational status.
borg-mcp lets AI agents (Claude, and other MCP clients) answer questions like "is my backup fresh?", "how big is the repo?", "what would prune remove?" — without any ability to modify or destroy backups.
It is a companion project to borg, born from borg#9955. It is intentionally not part of borg core: the safety boundary for untrusted AI agents lives in this small, auditable project.
Status: pre-alpha, under development. Requires borg2 (no borg 1.x support).
Security model
The MCP client (the agent) is treated as untrusted input — it may be prompt-injected or simply wrong. Therefore:
Command allowlist, not passthrough. Only a fixed set of borg subcommands with fixed argument templates is ever executed. No agent-supplied flags, no shell.
Repository allowlist. Repositories are configured server-side with aliases; the agent refers to
"home", never to a raw path or URL.No secrets over MCP. Passphrases come from configured passcommands on the server side and never appear in tool results or logs.
Sanitized, size-capped output. Raw file listings are off by default (explicit config opt-in); all listings are paginated. borg's stderr is sanitized before an error reaches the agent: tracebacks are withheld (logged server-side instead), the passcommand line is redacted, and control characters are stripped.
Read-only by construction — and by enforcement. borg-mcp never runs prune/delete/compact/repair/restore. For defense in depth, run it against repositories accessed via an SSH key that is restricted server-side to read-only
borg serve, and run borg-mcp itself as an unprivileged user.Audit log. Every tool invocation is logged.
Never in scope: executing destructive operations, key export, passphrase handling over MCP, arbitrary borg commands.
Related MCP server: CodeAudit MCP
Requirements
Python >= 3.11
borg2, installed from the master branch (borg-mcp drives the
borgCLI; it does not import borg internals)
Installation
There is no PyPI release; install from git:
pip install git+https://github.com/borgbackup/borg-mcp.gitor from a checkout: pip install .
Configuration
TOML, at ~/.config/borg-mcp/config.toml (or /etc/borg-mcp.toml).
The config file holds all security-relevant settings and must not be
writable by the agent's account — there are deliberately no CLI overrides.
[server]
allow_file_listing = false # raw archive contents listing, off by default
timeout = 300
max_items = 1000 # pagination cap for listings
[repos.home]
location = "ssh://backup@host/./home"
description = "workstation home dirs, nightly"
passcommand = "cat /path/to/passphrase-file"The passcommand must read the passphrase from somewhere safe: a file only
readable by the borg-mcp user, or a keyring/secret-service CLI. Never put
the passphrase inline (as in passcommand = "echo secret"): the command
line is visible in ps output while it runs.
Usage
borg-mcp serve [--config PATH] # run the stdio MCP server
borg-mcp check [--config PATH] [ALIAS ...]
# validate config; with aliases, test
# repository accessMCP client configuration (e.g. Claude Code .mcp.json):
{
"mcpServers": {
"borg": {
"command": "borg-mcp",
"args": ["serve", "--config", "/path/to/config.toml"]
}
}
}Tools
tool | answers |
| which repositories can I ask about? |
| repository ID, size, encryption mode |
| which archives exist? (paginated, filterable) |
| stats, duration, hostname for one archive |
| is my backup fresh? |
| what would a prune with these keep rules remove? |
prune_preview never deletes anything: --dry-run is part of the command
template and cannot be influenced by the client, and the test suite asserts
that every prune command borg-mcp can construct contains it.
These tools exist only when allow_file_listing = true, because they
disclose the names of the backed up files:
tool | answers |
| which files are in this archive? |
| which files changed between two archives? |
License
This server cannot be installed
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 Servers
- Alicense-qualityCmaintenanceRemote MCP server enabling AI clients to securely inspect repositories over SSH with read-only tools.Last updatedMIT
- Alicense-qualityCmaintenanceA read-only MCP server for AI coding agents to inspect repositories, audit code quality, route engineering skills, and plan safe issue/PR workflows.Last updated1MIT
- Alicense-qualityBmaintenanceA read-only MCP server that gives coding agents structured, read-only access to sibling repositories, ensuring security by design with zero write tools.Last updatedMIT
- Alicense-qualityBmaintenanceA read-only MCP server for code reading with intelligent caching, line-range selection, and language detection, enabling AI assistants to efficiently and safely explore file systems.Last updatedMIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
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/borgbackup/borg-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server