-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Question
In tag mode (src/modes/tag/index.ts), user-specified MCP tools from --allowedTools are filtered to only include GitHub MCP tools:
const userAllowedMCPTools = parseAllowedTools(userClaudeArgs).filter(
(tool) => tool.startsWith("mcp__github_"),
);This was introduced in PR #556 to fix issue #548 (GitHub MCP tools not loading).
Was this intentional to only allow GitHub MCP servers in tag mode?
The Problem
Users who add custom MCP servers via --mcp-config cannot use them in tag mode because their tools get filtered out. For example:
claude_args: |
--mcp-config .github/custom-mcp.json
--allowed-tools "mcp__custom_server__some_tool"The mcp__custom_server__some_tool is filtered out and never added to tagModeTools, so Claude gets permission denied when trying to use it.
Agent Mode Works Differently
In agent mode (src/modes/agent/index.ts), there's no such filter - user's claude_args are passed through as-is:
// Append user's claude_args (which may have more --mcp-config flags)
claudeArgs = `${claudeArgs} ${userClaudeArgs}`.trim();Expected Behavior
Users should be able to add custom MCP servers to tag mode the same way they can in agent mode, as documented in docs/configuration.md:
You can add custom MCP (Model Context Protocol) servers to extend Claude's capabilities using the
--mcp-configflag inclaude_args. These servers merge with the built-in GitHub MCP servers.
Suggested Fix
Remove the .filter((tool) => tool.startsWith("mcp__github_")) and allow all user-specified MCP tools:
const userAllowedMCPTools = parseAllowedTools(userClaudeArgs);
// Include ALL user-specified MCP tools, not just mcp__github_ onesThe MCP server configs for non-GitHub servers come from the user's --mcp-config flag, not from prepareMcpConfig(), so the filter isn't needed.
References
- PR fix(tag): no such tool available mcp__github_* #556 that introduced the filter
- Issue MCP GitHub comment tool fails to load, preventing Claude from updating PR comments with review content #548 that fix(tag): no such tool available mcp__github_* #556 was fixing
docs/configuration.mddocumenting custom MCP server support