Skip to content

fix(hooks): auto-allow govreposcrape + investigate agent mcpServers scoping (#215 #24)#351

Open
tractorjuice wants to merge 8 commits intomainfrom
feat/agent-mcpservers-scoping
Open

fix(hooks): auto-allow govreposcrape + investigate agent mcpServers scoping (#215 #24)#351
tractorjuice wants to merge 8 commits intomainfrom
feat/agent-mcpservers-scoping

Conversation

@tractorjuice
Copy link
Copy Markdown
Owner

Summary

Two things in this PR:

1. Shipping — fix(hooks): auto-allow mcp__govreposcrape__
Pre-existing gap in arckit-claude/hooks/allow-mcp-tools.mjs: 4 of 5 bundled MCPs were in the auto-allow list but govreposcrape was missing. Every gov-* agent run was hitting a permission dialog on every call. Added the prefix; updated the JSDoc header to list all 5 bundled MCPs.

2. Investigation (aborted) — agent mcpServers frontmatter scoping
Attempted to apply Claude Code v2.1.117's mcpServers agent frontmatter to scope 10 ArcKit agents to only the MCP servers each needs (issue #215 item #24). A verification spike proved the frontmatter is fully inert for Task-tool-spawned agents — which is ArcKit's invocation pattern. Aborted.

Spike findings

Variant tested on arckit-aws-research Result
mcpServers: ["govreposcrape"] (aws-knowledge excluded) Agent still called mcp__aws-knowledge__* successfully
mcpServers: [] (deny-all) Agent still called mcp__aws-knowledge__* successfully

Both should have blocked AWS MCP access if enforced. Both ran normally. Matches v2.1.117 changelog wording: "loaded for main-thread agent sessions via --agent" — Task-tool spawns are out of scope.

Artifacts kept on branch

  • docs/superpowers/specs/2026-04-22-agent-mcpservers-scoping-design.md (Status: ABORTED, with Spike findings section)
  • docs/superpowers/plans/2026-04-22-agent-mcpservers-scoping.md (reference — plan was not executed beyond Task 1 + Task 7)
  • Spike commit history (3 commits showing what was tried)

Version

Plugin bumped to 4.9.2 (patch bump for the hook fix).

Follow-up

Filed in issue #215 comment: explore whether disallowedTools frontmatter accepts glob patterns (e.g. "mcp__aws-knowledge__*") as an alternative path to per-agent MCP scoping that works on Task-tool spawns.

Also noted: will file upstream feature request on Claude Code repo asking for mcpServers to apply to Task-tool invocations.

Test plan

  • node --check arckit-claude/hooks/allow-mcp-tools.mjs — passes
  • Spec compliance review on hook fix — approved
  • Code quality review on hook fix — approved (no critical or important issues)
  • Spike verified mcpServers inert on Task-tool spawns via live session in arckit-test-project-v17
  • Manual smoke: run /arckit:gov-reuse in any test repo to confirm no PermissionRequest dialog fires for mcp__govreposcrape__* (post-merge validation)

Closes item #24 of #215 as not applicable.

🤖 Generated with Claude Code

tractorjuice and others added 8 commits April 22, 2026 10:54
Design spec for Cluster A of issue #215: scope 10 ArcKit agents
with Claude Code v2.1.117 mcpServers frontmatter. Includes
verification spike gate, per-agent MCP mapping, converter update,
and allow-mcp-tools.mjs govreposcrape gap-fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
15-task plan covering verification spike (gate), 10-agent frontmatter
rollout in 4 groups, converter update, allow-mcp-tools.mjs gap fix,
5-canary matrix smoke test, and close-out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Forces marketplace cache invalidation so test repos pick up the
feat/agent-mcpservers-scoping branch. Full version sync via
bump-version.sh happens at merge time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
….9.3)

Temporarily scopes aws-research agent to only aws-knowledge MCP
(deliberately omitting govreposcrape) to verify whether mcpServers
frontmatter is honored when the agent is spawned via the Task tool.
Will be reverted after spike.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…4.9.4)

Remove aws-knowledge from the agent that needs it most. If the allow-list
is enforced, AWS MCP calls should fail and the agent cannot function.
If calls succeed anyway, the frontmatter is ignored on Task-tool spawns.
Sharper signal than the previous test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Final spike variant: deny-all allow-list. If even an empty list lets the
agent call AWS MCP tools, the frontmatter field is fully inert on
Task-tool spawns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Revert aws-research canary, reset plugin version to 4.9.2 (hook fix
patch baseline), and document spike findings in the design spec.

Verdict: both mcpServers=["govreposcrape"] (excluding aws-knowledge) and
mcpServers=[] (empty allow-list) failed to restrict MCP access when the
agent was spawned via Task tool. Matches v2.1.117 changelog wording
("loaded for main-thread agent sessions via --agent").

Keeps: Task 7 (allow-mcp-tools.mjs govreposcrape fix) — independent win.
Closes #24 of #215 as not applicable to our invocation pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant