Skip to content

fix(mcp): confirmation gate, migration guards, drift fallback - #519

Merged
gfargo merged 1 commit into
mainfrom
fix/mcp-bugs-batch-1
Aug 25, 2026
Merged

fix(mcp): confirmation gate, migration guards, drift fallback#519
gfargo merged 1 commit into
mainfrom
fix/mcp-bugs-batch-1

Conversation

@gfargo

@gfargo gfargo commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes 3 remaining MCP bugs not yet addressed on main. (#502, #508, #509 were resolved by PRs #504, #511, #513 respectively — this PR drops those and focuses on the three that are still open.)

Changes

#516 — Deploy and stop execute without confirmation gate

Deploy and stop now default to --dry-run in the MCP context. A new confirm: true boolean parameter must be passed to execute the real operation, preventing accidental production changes from agent tool calls. Without it, agents see the execution plan and can present it to the user before committing.

#517 — drift_images returns empty for harbor stacks

Add fallback container enumeration in both drift_images_remote (SSH) and _drift_images_detect (local). When the project-name query returns nothing, retry without --project-name to find containers deployed under a different project name.

#518 — Health/deploy crash with unbound variable

Guard migration steps in lib/cmd_db.sh against missing DB env vars (POSTGRES_USER, NEO4J_URI, MIGRATION_IMAGE, etc). Stacks without databases now skip gracefully with a log message instead of crashing with "unbound variable".

Bonus: Additional health fallback

Adds a compose-file-only query as a third-level fallback in health_check_containers, complementing #504's working-dir label fallback for edge cases where neither project-name nor working-dir label matches.

Files changed

  • lib/mcp/tools.sh — confirmation gate for deploy/stop
  • lib/cmd_drift_images.sh — fallback container enumeration
  • lib/cmd_db.sh — migration env var guards
  • lib/health.sh — additional container detection fallback

Testing

  • All modified files pass shellcheck -x -S warning with zero findings.
  • Changes are backward-compatible: CLI behavior unchanged (confirm only affects MCP path).

Closes #516, #517, #518

…517, #518)

- #516: Deploy and stop default to --dry-run in MCP context. A new
  'confirm' boolean parameter must be set to true to execute the real
  operation, preventing accidental production changes from agent calls.

- #517: Add fallback container enumeration in drift_images (remote and
  local). When the project-name query finds nothing, retry without
  --project-name to catch containers deployed under a different name.

- #518: Guard migration steps against missing DB env vars (POSTGRES_USER,
  NEO4J_URI, etc). Stacks without databases now skip gracefully instead
  of crashing with 'unbound variable'.

Also adds a compose-file-only fallback to health_check_containers as
a third-level net after #504's working-dir label fallback.
@gfargo
gfargo force-pushed the fix/mcp-bugs-batch-1 branch from bb8ecac to 39eaee5 Compare August 25, 2026 13:23
@gfargo gfargo changed the title fix(mcp): resolve 6 MCP tool bugs fix(mcp): confirmation gate, migration guards, drift fallback Aug 25, 2026
@gfargo
gfargo merged commit e290575 into main Aug 25, 2026
3 checks passed
@gfargo
gfargo deleted the fix/mcp-bugs-batch-1 branch August 25, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: deploy and stop execute without confirmation gate

1 participant