v0.5.2
Closes #12. Two features: whole-setup diagnostics, and making the write preview mandatory.
Breaking / Behaviour changes
-
execute_write_querynow defaults todry_run=true, and the preview is enforced rather
than advisory. A commit (dry_run=false) is rejected unless the identical statement was
dry-run first. A bare call therefore previews instead of committing — an agent that used to
call the tool and have it write will now get a preview back.The grant fingerprints database + SQL + params with a 10-minute TTL.
skip_dry_run=true
exists solely for an agent to attest the user explicitly asked to skip the preview.Gate order is now
mode→ dry-run-first →yolo→user_consent.yolocannot skip the
preview, and nothing can ever make areaddatabase writable.
Added
-
doctor— whole-setup diagnostics, not just connectivity. One engine (doctor.py), two
surfaces:db-conn-mcp doctor [--offline](exit 0 only if nothing fails, 2 otherwise) and a
doctorMCP tool returning{check, status, detail, suggested_action}so an agent can
self-diagnose mid-session. 23 tools total.Six checks, each drawn from a real failure during the 0.5.0 → 0.5.1 upgrade: running server
processes older than the installed package (psutil optional, and it reports its own host
process when stale); a cache-bypassed PyPI version check; per-database connectivity plus a
credential-free listener probe of fallback ports, catching "a different local Postgres
answered my port"; config-schema typos with did-you-mean hints; secrets exposure (POSIX file
mode, git-committability); and injected client entries whose command path no longer exists.The engine never raises — a crashing check degrades to a
failnaming only the exception
type. A poisoned-DSN sweep test asserts no DSN, host, user or password can reach any finding,
including via pydantic validation errors (Rule 6). -
check_databaseUNREACHABLE results now reportfailed_port.
Changed
- MCP-client helpers moved from
cli.pyinto a newclients.py(re-exported for
compatibility), unlocking reuse without a circular import.
Full Changelog: v0.5.1...v0.5.2