Skip to content

fix: auto-allow Very Good CLI MCP tools in all run modes#120

Merged
ryzizub merged 1 commit into
mainfrom
claude/sweet-nash-63d81d
Jul 1, 2026
Merged

fix: auto-allow Very Good CLI MCP tools in all run modes#120
ryzizub merged 1 commit into
mainfrom
claude/sweet-nash-63d81d

Conversation

@ryzizub

@ryzizub ryzizub commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the silent dead-end from #109. When the block-cli-workarounds hook redirects the agent from very_good create (shell) to the very-good-cli MCP create tool, that tool has to be on permissions.allow. Under skipAutoPermissionPrompt a non-allowlisted MCP tool fails closed and silently — no dialog, no error — so scaffolding dead-ends with no visible reason. Plugins can't ship permissions.allow entries (no manifest field; plugin settings.json only supports agent/subagentStatusLine), so the fix uses the one runtime lever a plugin has: a PreToolUse hook decision.

check-vgv-cli.sh now returns a PreToolUse allow decision on success. PreToolUse hooks fire before the permission-mode check, so the call is approved in every run mode (interactive, headless, skipAutoPermissionPrompt, bypassPermissions) without the user editing permissions.allow. Only explicit deny/ask rules override an allow — none exist for these tools — so behavior is safe and predictable.

While here, this also fixes a latent matcher bug: the old matcher mcp__very-good-cli__.* never matched the plugin-namespaced tool name used on marketplace installs (mcp__plugin_vgv-ai-flutter-plugin_very-good-cli__*), so the guard was effectively dead for plugin users (related to #53). The matcher is broadened to mcp__.*very-good-cli__.*, which matches both the bare and plugin-namespaced forms.

Changes

  • hooks/scripts/vgv-cli-common.sh — add allow() helper (mirrors deny()).
  • hooks/scripts/check-vgv-cli.sh — on success, allow the call instead of a silent exit 0.
  • hooks/hooks.json — broaden PreToolUse matcher mcp__very-good-cli__.*mcp__.*very-good-cli__.*.
  • README.md + CLAUDE.md — update hook docs.

Missing/outdated CLI still denies with an install/upgrade message (a tool-usability guard, not a run-mode gate).

Verification

  • allow emitted on healthy CLI (1.3.0); deny on stubbed 1.2.0 and on not-installed.
  • Matcher matches mcp__very-good-cli__create and mcp__plugin_vgv-ai-flutter-plugin_very-good-cli__create, skips mcp__dart__*.
  • bash -n clean; hooks.json valid JSON.

Closes #109.

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Code refactor (refactor)
  • Documentation (docs)
  • CI change (ci)
  • Chore (chore)

check-vgv-cli.sh now returns a PreToolUse "allow" decision on success, so
Very Good CLI MCP tools are approved before the permission-mode check and
never dead-end when they aren't on permissions.allow — including under
skipAutoPermissionPrompt, where a non-allowlisted MCP tool otherwise fails
closed and silently (#109).

Also broaden the PreToolUse matcher to `mcp__.*very-good-cli__.*` so the
guard fires for the plugin-namespaced tool name
(`mcp__plugin_<plugin>_very-good-cli__*`) used on marketplace installs; the
old `mcp__very-good-cli__.*` never matched that form.

- Add allow() helper to vgv-cli-common.sh (mirrors deny()).
- Keep deny-with-install-message when the CLI is missing or < 1.3.0.
- Update README and CLAUDE.md hook docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ryzizub ryzizub requested a review from a team as a code owner July 1, 2026 13:06
@ryzizub ryzizub marked this pull request as draft July 1, 2026 13:18
@ryzizub ryzizub marked this pull request as ready for review July 1, 2026 14:17
@ryzizub ryzizub requested a review from omartinma July 1, 2026 14:17
@ryzizub

ryzizub commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

tested with plugin dir with

claude -p "Create a flutter app named demo_app using the very-good-cli create MCP tool"

and this branch succesfully goes with MCP without any stop

@ryzizub ryzizub merged commit 0f3577e into main Jul 1, 2026
5 checks passed
@ryzizub ryzizub deleted the claude/sweet-nash-63d81d branch July 1, 2026 14:55
@vgvbot vgvbot mentioned this pull request Jul 1, 2026
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.

fix: block-cli-workarounds redirect to MCP dead-ends silently when the MCP tool isn't allowlisted

2 participants