Skip to content

Tag mode filters user MCP tools to only mcp__github_* - was this intentional? #695

@ylgibby

Description

@ylgibby

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-config flag in claude_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_ ones

The 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmcpp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions