Your AI coding agent already writes the migration. Until now, checking its own work meant shelling out to a CLI and hoping it parsed the output correctly, or read the SQL and guessed. DBLift now ships an MCP (Model Context Protocol) server, so Claude Code, Cursor, GitHub Copilot, and Windsurf can call DBLift's own checks directly, in-process, and get back structured JSON instead of scraped text.
Why a tool call beats a shell command
An agent that shells out to dblift validate has to launch a process, capture stdout, and parse text that was designed for a terminal, not a parser. An MCP tool call skips all of that: the agent gets the same JSON --format json already produces, with none of the subprocess overhead or text-scraping fragility.
More importantly, there's no LLM in the apply path. dblift mcp tools are the same deterministic code paths as the CLI commands they wrap — an agent calling validate gets a real validation result, not a model's best guess about whether a migration is safe.
What's exposed — and what never is
The open-source server ships info, validate, and migrate_dry_run (forced dry-run) out of the box, plus a dblift://history resource. A licence unlocks more: schema diffing, SQL policy checks, export, and eventually a full preflight and evidence snapshot — the same tool set that CLI users get by upgrading, just callable by an agent instead of typed by hand.
Notice what's missing at every level: clean, undo, a real migrate apply, data apply/undo. Nothing that mutates a database or discards history is ever exposed as a tool. An agent can ask "is this migration safe" and "what would this change" — it can't ask DBLift to run it.
Set it up in two minutes
Point your agent's MCP config at dblift mcp:
{
"mcpServers": {
"dblift": {
"command": "dblift",
"args": ["mcp"]
}
}
}
Claude Code reads this from .mcp.json (or claude mcp add dblift -- dblift mcp), Cursor from .cursor/mcp.json, VS Code Copilot from .vscode/mcp.json, Windsurf from ~/.codeium/windsurf/mcp_config.json.
What this looks like in practice
Ask Claude Code to add a migration, and instead of just writing the SQL file and moving on, it can call validate to confirm the history is consistent and migrate_dry_run to preview exactly what will run. With a licence, it can also diff the live schema against what the migrations expect, or pull a full preflight check — the same evidence a release approver would ask for, before anyone opens a PR.
None of this replaces review. It gives the agent the same ground truth a human reviewer already relies on, instead of it inferring migration safety from reading SQL files.
Full setup and tool reference: MCP Server docs