Add MCP tools for migration inspection (bd-627d Phase 3)

- Add inspect_migration() tool - calls bd migrate --inspect --json
- Add get_schema_info() tool - calls bd info --schema --json
- Implements abstract methods in BdClientBase
- CLI client calls commands directly
- Daemon client raises NotImplementedError (rare admin commands)

Phase 3 complete. Agents can now inspect migrations via MCP before running them.

Amp-Thread-ID: https://ampcode.com/threads/T-de7e1141-87ac-4b4a-9cea-1b7bc4d51da9
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-02 14:14:13 -08:00
parent 1abe4e75ad
commit 24936937f7
4 changed files with 114 additions and 0 deletions

View File

@@ -430,6 +430,28 @@ class BdDaemonClient(BdClientBase):
# This is a placeholder for when it's added
raise NotImplementedError("Blocked operation not yet supported via daemon")
async def inspect_migration(self) -> dict:
"""Get migration plan and database state for agent analysis.
Returns:
Migration plan dict with registered_migrations, warnings, etc.
Note:
This falls back to CLI since migrations are rare operations
"""
raise NotImplementedError("inspect_migration not supported via daemon - use CLI client")
async def get_schema_info(self) -> dict:
"""Get current database schema for inspection.
Returns:
Schema info dict with tables, version, config, sample IDs, etc.
Note:
This falls back to CLI since schema inspection is a rare operation
"""
raise NotImplementedError("get_schema_info not supported via daemon - use CLI client")
async def add_dependency(self, params: AddDependencyParams) -> None:
"""Add a dependency between issues.