Skip to main content
Version: 1.10 (latest)

MCP Server

Databasement includes a built-in Model Context Protocol (MCP) server that lets AI assistants manage your database backups through natural language.

What is MCP?​

MCP is an open protocol that allows AI clients (Claude Code, Cursor, VS Code Copilot, etc.) to discover and call tools exposed by your application. Instead of clicking through the UI, you can say things like:

  • "List my database servers"
  • "Back up the production MySQL server"
  • "Restore the latest snapshot to staging"

The MCP server wraps the same services that power the web UI and REST API, so behavior is consistent across all interfaces.

Available Tools​

ToolDescriptionDestructive?
list-organizations-toolList the organizations you belong to and which one is active.No
list-database-servers-toolList all registered servers with connection details and backup config. Optionally filter by database type.No
list-snapshots-toolList backup snapshots, optionally filtered by server. Returns most recent first.No
trigger-backup-toolTrigger an on-demand backup for a server. Returns snapshot IDs and job IDs for status tracking.No
trigger-restore-toolRestore a snapshot to a target server. Drops and recreates the target database.Yes
get-job-status-toolCheck the status of a backup or restore job (pending, running, completed, failed, cancelled).No

Tools run with the permissions of the token's user: triggering a backup needs the run-backups ability and a restore needs operate-restores (see Permissions).

Setup​

The MCP server is served over the Streamable HTTP transport at /mcp, protected by Sanctum token authentication. Any client that supports remote HTTP servers with a custom header can connect to it directly.

1. Create an API Token​

Open API Tokens from the left menu and create a new token.

2. Configure Your AI Client​

In the examples below, replace https://databasement.example.com with your instance address and YOUR_API_TOKEN with the token from step 1.

claude mcp add --transport http --scope user databasement https://databasement.example.com/mcp \
--header "Authorization: Bearer YOUR_API_TOKEN"

--scope user makes Databasement available in every project, since your backups are not tied to any one codebase.

3. Choose an Organization​

Tools act on your main organization by default. To work in another one, ask the assistant to list your organizations, then add its ID to the endpoint URL (https://databasement.example.com/mcp?org_id=ORG_ID) or send it in an X-Organization-Id header alongside Authorization.