fix(mcp): confirmation gate, migration guards, drift fallback - #519
Merged
Conversation
…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
force-pushed
the
fix/mcp-bugs-batch-1
branch
from
August 25, 2026 13:23
bb8ecac to
39eaee5
Compare
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-runin the MCP context. A newconfirm: trueboolean 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-nameto find containers deployed under a different project name.#518 — Health/deploy crash with unbound variable
Guard migration steps in
lib/cmd_db.shagainst 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/stoplib/cmd_drift_images.sh— fallback container enumerationlib/cmd_db.sh— migration env var guardslib/health.sh— additional container detection fallbackTesting
shellcheck -x -S warningwith zero findings.Closes #516, #517, #518