Documentation
¶
Overview ¶
Package mcpserver exposes an opened Sentra repository as a Model Context Protocol server, so outside agents (Claude, editors, anything speaking MCP) can query snapshots and drive confirm-gated operations within the same guardrails the CLI and TUI enforce.
Two rules shape every tool here (see the spec in docs/superpowers/specs/2026-08-28-mcp-server-design.md):
Metadata only, never contents. Tools return names, sizes, times, ids, and stats. Nothing reads file bodies out of snapshots, so a malicious or curious client cannot exfiltrate backed-up data through this surface.
Mutations are two-phase. MCP has no interactive prompt, so the confirm gate becomes protocol: plan_* validates and returns a single-use token bound to that exact plan; confirm_* executes it. Tokens expire (tokenTTL) and die on first use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.5.0
type Options struct {
// Version is reported to MCP clients in the server's implementation
// info.
Version string
// Walker is the directory-walk configuration every confirmed backup
// runs with. The Server never sees sentra.yaml, so the CLI resolves
// backup.ignore_file / exclude_caches / concurrency into this exactly
// as `sentra backup` does; leaving it zero means MCP-driven backups
// silently fall back to the repo's legacy defaults (.sentraignore,
// caches excluded) and diverge from what the operator configured.
Walker walker.Options
}
Options configures a Server beyond the repository it serves.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an opened repository with the MCP tool set. now is a seam for the token-expiry tests.